From f6d020e24fb64cfba5e80cef7f80cad15f08cc3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Thu, 4 Jul 2024 18:19:56 +0200 Subject: qt: Replace usage of deprecated Error::asString * 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 --- lang/qt/tests/run-refreshkeysjob.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lang/qt/tests/run-refreshkeysjob.cpp') diff --git a/lang/qt/tests/run-refreshkeysjob.cpp b/lang/qt/tests/run-refreshkeysjob.cpp index e2bf7d1f..ad653a54 100644 --- a/lang/qt/tests/run-refreshkeysjob.cpp +++ b/lang/qt/tests/run-refreshkeysjob.cpp @@ -34,6 +34,7 @@ #include "config.h" #endif +#include #include #include #include @@ -111,10 +112,10 @@ int main(int argc, char **argv) return 1; } if (openPGPKey.error) { - std::cerr << "Warning: Error while getting OpenPGP key: " << openPGPKey.error.asString() << std::endl; + std::cerr << "Warning: Error while getting OpenPGP key: " << openPGPKey.error << std::endl; } if (smimeKey.error) { - std::cerr << "Warning: Error while getting S/MIME key: " << openPGPKey.error.asString() << std::endl; + std::cerr << "Warning: Error while getting S/MIME key: " << openPGPKey.error << std::endl; } auto key = openPGPKey.key.isNull() ? smimeKey.key : openPGPKey.key; std::cout << "Refreshing " << displayName(key.protocol()) << " key " << key.userID(0).id() << std::endl; @@ -131,7 +132,7 @@ int main(int argc, char **argv) }); const auto err = job->start({QString::fromLatin1(key.primaryFingerprint())}); if (err) { - std::cerr << "Error: " << err.asString() << std::endl; + std::cerr << "Error: " << err << std::endl; return 1; } } else { @@ -141,12 +142,12 @@ int main(int argc, char **argv) return 1; } QObject::connect(job, &QGpgME::RefreshKeysJob::result, &app, [](const GpgME::Error &err) { - std::cout << "Result: " << err.asString() << std::endl; + std::cout << "Result: " << err << std::endl; qApp->quit(); }); const auto err = job->start({key}); if (err) { - std::cerr << "Error: " << err.asString() << std::endl; + std::cerr << "Error: " << err << std::endl; return 1; } } -- cgit v1.2.3