aboutsummaryrefslogtreecommitdiffstats
path: root/lang/qt/src/util.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* qt: Replace usage of deprecated Error::asStringIngo Klöcker2024-07-051-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lang/qt/src/debug.cpp (operator<<): Use Error::asStdString instead of Error::asString. * lang/qt/src/qgpgmedecryptverifyjob.cpp (decrypt_verify), lang/qt/src/qgpgmenewcryptoconfig.cpp (QGpgMENewCryptoConfigComponent::sync), lang/qt/src/qgpgmewkdlookupjob.cpp (startDirmngr): Use QDebug operator for Error instead of Error::asString. * lang/qt/src/threadedjobmixin.cpp (_detail::audit_log_as_html): Use errorAsString instead of Error::asString. * lang/qt/src/util.h (errorAsString): New. * lang/qt/tests/run-decryptverifyarchivejob.cpp (main), lang/qt/tests/run-decryptverifyjob.cpp (main), lang/qt/tests/run-encryptarchivejob.cpp (main), lang/qt/tests/run-encryptjob.cpp (main), lang/qt/tests/run-exportjob.cpp (main), lang/qt/tests/run-importjob.cpp (main), lang/qt/tests/run-receivekeysjob.cpp (main), lang/qt/tests/run-refreshkeysjob.cpp (main), lang/qt/tests/run-signarchivejob.cpp (main), lang/qt/tests/run-signjob.cpp (main), lang/qt/tests/run-verifydetachedjob.cpp (main), lang/qt/tests/run-verifyopaquejob.cpp (main), lang/qt/tests/run-wkdrefreshjob.cpp (main), lang/qt/tests/t-ownertrust.cpp (testChangeOwnerTrust), lang/qt/tests/t-remarks.cpp (testRemarkOwnKey), lang/qt/tests/t-tofuinfo.cpp (testTofuPolicy): Use QDebug operator for Error instead of Error::asString. * lang/qt/tests/t-changeexpiryjob.cpp (all test functions), lang/qt/tests/t-trustsignatures.cpp (all test functions), lang/qt/tests/t-various.cpp (testSignKeyWithoutExpiration, testSignKeyWithExpiration): Use errorAsString instead of Error::asString. -- GnuPG-bug-id: 7188
* qt: Remove left-over partial files more persistentlyIngo Klöcker2023-11-151-2/+0
| | | | | | | | | | | | | | | * lang/qt/src/Makefile.am: Add new files. * lang/qt/src/cleaner.cpp, lang/qt/src/cleaner.h: New. * lang/qt/src/util.cpp (PartialFileGuard::~PartialFileGuard): Call Cleaner::removeFile instead of removeFile. * lang/qt/src/util.cpp, lang/qt/src/util.h (removeFile): Remove. -- If the initial attempt to remove the file fails then a Cleaner is created that tries to remove the file at regular intervals (10 s) and on destruction (which happens on application shutdown). GnuPG-bug-id: 6584
* qt: Use temporary .part file names when creating archivesIngo Klöcker2023-10-271-0/+22
| | | | | | | | | | | | | | | | | | | * lang/qt/src/util.h, lang/qt/src/util.cpp (class PartialFileGuard): New. * lang/qt/src/util.cpp (getRandomCharacters, createPartFileName): New. * lang/qt/src/qgpgmeencryptarchivejob.cpp (encrypt_to_filename): Use PartialFileGuard. * lang/qt/src/qgpgmesignarchivejob.cpp (sign_to_filename): Ditto. * lang/qt/src/qgpgmesignencryptarchivejob.cpp (sign_encrypt_to_filename): Ditto. -- When creating signed and/or encrypted archives, gpgtar now writes the result to a temporary file name. On success, the archive is renamed to the final file name. Otherwise, the (partially written) temporary file is removed (if possible). GnuPG-bug-id: 6721
* qt: Refactor removal of output file on cancel or errorIngo Klöcker2023-10-271-0/+2
| | | | | | | | | | | | | | | | * lang/qt/src/util.h, lang/qt/src/util.cpp (removeFile): New. * lang/qt/src/qgpgmeencryptarchivejob.cpp (encrypt): Move removal of output file from here (encrypt_to_filename): ... to here and use new function. * lang/qt/src/qgpgmesignarchivejob.cpp (sign): Move removal of output file from here (sign_to_filename): ... to here and use new function. * lang/qt/src/qgpgmesignencryptarchivejob.cpp (sign_encrypt): Move removal of output file from here (sign_encrypt_to_filename): ... to here and use new function. -- GnuPG-bug-id: 6721
* qt: Make toLogString helper publicIngo Klöcker2023-08-151-9/+0
| | | | | | | | | | | | * 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: Fix building with Qt6Ingo Klöcker2022-08-221-2/+2
| | | | | | | | * lang/qt/src/util.cpp, lang/qt/src/util.h: Replace forward declaration with include. -- Based on patch by Laurent Montel
* 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
* qt: Factor out helper for getting the fingerprints of some keysIngo Klöcker2022-05-021-0/+7
| | | | | | | | * lang/qt/src/util.h, lang/qt/src/util.cpp (toFingerprints): New. * lang/qt/src/qgpgmerefreshsmimekeysjob.cpp: Use the helper. -- GnuPG-bug-id: 5951
* qt: Add helper for converting QStringList to vector of stringsIngo Klöcker2022-02-031-0/+51
* lang/qt/src/util.h, lang/qt/src/util.cpp: New. * lang/qt/src/Makefile.am (qgpgme_sources, private_qgpgme_headers): Add new files. -- Additionally to the internal helper function toStrings(), this adds a copy of the internal make_error helper of GpgME++ which is used in a few places by QGpgME. We use the same error source id as GpgME++. GnuPG-bug-id: 5808