QGpgME 21.6.2.0000005
Qt API for GpgME
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
QGpgME::Job Class Referenceabstract

An abstract base class for asynchronous crypto operations. More...

#include <job.h>

Inheritance diagram for QGpgME::Job:
Inheritance graph
[legend]
Collaboration diagram for QGpgME::Job:
Collaboration graph
[legend]

Public Slots

virtual void slotCancel ()=0
 

Signals

void jobProgress (int current, int total)
 
void rawProgress (const QString &what, int type, int current, int total)
 
QGPGME_DEPRECATED void progress (const QString &what, int current, int total)
 
void done ()
 

Public Member Functions

virtual QString auditLogAsHtml () const
 
virtual GpgME::Error auditLogError () const
 
bool isAuditLogSupported () const
 
GpgME::Error startIt ()
 
void startNow ()
 

Static Public Member Functions

static GpgME::Context * context (Job *job)
 

Protected Member Functions

 Job (QObject *parent)
 

Detailed Description

An abstract base class for asynchronous crypto operations.

During the operation, you might receive progress updates through the progress() signal as they arrive, but an implementation is free to not send progress information. You should show a busy progressbar until the first progress() signal is received.

The done() signal is emitted before the result() signals of subclasses and should be used to hide and/or reset progress bars, not to learn of the end of the operation. Use the result() signals for that.

To cancel the operation, simply call slotCancel(). The result() signal of subclasses will still be emitted, though, and will carry the information that the operation was canceled.

Member Function Documentation

◆ context()

GpgME::Context * QGpgME::Job::context ( QGpgME::Job job)
static

Get the underlying context to set some additional options for a job.

This is intended to provide more flexibility on configuring jobs before they are started. The context is still owned by the thread, do not delete it.

This is a static method that takes the job as argument.

This function may not be called for running jobs.

Returns
the context used by the job job or null.

◆ jobProgress

void QGpgME::Job::jobProgress ( int  current,
int  total 
)
signal

This signal is emitted whenever the backend sends a progress status message. For most jobs, current is the amount of processed data (or files) and total is the total amount of data (of files). If total is 0, then the total amount is unknown or not yet known. For GnuPG 2.1.13 and later, current and total do not exceed 2^20, i.e. for larger values they are scaled down and you should not assume that they represent absolute values.

Check the documentation on progress in the GpgME manual for details.

Note: Some jobs provide special progress signals, e.g. for file-count- or data-based progress.

◆ rawProgress

void QGpgME::Job::rawProgress ( const QString what,
int  type,
int  current,
int  total 
)
signal

This signal is emitted whenever the backend sends a progress status message. Compared to the jobProgress signal this signal also provides the what value and the type value reported by the backend. Usually, these values can safely be ignored, so that you are better off using the simpler jobProgress signal. Check the documentation on progress in the GpgME manual for details on what and type.

Note: Some jobs provide special progress signals, so that you do not have to deal with what and type yourself.

◆ startIt()

GpgME::Error QGpgME::Job::startIt ( )

Starts the job.

Starts the job with the values set for the concrete job. If starting the job failed then you are responsible for destroying it. Therefore, it's recommended to store the job in a std::unique_ptr until it has been started successfully.

◆ startNow()

void QGpgME::Job::startNow ( )

Starts a deferred job.

The job needs to have been prepared for a deferred start by calling the startLater() function instead of the start() function of a leaf class.


The documentation for this class was generated from the following files: