12using namespace NotificationManager;
14Job::Job(uint
id,
QObject *parent)
16 , d(new JobPrivate(id, this))
21 connect(d, &JobPrivate::infoMessageChanged,
this, &Job::textChanged);
22 connect(
this, &Job::processedFilesChanged,
this, &Job::textChanged);
23 connect(
this, &Job::processedItemsChanged,
this, &Job::textChanged);
24 connect(
this, &Job::totalFilesChanged,
this, &Job::textChanged);
25 connect(
this, &Job::totalItemsChanged,
this, &Job::textChanged);
26 connect(
this, &Job::descriptionValue1Changed,
this, &Job::textChanged);
27 connect(
this, &Job::descriptionValue2Changed,
this, &Job::textChanged);
28 connect(
this, &Job::destUrlChanged,
this, &Job::textChanged);
29 connect(
this, &Job::errorTextChanged,
this, &Job::textChanged);
49void Job::resetUpdated()
67 return d->m_desktopEntry;
70void Job::setDesktopEntry(
const QString &desktopEntry)
72 Q_ASSERT(d->m_desktopEntry.isNull());
78 return d->m_applicationName;
81void Job::setApplicationName(
const QString &applicationName)
83 Q_ASSERT(d->m_applicationName.isNull());
89 return d->m_applicationIconName;
92void Job::setApplicationIconName(
const QString &applicationIconName)
94 Q_ASSERT(d->m_applicationIconName.isNull());
105 if (d->m_state !=
state) {
113 return d->m_percentage;
121void Job::setError(
int error)
123 if (d->m_error !=
error) {
131 return d->m_errorText;
134void Job::setErrorText(
const QString &errorText)
136 if (d->m_errorText != errorText) {
137 d->m_errorText = errorText;
138 Q_EMIT errorTextChanged(errorText);
144 return d->m_suspendable;
147void Job::setSuspendable(
bool suspendable)
155 return d->m_killable;
158void Job::setKillable(
bool killable)
164bool Job::transient()
const
166 return d->m_transient;
169void Job::setTransient(
bool transient)
184qulonglong Job::processedBytes()
const
186 return d->m_processedBytes;
189qulonglong Job::processedFiles()
const
191 return d->m_processedFiles;
194qulonglong Job::processedDirectories()
const
196 return d->m_processedDirectories;
199qulonglong Job::processedItems()
const
201 return d->m_processedItems;
204qulonglong Job::totalBytes()
const
206 return d->m_totalBytes;
209qulonglong Job::totalFiles()
const
211 return d->m_totalFiles;
214qulonglong Job::totalDirectories()
const
216 return d->m_totalDirectories;
219qulonglong Job::totalItems()
const
221 return d->m_totalItems;
224QString Job::descriptionLabel1()
const
226 return d->m_descriptionLabel1;
229QString Job::descriptionValue1()
const
231 return d->m_descriptionValue1;
234QString Job::descriptionLabel2()
const
236 return d->m_descriptionLabel2;
239QString Job::descriptionValue2()
const
241 return d->m_descriptionValue2;
246 return d->m_hasDetails;
251 return d->descriptionUrl();
254bool Job::expired()
const
259void Job::setExpired(
bool expired)
261 if (d->m_expired != expired) {
262 d->m_expired = expired;
267bool Job::dismissed()
const
269 return d->m_dismissed;
272void Job::setDismissed(
bool dismissed)
274 if (d->m_dismissed != dismissed) {
275 d->m_dismissed = dismissed;
276 Q_EMIT dismissedChanged();
282 Q_EMIT d->suspendRequested();
287 Q_EMIT d->resumeRequested();
bool hasDetails
Whether there are any details available for this job.
qulonglong speed
Current transfer rate in Byte/s.
QString text
User-friendly compact description text of the job, for example "42 of 1337 files to "~/some/folder",...
bool suspendable
Whether the job can be suspended.
QUrl descriptionUrl
This tries to generate a valid URL for a file that's being processed by converting descriptionValue2 ...
int error
The error code of the job failure.
QString desktopEntry
The desktop entry of the application owning the job, e.g.
QString applicationIconName
The icon name of the application owning the job, e.g.
QML_ELEMENTQString summary
The job infoMessage, e.g.
QUrl destUrl
The destination URL of a job.
bool killable
Whether the job can be aborted.
Notifications::JobState state
The state the job is currently in.
QString applicationName
The user-visible name of the application owning the job, e.g.
int percentage
The total percentage (0-100) of job completion.
JobState
The state an application job is in.
void transient(const QString &message, const QString &title)
QDateTime currentDateTimeUtc()
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)