Changeset View
Changeset View
Standalone View
Standalone View
kerfuffle/jobs.cpp
Show First 20 Lines • Show All 475 Lines • ▼ Show 20 Line(s) | 475 | { | |||
---|---|---|---|---|---|
476 | m_addJob = archive()->addFiles(m_entries, nullptr, m_options); | 476 | m_addJob = archive()->addFiles(m_entries, nullptr, m_options); | ||
477 | 477 | | |||
478 | if (m_addJob) { | 478 | if (m_addJob) { | ||
479 | connect(m_addJob, &KJob::result, this, &CreateJob::emitResult); | 479 | connect(m_addJob, &KJob::result, this, &CreateJob::emitResult); | ||
480 | // Forward description signal from AddJob, we need to change the first argument ('this' needs to be a CreateJob). | 480 | // Forward description signal from AddJob, we need to change the first argument ('this' needs to be a CreateJob). | ||
481 | connect(m_addJob, &KJob::description, this, [=](KJob *, const QString &title, const QPair<QString,QString> &field1, const QPair<QString,QString> &) { | 481 | connect(m_addJob, &KJob::description, this, [=](KJob *, const QString &title, const QPair<QString,QString> &field1, const QPair<QString,QString> &) { | ||
482 | emit description(this, title, field1); | 482 | emit description(this, title, field1); | ||
483 | }); | 483 | }); | ||
484 | connect(m_addJob, QOverload<KJob*,unsigned long>::of(&KJob::percent), this, [=](KJob*, unsigned long percent) { | ||||
elvisangelaccio: Please use `QOverload<KJob*,unsigned long>::of(&KJob::percent)` which does not require C++ 14 ;) | |||||
485 | emitPercent(percent, 100); | ||||
486 | }); | ||||
484 | 487 | | |||
485 | m_addJob->start(); | 488 | m_addJob->start(); | ||
486 | } else { | 489 | } else { | ||
487 | emitResult(); | 490 | emitResult(); | ||
488 | } | 491 | } | ||
489 | } | 492 | } | ||
490 | 493 | | |||
491 | bool CreateJob::doKill() | 494 | bool CreateJob::doKill() | ||
▲ Show 20 Lines • Show All 363 Lines • Show Last 20 Lines |
Please use QOverload<KJob*,unsigned long>::of(&KJob::percent) which does not require C++ 14 ;)