aboutsummaryrefslogtreecommitdiffstats
path: root/lang/qt/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* qt: Make toLogString helper publicIngo Klöcker2023-08-152-9/+16
| | | | | | | | | | | | * lang/qt/src/util.h: Move toLogString ... * lang/qt/src/debug.h: ... here. * lang/qt/tests/run-importjob.cpp (main): Use toLogString. -- This allows using the helper in dependent projects without duplicating it everywhere. GnuPG-bug-id: 6584
* qt: Add setInputEncoding to QGpgMe::EncryptJobCarl Schwan2023-08-034-4/+26
| | | | | | | | | | | | | | | | * lang/qt/src/encryptjob.cpp, lang/qt/src/encryptjob.h, lang/qt/src/encryptjob_p.h: Add inputEncoding/setInputEncoding to EncryptJob * lang/qt/src/qgpgmeencryptjob.cpp: Use newly added inputEncoding to set encoding hint of the encrypted content -- This allows applications like KMail to set the input encoding of the encrypted content, which simplify and improve the performance of identifying the content type then decrypting it. GnuPG-bug-id: 6616 Signed-off-by: Carl Schwan <[email protected]>
* qt: Ensure that we check the correct pathsIngo Klöcker2023-07-082-2/+10
| | | | | | | | | | | * lang/qt/src/QGpgmeConfig-w32.cmake.in.in, lang/qt/src/QGpgmeQt6Config-w32.cmake.in.in: Get paths to check from the target properties. -- This avoids the error present in an older version where the files to check used the correct path, but a wrong path of the DLL was set in the target properties.
* qt: Fix DLL version in cmake config filesIngo Klöcker2023-07-082-4/+4
| | | | | | | | | * lang/qt/src/QGpgmeConfig-w32.cmake.in.in, lang/qt/src/QGpgmeQt6Config-w32.cmake.in.in: Fix name and path of DLL. -- Co-authored-by: Biswapriyo Nath <[email protected]> Signed-off-by: Ingo Klöcker <[email protected]>
* qt: Fix check for required filesIngo Klöcker2023-07-081-2/+2
| | | | | | | | * lang/qt/src/QGpgmeConfig-w32.cmake.in.in: Fix typos in variable names. -- Because of those typos the loop over the files to check was an empty loops and therefore the wrong name of the DLL was never noticed.
* qt: Support reading signed/encrypted archives directly from a fileIngo Klöcker2023-06-214-17/+69
| | | | | | | | | | | | | | | | | | | | | | | | | * lang/qt/src/decryptverifyarchivejob.cpp, lang/qt/src/decryptverifyarchivejob.h (DecryptVerifyArchiveJob): Add member functions setInputFile, inputFile. * lang/qt/src/decryptverifyarchivejob_p.h (DecryptVerifyArchiveJobPrivate): Add member m_inputFilePath. * lang/qt/src/qgpgmedecryptverifyarchivejob.cpp (decrypt_verify): Move creation of indata to decrypt_verify_from_io_device. (decrypt_verify_from_io_device, decrypt_verify_from_file_name): New. (QGpgMEDecryptVerifyArchiveJob::start): Use decrypt_verify_from_io_device instead of decrypt_verify. (QGpgMEDecryptVerifyArchiveJobPrivate::startIt): Start the job with the values from member variables. * lang/qt/tests/run-decryptverifyarchivejob.cpp (createInput): Remove. (main): Remove creation of input. Make the job read the archive directly from the given archive name. -- This makes it possible to tell gpgtar to read the signed/encrypted archive directly from a specified file bypassing GpgME's Data IO. GnuPG-bug-id: 6530
* qt: Support writing signed/encrypted archives directly to a fileIngo Klöcker2023-06-1912-49/+438
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lang/qt/src/encryptarchivejob.cpp, lang/qt/src/encryptarchivejob.h (EncryptArchiveJob): Add member functions setRecipients, recipients, setInputPaths, inputPaths, setOutputFile, outputFile, setEncryptionFlags, encryptionFlags. * lang/qt/src/encryptarchivejob_p.h (EncryptArchiveJobPrivate): Add members m_recipients, m_inputPaths, m_outputFilePath, m_encryptionFlags. * lang/qt/src/qgpgmeencryptarchivejob.cpp (encrypt): Move creation of outdata to encrypt_to_io_device. (encrypt_to_io_device, encrypt_to_filename): New. (QGpgMEEncryptArchiveJob::start): Use encrypt_to_io_device instead of encrypt. (QGpgMEEncryptArchiveJobPrivate::startIt): Start the job with the values from member variables. * lang/qt/src/qgpgmesignarchivejob.cpp (sign): Move creation of outdata to sign_to_io_device. (sign_to_io_device, sign_to_filename): New. (QGpgMESignArchiveJob::start): Use sign_to_io_device instead of sign. (QGpgMESignArchiveJobPrivate::startIt): Start the job with the values from member variables. * lang/qt/src/qgpgmesignencryptarchivejob.cpp (sign_encrypt): Move creation of outdata to sign_encrypt_to_io_device. (sign_encrypt_to_io_device, sign_encrypt_to_filename): New. (QGpgMESignEncryptArchiveJob::start): Use sign_encrypt_to_io_device instead of sign_encrypt. (QGpgMESignEncryptArchiveJobPrivate::startIt): Start the job with the values from member variables. * lang/qt/src/signarchivejob.cpp, lang/qt/src/signarchivejob.h (SignArchiveJob): Add member functions setSigner, signers, setInputPaths, inputPaths, setOutputFile, outputFile. * lang/qt/src/signarchivejob_p.h (SignArchiveJobPrivate): Add members m_signers, m_inputPaths, m_outputFilePath. * lang/qt/src/signencryptarchivejob.cpp, lang/qt/src/signencryptarchivejob.h (SignEncryptArchiveJob): Add member functions setSigner, signers, setRecipients, recipients, setInputPaths, inputPaths, setOutputFile, outputFile, setEncryptionFlags, encryptionFlags. * lang/qt/src/signencryptarchivejob_p.h (SignEncryptArchiveJobPrivate): Add members m_signers, m_recipients, m_inputPaths, m_outputFilePath, m_encryptionFlags. * lang/qt/tests/run-encryptarchivejob.cpp (createOutput): Remove. (checkOutputFilePath): New. (main): Create file output writing to stdout if no archive name (or "-") is given. Exit if file with given archive name already exists. Make the jobs write the created archive directly to the given archive name. * lang/qt/tests/run-signarchivejob.cpp (createOutput): Remove. (checkOutputFilePath): New. (main): Create file output writing to stdout if no archive name (or "-") is given. Exit if file with given archive name already exists. Make the jobs write the created archive directly to the given archive name. -- This makes it possible to tell gpgtar to write the created archive directly to a specified file bypassing GpgME's Data IO. GnuPG-bug-id: 6530
* qt: Add a generic hook to start a jobIngo Klöcker2023-06-1912-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lang/qt/src/job.cpp, lang/qt/src/job.h (Job::startIt): New method. * lang/qt/src/job_p.h (JobPrivate::startIt): New pure virtual method. * lang/qt/src/qgpgmechangeexpiryjob.cpp (QGpgMEChangeExpiryJobPrivate::startIt): New. * lang/qt/src/qgpgmedecryptverifyarchivejob.cpp (QGpgMEDecryptVerifyArchiveJobPrivate::startIt): New. * lang/qt/src/qgpgmeencryptarchivejob.cpp (QGpgMEEncryptArchiveJobPrivate::startIt): New. * lang/qt/src/qgpgmeencryptjob.cpp (QGpgMEEncryptJobPrivate::startIt): New. * lang/qt/src/qgpgmeimportjob.cpp (QGpgMEImportJobPrivate::startIt): New. * lang/qt/src/qgpgmelistallkeysjob.cpp (QGpgMEListAllKeysJobPrivate::startIt): New. * lang/qt/src/qgpgmesignarchivejob.cpp (QGpgMESignArchiveJobPrivate::startIt): New. * lang/qt/src/qgpgmesignencryptarchivejob.cpp (QGpgMESignEncryptArchiveJobPrivate::startIt): New. * lang/qt/src/qgpgmesignencryptjob.cpp (QGpgMESignEncryptJobPrivate::startIt): New. -- startIt() starts a job if the necessary values have been set before. This makes it possible to extend jobs with additional ways to start them without having to worry about overloading existing virtual start() methods. This will be used first for the different archive jobs. GnuPG-bug-id: 6530
* qt: Make the run methods of ThreadedJobMixin publicIngo Klöcker2023-06-191-0/+3
| | | | | | | | | | * lang/qt/src/threadedjobmixin.h (ThreadedJobMixin::run): Make all overloads public. -- This allows calling the run() functions from the JobPrivate subclasses. GnuPG-bug-id: 6530
* qt: Rename JobPrivate::start to JobPrivate::startNowIngo Klöcker2023-06-1911-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lang/qt/src/job_p.h (JobPrivate::start): Rename to startNow. * lang/qt/src/job.cpp (Job::startNow): Adapt function call. * lang/qt/src/qgpgmechangeexpiryjob.cpp (QGpgMEChangeExpiryJobPrivate::start): Rename to startNow. * lang/qt/src/qgpgmedecryptverifyarchivejob.cpp (QGpgMEDecryptVerifyArchiveJobPrivate::start): Rename to startNow. * lang/qt/src/qgpgmeencryptarchivejob.cpp (QGpgMEEncryptArchiveJobPrivate::start): Rename to startNow. * lang/qt/src/qgpgmeencryptjob.cpp (QGpgMEEncryptJobPrivate::start): Rename to startNow. * lang/qt/src/qgpgmeimportjob.cpp (QGpgMEImportJobPrivate::start): Rename to startNow. * lang/qt/src/qgpgmelistallkeysjob.cpp (QGpgMEListAllKeysJobPrivate::start): Rename to startNow. * lang/qt/src/qgpgmesignarchivejob.cpp (QGpgMESignArchiveJobPrivate::start): Rename to startNow. * lang/qt/src/qgpgmesignencryptarchivejob.cpp (QGpgMESignEncryptArchiveJobPrivate::start): Rename to startNow. * lang/qt/src/qgpgmesignencryptjob.cpp (QGpgMESignEncryptJobPrivate::start): Rename to startNow. -- Using the same name for the public and the private method avoids confusion. GnuPG-bug-id: 6530
* qt: Return const pointer to JobPrivate class for const pointer to JobIngo Klöcker2023-06-192-3/+16
| | | | | | | | | | | | | * lang/qt/src/job.cpp, lang/qt/src/job_p.h (getJobPrivate): Replace with two overloads for non-const pointer and const pointer to Job. * lang/qt/src/job_p.h (jobPrivate): Replace with two template functions for non-const pointer and const pointer to Job. -- This helps avoid changing values stored in the JobPrivate class in const functions (e.g. getters) of Job classes. GnuPG-bug-id: 6530
* qt, cpp: Support larger size-hint on 32 bit buildsAndre Heinecke2023-06-168-4/+28
| | | | | | | | | | | | | | | | | | | | * NEWS: Mention this. * lang/cpp/src/data.h, lang/cpp/src/data.cpp (Data::setSizeHint): New. * lang/qt/src/qgpgmedecryptjob.cpp, lang/qt/src/qgpgmedecryptverifyarchivejob.cpp, lang/qt/src/qgpgmedecryptverifyjob.cpp, lang/qt/src/qgpgmeencryptjob.cpp, lang/qt/src/qgpgmesignencryptjob.cpp, lang/qt/src/qgpgmesignjob.cpp, lang/qt/src/qgpgmeverifydetachedjob.cpp, lang/qt/src/qgpgmeverifyopaquejob.cpp: Set size for input IODevice. -- This fixes the case where the old detection of the size of QIOdevice using seek would overflow and instead explicitly uses QIODevice::size to check for the size and pass it through as an uint64. GnuPG-Bug-Id: T6534
* qt: Add signals for file-based and data-based progressIngo Klöcker2023-02-149-0/+101
| | | | | | | | | | | | | | | | | | | | | * lang/qt/src/decryptverifyarchivejob.h (DecryptVerifyArchiveJob): Add signals fileProgress and dataProgress. * lang/qt/src/encryptarchivejob.h (EncryptArchiveJob): Ditto. * lang/qt/src/signarchivejob.h (SignArchiveJob): Ditto. * lang/qt/src/signencryptarchivejob.h (SignEncryptArchiveJob): Ditto. * lang/qt/src/job_p.h (emitArchiveProgressSignals): New. * lang/qt/src/qgpgmedecryptverifyarchivejob.cpp (QGpgMEDecryptVerifyArchiveJob::QGpgMEDecryptVerifyArchiveJob): Emit appropriate signal when receiving Job::rawProgress signal. * lang/qt/src/qgpgmeencryptarchivejob.cpp (QGpgMEEncryptArchiveJob::QGpgMEEncryptArchiveJob): Ditto. * lang/qt/src/qgpgmesignarchivejob.cpp (QGpgMESignArchiveJob::QGpgMESignArchiveJob): Ditto. * lang/qt/src/qgpgmesignencryptarchivejob.cpp (QGpgMESignEncryptArchiveJob::QGpgMESignEncryptArchiveJob): Ditto. -- GnuPG-bug-id: 6342
* qt: Remove commented out codeIngo Klöcker2023-02-141-12/+0
| | | | | | -- GnuPG-bug-id: 6342
* qt: Add simple and extended progress signals replacing old signalIngo Klöcker2023-02-144-17/+61
| | | | | | | | | | | | | | | | | | | | | | | | | * 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
* qt: Add job for extracting encrypted and signed archivesIngo Klöcker2023-02-028-0/+420
| | | | | | | | | | | | | | | | | | | * lang/qt/src/decryptverifyarchivejob.cpp, lang/qt/src/decryptverifyarchivejob.h, lang/qt/src/decryptverifyarchivejob_p.h, lang/qt/src/qgpgmedecryptverifyarchivejob.cpp, lang/qt/src/qgpgmedecryptverifyarchivejob.h: New. * lang/qt/src/protocol.h (class Protocol): Add pure virtual member function decryptVerifyArchiveJob * lang/qt/src/protocol_p.h (Protocol::decryptVerifyArchiveJob): ... and implement it. * lang/qt/src/Makefile.am: Update accordingly. * lang/qt/tests/run-decryptverifyarchivejob.cpp: New. * lang/qt/tests/Makefile.am: Add new test runner. -- GnuPG-bug-id: 6342
* qt: Allow checking if the sign/encrypt archive jobs are supportedIngo Klöcker2023-02-026-0/+33
| | | | | | | | | | | | | | | | * lang/qt/src/encryptarchivejob.cpp, lang/qt/src/encryptarchivejob.h (isSupported): New. * lang/qt/src/signarchivejob.cpp, lang/qt/src/signarchivejob.h (isSupported): New. * lang/qt/src/signencryptarchivejob.cpp, lang/qt/src/signencryptarchivejob.h (isSupported): New. * lang/qt/tests/run-encryptarchivejob.cpp (main), lang/qt/tests/run-signarchivejob.cpp (main): Check if jobs are supported. -- GnuPG-bug-id: 6342
* qt: Fix build without installed gpgme++ headersIngo Klöcker2023-01-311-1/+1
| | | | | | | | * lang/qt/src/filelistdataprovider.cpp: Include error.h without folder prefix. -- GnuPG-bug-id: 6342
* qt: Remove unused and commented-out codeIngo Klöcker2023-01-314-45/+0
| | | | | | | | | | | | * lang/qt/src/qgpgmeencryptarchivejob.cpp, lang/qt/src/qgpgmeencryptarchivejob.h (QGpgMEEncryptArchiveJob): Remove member function resultHook and member mResult. * lang/qt/src/qgpgmesignarchivejob.cpp, lang/qt/src/qgpgmesignarchivejob.h (QGpgMESignArchiveJob): Remove member function resultHook and member mResult. -- GnuPG-bug-id: 6342
* qt: Add job for creating encrypted signed archivesIngo Klöcker2023-01-318-0/+451
| | | | | | | | | | | | | | | | | | | | | | * lang/qt/src/signencryptarchivejob.cpp, lang/qt/src/signencryptarchivejob.h, lang/qt/src/signencryptarchivejob_p.h, lang/qt/src/qgpgmesignencryptarchivejob.cpp, lang/qt/src/qgpgmesignencryptarchivejob.h: New. * lang/qt/src/protocol.h (class Protocol): Add pure virtual member function signEncryptArchiveJob * lang/qt/src/protocol_p.h (Protocol::signEncryptArchiveJob): ... and implement it. * lang/qt/src/Makefile.am: Update accordingly. * lang/qt/tests/run-encryptarchivejob.cpp (displayName): Remove. (CommandLineOptions): Initialize member armor. Add member sign. (parseCommandLine): Update application description. Add and parse option -s/--sign. (main): Use SignEncryptArchiveJob if sign option is set. -- GnuPG-bug-id: 6342
* qt: Add job for creating signed archivesikloecker/t6342-gpgtarIngo Klöcker2023-01-308-0/+439
| | | | | | | | | | | | | | | | | | * lang/qt/src/signarchivejob.cpp, lang/qt/src/signarchivejob.h, lang/qt/src/signarchivejob_p.h, lang/qt/src/qgpgmesignarchivejob.cpp, lang/qt/src/qgpgmesignarchivejob.h: New. * lang/qt/src/protocol.h (class Protocol): Add pure virtual member function signArchiveJob * lang/qt/src/protocol_p.h (Protocol::signArchiveJob): ... and implement it. * lang/qt/src/Makefile.am: Update accordingly. * lang/qt/tests/run-signarchivejob.cpp: New. * lang/qt/tests/Makefile.am: Add new test runner. -- GnuPG-bug-id: 6342
* qt: Add job for creating encrypted archivesIngo Klöcker2023-01-278-0/+470
| | | | | | | | | | | | | | | | | | * lang/qt/src/encryptarchivejob.cpp, lang/qt/src/encryptarchivejob.h, lang/qt/src/encryptarchivejob_p.h, lang/qt/src/qgpgmeencryptarchivejob.cpp, lang/qt/src/qgpgmeencryptarchivejob.h: New. * lang/qt/src/protocol.h (class Protocol): Add pure virtual member function encryptArchiveJob * lang/qt/src/protocol_p.h (Protocol::encryptArchiveJob): ... and implement it. * lang/qt/src/Makefile.am: Update accordingly. * lang/qt/tests/run-encryptarchivejob.cpp: New. * lang/qt/tests/Makefile.am: Add new test runner. -- GnuPG-bug-id: 6342
* qt: Add data provider for list of file namesIngo Klöcker2023-01-274-0/+186
| | | | | | | | | | | | | | | | * lang/qt/src/Makefile.am: Add new files and corresponding camel-case header. * lang/qt/src/dataprovider.h: Include interface from gpgme++ when not building. * lang/qt/src/filelistdataprovider.cpp, lang/qt/src/filelistdataprovider.h: New. -- The new data provider simplifies providing a nul-separated list of UTF-8-encoded filenames, e.g. for creating signed or encrypted archives. It is a simple read-only proxy for QByteArrayDataProvider. GnuPG-bug-id: 6342
* qt: Replace Q_DECL_OVERRIDE with overrideIngo Klöcker2023-01-0533-179/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | * lang/qt/src/defaultkeygenerationjob.h, lang/qt/src/hierarchicalkeylistjob.h, lang/qt/src/multideletejob.h, lang/qt/src/protocol_p.h, lang/qt/src/qgpgmeadduseridjob.h, lang/qt/src/qgpgmechangeexpiryjob.h, lang/qt/src/qgpgmechangeownertrustjob.h, lang/qt/src/qgpgmechangepasswdjob.h, lang/qt/src/qgpgmedecryptjob.h, lang/qt/src/qgpgmedecryptverifyjob.h, lang/qt/src/qgpgmedeletejob.h, lang/qt/src/qgpgmedownloadjob.h, lang/qt/src/qgpgmeencryptjob.h, lang/qt/src/qgpgmeexportjob.h, lang/qt/src/qgpgmegpgcardjob.h, lang/qt/src/qgpgmeimportfromkeyserverjob.h, lang/qt/src/qgpgmeimportjob.h, lang/qt/src/qgpgmekeyformailboxjob.h, lang/qt/src/qgpgmekeygenerationjob.h, lang/qt/src/qgpgmekeylistjob.h, lang/qt/src/qgpgmelistallkeysjob.h, lang/qt/src/qgpgmenewcryptoconfig.h, lang/qt/src/qgpgmequickjob.h, lang/qt/src/qgpgmerefreshsmimekeysjob.h, lang/qt/src/qgpgmesignencryptjob.h, lang/qt/src/qgpgmesignjob.h, lang/qt/src/qgpgmesignkeyjob.h, lang/qt/src/qgpgmetofupolicyjob.h, lang/qt/src/qgpgmeverifydetachedjob.h, lang/qt/src/qgpgmeverifyopaquejob.h, lang/qt/src/qgpgmewkdlookupjob.h, lang/qt/src/qgpgmewkspublishjob.h, lang/qt/src/threadedjobmixin.h, lang/qt/tests/t-support.h: Replace Q_DECL_OVERRIDE with override -- We require C++11 since a long time.
* qt: Allow deferred start of import jobIngo Klöcker2023-01-053-0/+14
| | | | | | | | | | | | | | * lang/qt/src/importjob.h (ImportJob::startLater): New pure virtual method. * lang/qt/src/qgpgmeimportjob.cpp, lang/qt/src/qgpgmeimportjob.h (QGpgMEImportJob::startLater): New method. * lang/qt/tests/t-import.cpp (ImportTest::testDeferredStart): New. -- This makes it possible to prepare an import job for a deferred start. GnuPG-bug-id: 6323
* qt: Support deferred start of jobsIngo Klöcker2023-01-049-0/+64
| | | | | | | | | | | | | | | | | | | | | | | * lang/qt/src/job.cpp, lang/qt/src/job.h (Job::startNow): New method. * lang/qt/src/job_p.h (JobPrivate::start): New pure virtual method. * lang/qt/src/qgpgmechangeexpiryjob.cpp (QGpgMEChangeExpiryJobPrivate::start): New. * lang/qt/src/qgpgmeencryptjob.cpp (QGpgMEEncryptJobPrivate::start): New. * lang/qt/src/qgpgmeimportjob.cpp (QGpgMEImportJobPrivate::start): New. * lang/qt/src/qgpgmelistallkeysjob.cpp (QGpgMEListAllKeysJobPrivate::start): New. * lang/qt/src/qgpgmesignencryptjob.cpp (QGpgMESignEncryptJobPrivate::start): New. * lang/qt/src/threadedjobmixin.h (Thread::hasFunction): New method. (ThreadedJobMixin::run, ThreadedJobMixin::setWorkerFunction): New methods. -- startNow() starts a deferred job for which the worker function has been set before. GnuPG-bug-id: 6323
* qt: Explicitly instantiate private job classesIngo Klöcker2023-01-0417-72/+374
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* qt: Write path values with Unix directory separatorsIngo Klöcker2022-12-061-1/+1
| | | | | | | | | | | | | * lang/qt/src/qgpgmenewcryptoconfig.cpp (QGpgMENewCryptoConfigEntry::setURLValue): Remove conversion to native directory separators. -- Even on Windows Unix directory separators work with all API calls. And some path values also allow "URLs" like tcp://1.2.3.4:10001 which must use '/'. GnuPG-bug-id: 4518
* qt: Allow disabling automatic trust database check on key listingIngo Klöcker2022-11-044-4/+95
| | | | | | | | | | | | | | | * lang/qt/src/Makefile.am (qgpgme_sources): Add listallkeysjob.cpp. * lang/qt/src/listallkeysjob.cpp: New. * lang/qt/src/listallkeysjob.h (enum ListAllKeysJob::Option, typedef ListAllKeysJob::Options, ListAllKeysJob::setOptions, ListAllKeysJob::options): New. * lang/qt/src/qgpgmelistallkeysjob.cpp (list_keys): Set context flag "no-auto-check-trustdb" if requested. (QGpgMEListAllKeysJob::start, QGpgMEListAllKeysJob::exec): Add options to call of list_keys. -- GnuPG-bug-id: 6261
* build,qt: Clean up all generated filesIngo Klöcker2022-10-111-1/+2
| | | | | | * lang/qt/src/Makefile.am (CLEANFILES): Add QGpgmeConfig-w32.cmake.in and QGpgmeQt6Config-w32.cmake.in. --
* qt: Remove obsolete code.Ingo Klöcker2022-10-111-16/+0
| | | | | | | | | * lang/qt/src/qgpgmenewcryptoconfig.cpp (struct Select1St): Remove. -- This struct was never used in this implementation of the crypto config classes and it causes a build error with Qt 6 where QPair is an alias for std::pair.
* build,qt: Allow building QGpgME for Qt 6Ingo Klöcker2022-10-114-8/+304
| | | | | | | | | | | | | | | | | | | | | * configure.ac: Look for Qt 5 and/or Qt 6. Require C++17 if Qt 6 binding is built. Build cmake files QGpgmeConfig* for Qt 5 and QGpgmeQt6Config* for Qt 6. (available_languages): Add "qt5" and "qt6". (WANT_QT5, WANT_QT6): New conditionals. * lang/qt/src/Makefile.am: Keep building libqgpgme for Qt 5. Build libqgpgmeqt6 for Qt 6. * lang/qt/tests/Makefile.am: Build tests for Qt 5 or Qt 6. * lang/qt/src/QGpgmeQt6Config-w32.cmake.in.in, lang/qt/src/QGpgmeQt6Config.cmake.in.in, lang/qt/src/QGpgmeQt6ConfigVersion.cmake.in, m4/qt6.m4: New. -- This makes it possible to build QGpgME optionally for Qt 6.4.0 or later. By default or if the language "qt" is enabled, then QGpgME is built either for Qt 5 (if found) or Qt 6. A build for Qt 5 or Qt 6 can be requested by explicitly enabling the language "qt5" or "qt6". Building QGpgME for Qt 5 and Qt 6 simultaneously is not supported.
* build,qt: Explicitly namespace a few Qt variables for Qt5Ingo Klöcker2022-10-101-2/+2
| | | | | | | | | | | | | | m4/qt.m4: Rename to m4/qt5.m4: this. (FIND_QT): Rename to FIND_QT5. (GPGME_QT): Change variable prefix to GPGME_QT5. (GPGME_QTTEST: Change variable prefix to GPGME_QT5TEST. configure.ac, lang/qt/src/Makefile.am, lang/qt/tests/Makefile.am: Adjust accordingly. -- In preparation to adding support for building qgpgme for Qt6, add the version number to a few variables to avoid confusion.
* qt: Fix building with C++11Ingo Klöcker2022-08-223-2/+11
| | | | | | | | | | | | | | | | | * lang/qt/src/qgpgmerefreshsmimekeysjob.cpp (QGpgMERefreshSMIMEKeysJob::start): Replace 'auto' in lambda with the actual type. * lang/qt/src/qgpgmesignkeyjob.cpp (class TrustSignatureProperties): Add default c'tor and c'tor initializing all members. * lang/qt/src/util.cpp (toFingerprints): Replace 'auto' in lambda with the actual type. * lang/qt/tests/run-exportjob.cpp (createExportJob): Replace 'auto' return type with actual type. -- This fixes compilation with strict C++11. GnuPG-bug-id: 6141
* qt: Fix building with Qt6Ingo Klöcker2022-08-222-4/+2
| | | | | | | | * lang/qt/src/util.cpp, lang/qt/src/util.h: Replace forward declaration with include. -- Based on patch by Laurent Montel
* qt: Make sure expiration time is interpreted as unsigned numberIngo Klöcker2022-08-171-1/+2
| | | | | | | | | | | * lang/qt/src/qgpgmeaddexistingsubkeyjob.cpp (add_subkey): Convert expiration time to uint_least32_t. -- This fixes the corresponding test on 32-bit systems where time_t (the return type of expirationTime()) is a signed 32-bit integer type. GnuPG-bug-id: 6137
* Qt: Fix working with no gpgconf in CryptoConfigAndre Heinecke2022-08-111-3/+4
| | | | | | | | | | | * lang/qt/src/cryptoconfig.cpp (CryptoConfig::entry): Add nullptr checks. -- This fixes a crash when gpgconf is not found. When every return value is NULL. GnuPG-Bug-Id: T6131
* qt: Add job to set the primary user ID of OpenPGP keysIngo Klöcker2022-08-097-0/+237
| | | | | | | | | | | | | | | | * lang/qt/src/qgpgmesetprimaryuseridjob.cpp, lang/qt/src/qgpgmesetprimaryuseridjob.h, lang/qt/src/setprimaryuseridjob.h: New. * lang/qt/src/protocol.h (class Protocol): Add pure virtual member function setPrimaryUserIDJob. * lang/qt/src/protocol_p.h (Protocol::setPrimaryUserIDJob): New. * lang/qt/src/job.cpp, lang/qt/src/Makefile.am: Update accordingly. * lang/qt/tests/t-setprimaryuserid.cpp: New. * lang/qt/tests/Makefile.am: Add new test. -- GnuPG-bug-id: 5938
* qt: Remove job for refreshing OpenPGP keysIngo Klöcker2022-08-047-299/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * lang/qt/src/qgpgmerefreshopenpgpkeysjob.cpp, lang/qt/src/qgpgmerefreshopenpgpkeysjob.h, lang/qt/src/refreshopenpgpkeysjob.h: Remove. * lang/qt/src/Makefile.am, lang/qt/src/job.cpp: Update accordingly. * lang/qt/src/protocol.h (class Protocol): Remove pure virtual member function refreshOpenPGPKeysJob. * lang/qt/src/protocol_p.h (Protocol::refreshOpenPGPKeysJob): Remove. * lang/qt/tests/run-refreshkeysjob.cpp (main): Use ReceiveKeysJob for OpenPGP keys. -- The RefreshOpenPGPKeysJob did more than it was intended to do, e.g. it imported new keys with the email addresses of the key to be refreshed via the configured auto-key-locate methods, but only a refresh from the key servers is wanted. For this we can use the ReceiveKeysJob. This commit mostly reverts the commits e12861f18c6b431b40bfa78eb6f1d149690a5fcd c64a8daf507a2216611861a12f312466b0bae8b2 The changes are source- and binary-compatible to the last release. GnuPG-bug-id: 5951
* qt: Allow setting the file name of signed and encrypted dataIngo Klöcker2022-07-054-8/+82
| | | | | | | | | | | | | | | | | | * lang/qt/src/Makefile.am (qgpgme_sources): Add signencryptjob.cpp. * lang/qt/src/signencryptjob.cpp: New. * lang/qt/src/signencryptjob.h (class SignEncryptJob): Add member functions setFileName, fileName. * lang/qt/src/qgpgmesignencryptjob.cpp (sign_encrypt): Set file name of input. (sign_encrypt_qba, QGpgMESignEncryptJob::exec, QGpgMESignEncryptJob::start): Pass file name to sign_encrypt resp. sign_encrypt_qba. -- This makes it possible to store the original name of a signed and encrypted file in the resulting data. GnuPG-bug-id: 6056
* qt: Allow setting the file name of encrypted dataIngo Klöcker2022-07-054-9/+84
| | | | | | | | | | | | | | | | * lang/qt/src/Makefile.am (qgpgme_sources): Add encryptjob.cpp. * lang/qt/src/encryptjob.cpp: New. * lang/qt/src/encryptjob.h (class EncryptJob): Add member functions setFileName, fileName. * lang/qt/src/qgpgmeencryptjob.cpp (encrypt): Set file name of input. (encrypt_qba, QGpgMEEncryptJob::exec, QGpgMEEncryptJob::start): Pass file name to encrypt resp. encrypt_qba. -- This makes it possible to store the original name of an encrypted file in the encryption result. GnuPG-bug-id: 6056
* qt: Fix filename of cmake config files for w32Ingo Klöcker2022-07-041-1/+1
| | | | | | * lang/qt/src/Makefile.am (EXTRA_DIST): Add QGpgmeConfig-w32.cmake.in.in. --
* qt: Add #include <QStringList> needed for building against qt6Laurent Montel2022-07-044-7/+6
| | | | | | | | | | | * lang/qt/src/downloadjob.h, lang/qt/src/exportjob.h, lang/qt/src/keylistjob.h lang/qt/src/refreshkeysjob.h: in qt6 we need to use #include <QStringList> -- It fixes some compile qt6 compile error. Signed-off-by: Laurent Montel <[email protected]>
* qt: Prevent u32 overflow when calculating expiration dateIngo Klöcker2022-06-102-4/+4
| | | | | | | | | | | | | * lang/qt/src/qgpgmesignkeyjob.cpp (sign_key): Change maxAllowedDate to 2106-02-05. Change log-level from warning to debug. * lang/qt/tests/t-various.cpp (TestVarious::testSignKeyWithExpiration): Remove check for warning. Adapt assertion. -- Capping the expiration date at 2106-02-05 prevents a u32 overflow when adding the number of days until the maximal date to the current time. GnuPG-bug-id: 5991
* qt: Revert change of result signal of RefreshKeysJobIngo Klöcker2022-05-051-1/+1
| | | | | | | | | | | | * lang/qt/src/refreshkeysjob.h (RefreshKeysJob::result): Remove optional parameters auditLogAsHtml and auditLogError. * lang/qt/tests/run-refreshkeysjob.cpp (main): Update accordingly. -- This reverts f4c35609257156d0e32b8dd7315011b484919f05. The reason for the previous change does no longer apply. GnuPG-bug-id: 5951
* qt: Use lambda instead of std::bindIngo Klöcker2022-05-051-1/+1
| | | | | | | | | * lang/qt/src/qgpgmerefreshopenpgpkeysjob.cpp (QGpgMERefreshOpenPGPKeysJob::start): Replace std::bind call with a lambda. -- GnuPG-bug-id: 5951
* qt: Emit import result when refreshing OpenPGP keysIngo Klöcker2022-05-047-28/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lang/qt/src/refreshopenpgpkeysjob.h: New. * lang/qt/src/Makefile.am, lang/qt/src/job.cpp: Update accordingly. * lang/qt/src/qgpgmerefreshopenpgpkeysjob.h (class QGpgMERefreshOpenPGPKeysJob): Derive from RefreshOpenPGPKeysJob with result ImportResult. Remove unused start overload. * lang/qt/src/qgpgmerefreshopenpgpkeysjob.cpp (locate_external_keys): Ignore result of KeyListJob. Return import result. (receive_keys): Return import result. (refresh_keys): Merge the two import results and return the result. * lang/qt/src/protocol.h (class Protocol): Add pure virtual member function refreshOpenPGPKeysJob. * lang/qt/src/protocol_p.h (Protocol::refreshKeysJob): Return nullptr for OpenPGP protocol. (Protocol::refreshOpenPGPKeysJob): New. * lang/qt/tests/run-refreshkeysjob.cpp (main): Use appropriate job for the protocol of the key to refresh. -- This adds RefreshOpenPGPKeysJob complementing RefreshKeysJob (for S/MIME keys). Changing the result type of RefreshKeysJob would break the ABI. Therefore we have to introduce a new base class for the refresh job for OpenPGP. We derive this base class from AbstractImportJob because we want to return an import result. GnuPG-bug-id: 5951
* qt: Use GpgME::Locate aliasIngo Klöcker2022-05-022-2/+2
| | | | | | | * lang/qt/src/protocol_p.h (Protocol::locateKeysJob): Use Locate alias instead of Extern|Local. * lang/qt/src/qgpgmekeyformailboxjob.cpp (do_work): Ditto. --
* qt: Add job for refreshing OpenPGP keysIngo Klöcker2022-05-025-4/+218
| | | | | | | | | | | | | | | | | * lang/qt/src/qgpgmerefreshopenpgpkeysjob.h, lang/qt/src/qgpgmerefreshopenpgpkeysjob.cpp: New. * lang/qt/src/Makefile.am: Add new files. * lang/qt/src/protocol_p.h (Protocol::refreshKeysJob): Add support for OpenPGP protocol. -- The new job performs a --locate-external-keys for the email addresses of all not revoked user IDs of the given keys, and it performs a --recv-keys for the fingerprints of the given keys. The former may import new keys from WKD or an LDAP server or via some other (hopefully trusted) auto-key-locate mechanism. GnuPG-bug-id: 5951
* qt: Add debug helper for Result classes with output stream operatorIngo Klöcker2022-05-021-0/+9
| | | | | | | * lang/qt/src/util.h (toLogString): New. -- GnuPG-bug-id: 5951