KAuth::ExecuteJob
#include <KAuth/ExecuteJob>
Signals | |
void | newData (const QVariantMap &data) |
void | statusChanged (KAuth::Action::AuthStatus status) |
Signals inherited from KJob | |
void | description (KJob *job, const QString &title, const QPair< QString, QString > &field1=QPair< QString, QString >(), const QPair< QString, QString > &field2=QPair< QString, QString >()) |
void | finished (KJob *job) |
void | infoMessage (KJob *job, const QString &message) |
void | percentChanged (KJob *job, unsigned long percent) |
void | processedAmountChanged (KJob *job, KJob::Unit unit, qulonglong amount) |
void | processedSize (KJob *job, qulonglong size) |
void | result (KJob *job) |
void | resumed (KJob *job) |
void | speed (KJob *job, unsigned long speed) |
void | suspended (KJob *job) |
void | totalAmountChanged (KJob *job, KJob::Unit unit, qulonglong amount) |
void | totalSize (KJob *job, qulonglong size) |
void | warning (KJob *job, const QString &message) |
Public Slots | |
bool | kill (KillVerbosity verbosity=Quietly) |
Public Slots inherited from KJob | |
bool | kill (KJob::KillVerbosity verbosity=KJob::Quietly) |
bool | resume () |
bool | suspend () |
Detailed Description
Job for executing an Action.
To run the action synchonously use KJob::exec() and check the return code for success.
For longer tasks connect KJob::result(KJob*) and any other signals such as percent(KJob*, unsigned long) and newData(const QVariantMap &) then run start().
To check for authentiation success or problems connect to statusChanged(KAuth::Action::AuthStatus status) signal.
Use data() to get the return result of the action.
- Since
- 5.0
Definition at line 39 of file executejob.h.
Constructor & Destructor Documentation
◆ ~ExecuteJob()
|
overridedefault |
Virtual destructor.
Member Function Documentation
◆ action()
Action KAuth::ExecuteJob::action | ( | ) | const |
- Returns
- the action associated with this job
Definition at line 69 of file executejob.cpp.
◆ data()
QVariantMap KAuth::ExecuteJob::data | ( | ) | const |
Use this to get the data set in the action by HelperSupport::progressStep(QVariant) or returned at the end of the action.
This function is particularly useful once the job has completed. During execution, simply read the data in the newData() signal.
- Returns
- the data set by the helper
- See also
- ExecuteJob::newData
Definition at line 74 of file executejob.cpp.
◆ kill
|
slot |
Attempts to halt the execution of the action associated with this job.
You should listen to the finished and result signals to work out whether halting was successful (as long running operations can also take time to shut down cleanly).
- Returns
- Always returns
true
Definition at line 109 of file executejob.cpp.
◆ newData
Signal emitted by the helper to notify the action's progress.
This signal is emitted every time the helper's code calls the HelperSupport::progressStep(QVariantMap) method. This is useful to let the helper notify the execution status of a long action, also providing some data, for example if you want to achieve some sort of progressive loading. The meaning of the data passed here is totally application-dependent. If you only need to pass some percentage, you can use the other signal that pass an int.
- Parameters
-
data The progress data from the helper
◆ start()
|
overridevirtual |
Starts the job asynchronously.
- See also
- KJob::result
- newData
- statusChanged
Implements KJob.
Definition at line 79 of file executejob.cpp.
◆ statusChanged
|
signal |
Signal emitted when the authentication status changes.
- Parameters
-
status the new authentication status
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:13:10 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.