diff options
| author | Ingo Klöcker <[email protected]> | 2023-02-13 10:58:31 +0100 |
|---|---|---|
| committer | Ingo Klöcker <[email protected]> | 2023-02-14 09:25:21 +0100 |
| commit | ea6f15ed602eeb9fa87766ba88acc78361a14b38 (patch) | |
| tree | 8e3d23caee9507a367920116fddae0b6bc8fb9ed /lang/qt/src/qgpgmerefreshsmimekeysjob.cpp | |
| parent | core: Switch to logging via gpgrt (diff) | |
| download | gpgme-ea6f15ed602eeb9fa87766ba88acc78361a14b38.tar.gz gpgme-ea6f15ed602eeb9fa87766ba88acc78361a14b38.zip | |
qt: Add simple and extended progress signals replacing old signal
* lang/qt/src/job.h (Job): Add signals jobProgress and rawProgress.
Deprecate signal progress.
* lang/qt/src/multideletejob.cpp (MultiDeleteJob::slotResult): Emit
new progress signals.
* lang/qt/src/qgpgmerefreshsmimekeysjob.cpp
(QGpgMERefreshSMIMEKeysJob::slotStatus): Ditto.
* lang/qt/src/threadedjobmixin.h (ThreadedJobMixin::showProgress): Use
modern overload of QMetaObject::invokeMethod to forward the progress
signal and add the value of what. Add forwarding of progress to the new
signals.
* lang/qt/tests/t-encrypt.cpp (EncryptionTest::testProgress): Test
the new signals instead of the deprecated one.
--
The new signal jobProgress omits the what value which is useless for
most consumers. The new signal rawProgress makes all information
provided by the backend available to consumers. The latter is not
really meant to be used by users of gpgme. It will be used by the
archive jobs to provide more user-friendly signals.
GnuPG-bug-id: 6342
Diffstat (limited to 'lang/qt/src/qgpgmerefreshsmimekeysjob.cpp')
| -rw-r--r-- | lang/qt/src/qgpgmerefreshsmimekeysjob.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lang/qt/src/qgpgmerefreshsmimekeysjob.cpp b/lang/qt/src/qgpgmerefreshsmimekeysjob.cpp index 3e430ad7..cff115ec 100644 --- a/lang/qt/src/qgpgmerefreshsmimekeysjob.cpp +++ b/lang/qt/src/qgpgmerefreshsmimekeysjob.cpp @@ -209,7 +209,7 @@ void QGpgMERefreshSMIMEKeysJob::slotStatus(QProcess *proc, const QString &type, } const QString what = *++it; ok = false; - (*++it).toInt(&ok); + const int type = (*++it).toInt(&ok); if (!ok) { qCDebug(QGPGME_LOG) << "expected number for \"type\", got something else"; return; @@ -226,9 +226,12 @@ void QGpgMERefreshSMIMEKeysJob::slotStatus(QProcess *proc, const QString &type, qCDebug(QGPGME_LOG) << "expected number for \"total\", got something else"; return; } - // TODO port - Q_EMIT progress(QString(), cur, total); - + Q_EMIT jobProgress(cur, total); + Q_EMIT rawProgress(what, type, cur, total); + QT_WARNING_PUSH + QT_WARNING_DISABLE_DEPRECATED + Q_EMIT progress(what, cur, total); + QT_WARNING_POP } } |
