aboutsummaryrefslogtreecommitdiffstats
path: root/lang/qt/src/qgpgmeencryptjob.cpp
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2023-01-03 11:15:19 +0000
committerIngo Klöcker <[email protected]>2023-01-04 10:37:11 +0000
commit270d7523001a57a59ea0be617d8e71d4363e0d50 (patch)
tree9242c28cabc6893858e542f97663c81e021e4236 /lang/qt/src/qgpgmeencryptjob.cpp
parentdoc:python: Replace gpgme-config to pkg-config. (diff)
downloadgpgme-270d7523001a57a59ea0be617d8e71d4363e0d50.tar.gz
gpgme-270d7523001a57a59ea0be617d8e71d4363e0d50.zip
qt: Explicitly instantiate private job classes
* lang/qt/src/Makefile.am: Add new files. * lang/qt/src/changeexpiryjob_p.h, lang/qt/src/encryptjob_p.h, lang/qt/src/importjob_p.h, lang/qt/src/listallkeysjob_p.h, lang/qt/src/signencryptjob_p.h: New. * lang/qt/src/changeexpiryjob.cpp, lang/qt/src/encryptjob.cpp, lang/qt/src/importjob.cpp, lang/qt/src/listallkeysjob.cpp, lang/qt/src/signencryptjob.cpp: Move JobPrivate subclasses to the new private header files. * lang/qt/src/job_p.h (jobPrivate): Remove lazy instantiation of private job classes. * lang/qt/src/qgpgmechangeexpiryjob.cpp (class QGpgMEChangeExpiryJobPrivate): New. (QGpgMEChangeExpiryJob::QGpgMEChangeExpiryJob): Instantiate private job class. * lang/qt/src/qgpgmeencryptjob.cpp (class QGpgMEEncryptJobPrivate): New. (QGpgMEEncryptJob::QGpgMEEncryptJob): Instantiate private job class. * lang/qt/src/qgpgmeimportjob.cpp (class QGpgMEImportJobPrivate): New. (QGpgMEImportJob::QGpgMEImportJob): Instantiate private job class. * lang/qt/src/qgpgmelistallkeysjob.cpp (class QGpgMEListAllKeysJobPrivate): New. (QGpgMEListAllKeysJob::QGpgMEListAllKeysJob): Instantiate private job class. * lang/qt/src/qgpgmesignencryptjob.cpp (class QGpgMESignEncryptJobPrivate): New. (QGpgMESignEncryptJob::QGpgMESignEncryptJob): Instantiate private job class. -- We need private job classes corresponding to the concrete leaf classes. This makes the lazy instantiation of the private classes by the job interface classes impossible. GnuPG-bug-id: 6323
Diffstat (limited to 'lang/qt/src/qgpgmeencryptjob.cpp')
-rw-r--r--lang/qt/src/qgpgmeencryptjob.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/lang/qt/src/qgpgmeencryptjob.cpp b/lang/qt/src/qgpgmeencryptjob.cpp
index cd544965..ae33db1d 100644
--- a/lang/qt/src/qgpgmeencryptjob.cpp
+++ b/lang/qt/src/qgpgmeencryptjob.cpp
@@ -5,7 +5,7 @@
Copyright (c) 2004,2007,2008 Klarälvdalens Datakonsult AB
Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
Software engineering by Intevation GmbH
- Copyright (c) 2022 g10 Code GmbH
+ Copyright (c) 2022,2023 g10 Code GmbH
Software engineering by Ingo Klöcker <[email protected]>
QGpgME is free software; you can redistribute it and/or
@@ -40,6 +40,8 @@
#include "qgpgmeencryptjob.h"
+#include "encryptjob_p.h"
+
#include "dataprovider.h"
#include "context.h"
@@ -54,10 +56,29 @@
using namespace QGpgME;
using namespace GpgME;
+namespace
+{
+
+class QGpgMEEncryptJobPrivate : public EncryptJobPrivate
+{
+ QGpgMEEncryptJob *q = nullptr;
+
+public:
+ QGpgMEEncryptJobPrivate(QGpgMEEncryptJob *qq)
+ : q{qq}
+ {
+ }
+
+ ~QGpgMEEncryptJobPrivate() override = default;
+};
+
+}
+
QGpgMEEncryptJob::QGpgMEEncryptJob(Context *context)
: mixin_type(context),
mOutputIsBase64Encoded(false)
{
+ setJobPrivate(this, std::unique_ptr<QGpgMEEncryptJobPrivate>{new QGpgMEEncryptJobPrivate{this}});
lateInitialization();
}