Changeset View
Changeset View
Standalone View
Standalone View
libnotificationmanager/jobsmodel_p.cpp
Show First 20 Lines • Show All 318 Lines • ▼ Show 20 Line(s) | 273 | { | |||
---|---|---|---|---|---|
319 | job->setKillable(capabilities & KJob::Killable); | 319 | job->setKillable(capabilities & KJob::Killable); | ||
320 | 320 | | |||
321 | connect(job, &Job::updatedChanged, this, [this, job] { | 321 | connect(job, &Job::updatedChanged, this, [this, job] { | ||
322 | scheduleUpdate(job, Notifications::UpdatedRole); | 322 | scheduleUpdate(job, Notifications::UpdatedRole); | ||
323 | }); | 323 | }); | ||
324 | connect(job, &Job::summaryChanged, this, [this, job] { | 324 | connect(job, &Job::summaryChanged, this, [this, job] { | ||
325 | scheduleUpdate(job, Notifications::SummaryRole); | 325 | scheduleUpdate(job, Notifications::SummaryRole); | ||
326 | }); | 326 | }); | ||
327 | connect(job, &Job::textChanged, this, [this, job] { | ||||
328 | scheduleUpdate(job, Notifications::BodyRole); | ||||
329 | }); | ||||
327 | connect(job, &Job::stateChanged, this, [this, job] { | 330 | connect(job, &Job::stateChanged, this, [this, job] { | ||
328 | scheduleUpdate(job, Notifications::JobStateRole); | 331 | scheduleUpdate(job, Notifications::JobStateRole); | ||
329 | // Timeout and Closable depend on state, signal a change for those, too | 332 | // Timeout and Closable depend on state, signal a change for those, too | ||
330 | scheduleUpdate(job, Notifications::TimeoutRole); | 333 | scheduleUpdate(job, Notifications::TimeoutRole); | ||
331 | scheduleUpdate(job, Notifications::ClosableRole); | 334 | scheduleUpdate(job, Notifications::ClosableRole); | ||
332 | 335 | | |||
333 | if (job->state() == Notifications::JobStateStopped) { | 336 | if (job->state() == Notifications::JobStateStopped) { | ||
334 | unwatchJob(job); | 337 | unwatchJob(job); | ||
Show All 9 Lines | |||||
344 | }); | 347 | }); | ||
345 | connect(job, &Job::expiredChanged, this, [this, job] { | 348 | connect(job, &Job::expiredChanged, this, [this, job] { | ||
346 | scheduleUpdate(job, Notifications::ExpiredRole); | 349 | scheduleUpdate(job, Notifications::ExpiredRole); | ||
347 | }); | 350 | }); | ||
348 | connect(job, &Job::dismissedChanged, this, [this, job] { | 351 | connect(job, &Job::dismissedChanged, this, [this, job] { | ||
349 | scheduleUpdate(job, Notifications::DismissedRole); | 352 | scheduleUpdate(job, Notifications::DismissedRole); | ||
350 | }); | 353 | }); | ||
351 | 354 | | |||
352 | // The following are used in generating the pretty job text | 355 | connect(job, &Job::destUrlChanged, this, &JobsModelPrivate::emitJobUrlsChanged); | ||
353 | connect(job, &Job::processedFilesChanged, this, [this, job] { | | |||
354 | scheduleUpdate(job, Notifications::BodyRole); | | |||
355 | }); | | |||
356 | connect(job, &Job::totalFilesChanged, this, [this, job] { | | |||
357 | scheduleUpdate(job, Notifications::BodyRole); | | |||
358 | }); | | |||
359 | connect(job, &Job::descriptionValue1Changed, this, [this, job] { | | |||
360 | scheduleUpdate(job, Notifications::BodyRole); | | |||
361 | }); | | |||
362 | connect(job, &Job::descriptionValue2Changed, this, [this, job] { | | |||
363 | scheduleUpdate(job, Notifications::BodyRole); | | |||
364 | }); | | |||
365 | connect(job, &Job::destUrlChanged, this, [this, job] { | | |||
366 | scheduleUpdate(job, Notifications::BodyRole); | | |||
367 | emitJobUrlsChanged(); | | |||
368 | }); | | |||
369 | connect(job, &Job::errorTextChanged, this, [this, job] { | | |||
370 | scheduleUpdate(job, Notifications::BodyRole); | | |||
371 | }); | | |||
372 | 356 | | |||
373 | connect(job->d, &JobPrivate::closed, this, [this, job] { | 357 | connect(job->d, &JobPrivate::closed, this, [this, job] { | ||
374 | remove(job); | 358 | remove(job); | ||
375 | }); | 359 | }); | ||
376 | 360 | | |||
377 | // Delay showing a job view by 500ms to avoid showing really short stat jobs and other useless stuff | 361 | // Delay showing a job view by 500ms to avoid showing really short stat jobs and other useless stuff | ||
378 | if (hints.value(QStringLiteral("immediate")).toBool()) { | 362 | if (hints.value(QStringLiteral("immediate")).toBool()) { | ||
379 | const int newRow = m_jobViews.count(); | 363 | const int newRow = m_jobViews.count(); | ||
▲ Show 20 Lines • Show All 141 Lines • Show Last 20 Lines |