Job for executing an Action.
More...
#include <KAuth/ExecuteJob>
|
bool | kill (KillVerbosity verbosity=Quietly) |
| Attempts to halt the execution of the action associated with this job.
|
|
|
| ~ExecuteJob () override |
| Virtual destructor.
|
|
Action | action () const |
|
QVariantMap | data () const |
| Use this to get the data set in the action by HelperSupport::progressStep(QVariant) or returned at the end of the action.
|
|
void | start () override |
| Starts the job asynchronously.
|
|
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
◆ ~ExecuteJob()
KAuth::ExecuteJob::~ExecuteJob |
( |
| ) |
|
|
override |
◆ action()
Action KAuth::ExecuteJob::action |
( |
| ) |
const |
- Returns
- the action associated with this job
◆ 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
◆ kill
bool KAuth::ExecuteJob::kill |
( |
KillVerbosity |
verbosity = Quietly | ) |
|
|
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
- See also
- HelperSupport::isStopped()
-
KJob::result
-
KJob::finished
◆ newData
void KAuth::ExecuteJob::newData |
( |
const QVariantMap & |
data | ) |
|
|
signal |
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()
void KAuth::ExecuteJob::start |
( |
| ) |
|
|
override |
◆ statusChanged
Signal emitted when the authentication status changes.
- Parameters
-
status | the new authentication status |