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
This commit is contained in:
parent
28542b14c4
commit
f6d020e24f
@ -44,9 +44,9 @@ QDebug operator<<(QDebug debug, const GpgME::Error &err)
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
// On Windows, we tell libgpg-error to return (translated) error messages as UTF-8
|
||||
const auto errAsString = QString::fromUtf8(err.asString());
|
||||
const auto errAsString = QString::fromStdString(err.asStdString());
|
||||
#else
|
||||
const auto errAsString = QString::fromLocal8Bit(err.asString());
|
||||
const auto errAsString = QString::fromLocal8Bit(err.asStdString().c_str());
|
||||
#endif
|
||||
const bool oldSetting = debug.autoInsertSpaces();
|
||||
debug.nospace() << errAsString << " (code: " << err.code() << ", source: " << err.source() << ")";
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include "qgpgmedecryptverifyjob.h"
|
||||
|
||||
#include "dataprovider.h"
|
||||
#include "debug.h"
|
||||
#include "decryptverifyjob_p.h"
|
||||
#include "util.h"
|
||||
|
||||
@ -118,7 +119,7 @@ static QGpgMEDecryptVerifyJob::result_type decrypt_verify(Context *ctx, QThread
|
||||
const std::pair<DecryptionResult, VerificationResult> res = ctx->decryptAndVerify(indata, outdata);
|
||||
Error ae;
|
||||
const QString log = _detail::audit_log_as_html(ctx, ae);
|
||||
qCDebug(QGPGME_LOG) << __func__ << "- End no plainText. Error:" << ae.asString();
|
||||
qCDebug(QGPGME_LOG) << __func__ << "- End no plainText. Error:" << ae;
|
||||
return std::make_tuple(res.first, res.second, out.data(), log, ae);
|
||||
} else {
|
||||
QGpgME::QIODeviceDataProvider out(plainText);
|
||||
@ -127,7 +128,7 @@ static QGpgMEDecryptVerifyJob::result_type decrypt_verify(Context *ctx, QThread
|
||||
const std::pair<DecryptionResult, VerificationResult> res = ctx->decryptAndVerify(indata, outdata);
|
||||
Error ae;
|
||||
const QString log = _detail::audit_log_as_html(ctx, ae);
|
||||
qCDebug(QGPGME_LOG) << __func__ << "- End plainText. Error:" << ae.asString();
|
||||
qCDebug(QGPGME_LOG) << __func__ << "- End plainText. Error:" << ae;
|
||||
return std::make_tuple(res.first, res.second, QByteArray(), log, ae);
|
||||
}
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ void QGpgMENewCryptoConfigComponent::sync(bool runtime)
|
||||
if (const Error err = m_component.save()) {
|
||||
qCWarning(QGPGME_LOG) << ":"
|
||||
<< "Error from gpgconf while saving configuration: %1"
|
||||
<< QString::fromLocal8Bit(err.asString());
|
||||
<< err;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,7 @@
|
||||
|
||||
#include "qgpgmewkdlookupjob.h"
|
||||
|
||||
#include "debug.h"
|
||||
#include "qgpgme_debug.h"
|
||||
|
||||
#include <gpgme++/context.h>
|
||||
@ -62,7 +63,7 @@ static GpgME::Error startDirmngr(Context *assuanCtx)
|
||||
|
||||
auto spawnCtx = std::unique_ptr<Context>{Context::createForEngine(SpawnEngine, &err)};
|
||||
if (err) {
|
||||
qCDebug(QGPGME_LOG) << "Error: Failed to get context for spawn engine (" << err.asString() << ")";
|
||||
qCDebug(QGPGME_LOG) << "Error: Failed to get context for spawn engine (" << err << ")";
|
||||
}
|
||||
const auto gpgconfProgram = GpgME::dirInfo("gpgconf-name");
|
||||
// replace backslashes with forward slashes in homedir to work around bug T6833
|
||||
@ -132,11 +133,11 @@ static GpgME::Error run_wkd_get(Context *ctx, const std::string &email)
|
||||
// no key for email is available via WKD or that the domain doesn't
|
||||
// support WKD or that the domain doesn't exist (on subsequent requests
|
||||
// using dirmngr's internal cache)
|
||||
qCDebug(QGPGME_LOG) << "WKD_GET returned" << err.asString() << "; ignoring...";
|
||||
qCDebug(QGPGME_LOG) << "WKD_GET returned" << err << "; ignoring...";
|
||||
err = {};
|
||||
}
|
||||
if (err) {
|
||||
qCDebug(QGPGME_LOG) << "WKD_GET failed with" << err.asString();
|
||||
qCDebug(QGPGME_LOG) << "WKD_GET failed with" << err;
|
||||
}
|
||||
|
||||
return err;
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include "threadedjobmixin.h"
|
||||
|
||||
#include "dataprovider.h"
|
||||
#include "util.h"
|
||||
|
||||
#include <gpgme++/data.h>
|
||||
|
||||
@ -82,7 +83,7 @@ QString _detail::audit_log_as_html(Context *ctx, GpgME::Error &err)
|
||||
|
||||
if (ctx->protocol() == OpenPGP) {
|
||||
if ((err = ctx->getAuditLog(data, OpenPGPAuditLogFlags))) {
|
||||
return QString::fromLocal8Bit(err.asString());
|
||||
return errorAsString(err);
|
||||
}
|
||||
const QByteArray ba = dp.data();
|
||||
return markupDiagnostics(stringFromGpgOutput(ba));
|
||||
@ -91,12 +92,12 @@ QString _detail::audit_log_as_html(Context *ctx, GpgME::Error &err)
|
||||
if (ctx->protocol() == CMS) {
|
||||
if ((err = ctx->lastError())) {
|
||||
if ((err = ctx->getAuditLog(data, Context::DiagnosticAuditLog))) {
|
||||
return QString::fromLocal8Bit(err.asString());
|
||||
return errorAsString(err);
|
||||
}
|
||||
const QByteArray ba = dp.data();
|
||||
return markupDiagnostics(stringFromGpgOutput(ba));
|
||||
} else if ((err = ctx->getAuditLog(data, CMSAuditLogFlags))) {
|
||||
return QString::fromLocal8Bit(err.asString());
|
||||
return errorAsString(err);
|
||||
}
|
||||
return QString::fromUtf8(dp.data());
|
||||
}
|
||||
|
@ -36,6 +36,8 @@
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
#include <gpgme++/error.h>
|
||||
|
||||
#include <gpgme.h>
|
||||
|
||||
#include <string>
|
||||
@ -51,6 +53,15 @@ static inline gpgme_error_t make_error(gpgme_err_code_t code)
|
||||
return gpgme_err_make((gpgme_err_source_t)22, code);
|
||||
}
|
||||
|
||||
static inline QString errorAsString(const GpgME::Error &error)
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
return QString::fromStdString(error.asStdString());
|
||||
#else
|
||||
return QString::fromLocal8Bit(error.asStdString().c_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
std::vector<std::string> toStrings(const QStringList &l);
|
||||
|
||||
QStringList toFingerprints(const std::vector<GpgME::Key> &keys);
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <debug.h>
|
||||
#include <decryptverifyarchivejob.h>
|
||||
#include <protocol.h>
|
||||
|
||||
@ -114,7 +115,7 @@ int main(int argc, char **argv)
|
||||
|
||||
const auto err = job->startIt();
|
||||
if (err) {
|
||||
std::cerr << "Error: Starting the job failed: " << err.asString() << std::endl;
|
||||
std::cerr << "Error: Starting the job failed: " << err << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <debug.h>
|
||||
#include <protocol.h>
|
||||
#include <decryptverifyjob.h>
|
||||
|
||||
@ -155,7 +156,7 @@ int main(int argc, char **argv)
|
||||
err = job->startIt();
|
||||
}
|
||||
if (err) {
|
||||
std::cerr << "Error: Starting the job failed: " << err.asString() << std::endl;
|
||||
std::cerr << "Error: Starting the job failed: " << err << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <debug.h>
|
||||
#include <protocol.h>
|
||||
#include <encryptarchivejob.h>
|
||||
#include <signencryptarchivejob.h>
|
||||
@ -176,7 +177,7 @@ int main(int argc, char **argv)
|
||||
err = job->startIt();
|
||||
}
|
||||
if (err) {
|
||||
std::cerr << "Error: Starting the job failed: " << err.asString() << std::endl;
|
||||
std::cerr << "Error: Starting the job failed: " << err << std::endl;
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
@ -207,7 +208,7 @@ int main(int argc, char **argv)
|
||||
err = job->startIt();
|
||||
}
|
||||
if (err) {
|
||||
std::cerr << "Error: Starting the job failed: " << err.asString() << std::endl;
|
||||
std::cerr << "Error: Starting the job failed: " << err << std::endl;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <debug.h>
|
||||
#include <protocol.h>
|
||||
#include <encryptjob.h>
|
||||
#include <signencryptjob.h>
|
||||
@ -157,7 +158,7 @@ int main(int argc, char **argv)
|
||||
err = job->startIt();
|
||||
}
|
||||
if (err) {
|
||||
std::cerr << "Error: Starting the job failed: " << err.asString() << std::endl;
|
||||
std::cerr << "Error: Starting the job failed: " << err << std::endl;
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
@ -189,7 +190,7 @@ int main(int argc, char **argv)
|
||||
err = job->startIt();
|
||||
}
|
||||
if (err) {
|
||||
std::cerr << "Error: Starting the job failed: " << err.asString() << std::endl;
|
||||
std::cerr << "Error: Starting the job failed: " << err << std::endl;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <debug.h>
|
||||
#include <exportjob.h>
|
||||
#include <protocol.h>
|
||||
|
||||
@ -106,7 +107,7 @@ int main(int argc, char *argv[])
|
||||
QObject::connect(job, &QGpgME::ExportJob::result,
|
||||
&app, [&app] (const GpgME::Error &err, const QByteArray &keyData, const QString &, const GpgME::Error &) {
|
||||
if (err) {
|
||||
cerr << "The ChangeExpiryJob failed with" << err.asString() << ".";
|
||||
cerr << "The ChangeExpiryJob failed with" << err << ".";
|
||||
app.exit(1);
|
||||
return;
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ int main(int argc, char **argv)
|
||||
const auto keyData = f.readAll();
|
||||
auto job = (protocol == GpgME::CMS ? QGpgME::smime() : QGpgME::openpgp())->importJob();
|
||||
const auto result = job->exec(keyData);
|
||||
qDebug() << "Result error:" << result.error().asString();
|
||||
qDebug() << "Result error:" << result.error();
|
||||
for (const auto &line : QString::fromStdString(QGpgME::toLogString(result)).split('\n')) {
|
||||
qDebug().noquote() << line;
|
||||
}
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <debug.h>
|
||||
#include <gpgme++/importresult.h>
|
||||
#include <protocol.h>
|
||||
#include <receivekeysjob.h>
|
||||
@ -58,7 +59,7 @@ int main(int argc, char **argv)
|
||||
auto job = QGpgME::openpgp()->receiveKeysJob();
|
||||
const auto result = job->exec(keyIds);
|
||||
|
||||
std::cout << "Result: " << result.error().asString() << std::endl;
|
||||
std::cout << "Result: " << result.error() << std::endl;
|
||||
std::cout << "Details:\n" << result << std::endl;
|
||||
|
||||
return 0;
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <debug.h>
|
||||
#include <protocol.h>
|
||||
#include <refreshkeysjob.h>
|
||||
#include <receivekeysjob.h>
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <debug.h>
|
||||
#include <protocol.h>
|
||||
#include <signarchivejob.h>
|
||||
|
||||
@ -168,7 +169,7 @@ int main(int argc, char **argv)
|
||||
err = job->startIt();
|
||||
}
|
||||
if (err) {
|
||||
std::cerr << "Error: Starting the job failed: " << err.asString() << std::endl;
|
||||
std::cerr << "Error: Starting the job failed: " << err << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <debug.h>
|
||||
#include <protocol.h>
|
||||
#include <signjob.h>
|
||||
|
||||
@ -159,7 +160,7 @@ int main(int argc, char **argv)
|
||||
err = job->startIt();
|
||||
}
|
||||
if (err) {
|
||||
std::cerr << "Error: Starting the job failed: " << err.asString() << std::endl;
|
||||
std::cerr << "Error: Starting the job failed: " << err << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <debug.h>
|
||||
#include <protocol.h>
|
||||
#include <verifydetachedjob.h>
|
||||
|
||||
@ -113,7 +114,7 @@ int main(int argc, char **argv)
|
||||
job->setSignedFile(options.signedFile);
|
||||
err = job->startIt();
|
||||
if (err) {
|
||||
std::cerr << "Error: Starting the job failed: " << err.asString() << std::endl;
|
||||
std::cerr << "Error: Starting the job failed: " << err << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <debug.h>
|
||||
#include <protocol.h>
|
||||
#include <verifyopaquejob.h>
|
||||
|
||||
@ -152,7 +153,7 @@ int main(int argc, char **argv)
|
||||
err = job->startIt();
|
||||
}
|
||||
if (err) {
|
||||
std::cerr << "Error: Starting the job failed: " << err.asString() << std::endl;
|
||||
std::cerr << "Error: Starting the job failed: " << err << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <debug.h>
|
||||
#include <protocol.h>
|
||||
#include <wkdrefreshjob.h>
|
||||
|
||||
@ -121,7 +122,7 @@ int main(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
if (err) {
|
||||
std::cerr << "Error while getting OpenPGP key: " << err.asString() << std::endl;
|
||||
std::cerr << "Error while getting OpenPGP key: " << err << std::endl;
|
||||
return 1;
|
||||
}
|
||||
std::cout << "Refreshing OpenPGP key " << key.userID(0).id() << std::endl;
|
||||
@ -145,7 +146,7 @@ int main(int argc, char **argv)
|
||||
err = job->start({key});
|
||||
}
|
||||
if (err) {
|
||||
std::cerr << "Error: " << err.asString() << std::endl;
|
||||
std::cerr << "Error: " << err << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include <gpgme++/context.h>
|
||||
#include <gpgme++/engineinfo.h>
|
||||
#include "protocol.h"
|
||||
#include "util.h"
|
||||
|
||||
#include <QSignalSpy>
|
||||
#include <QTemporaryDir>
|
||||
@ -84,7 +85,7 @@ private Q_SLOTS:
|
||||
this, [this] (const GpgME::Error &err2, const QString &, const GpgME::Error &) {
|
||||
Q_EMIT asyncDone();
|
||||
if (err2) {
|
||||
QFAIL(qPrintable(QString("The ChangeExpiryJob failed with '%1'.").arg(err2.asString())));
|
||||
QFAIL(qPrintable(QString("The ChangeExpiryJob failed with '%1'.").arg(errorAsString(err2))));
|
||||
}
|
||||
});
|
||||
|
||||
@ -147,7 +148,7 @@ private Q_SLOTS:
|
||||
this, [this] (const GpgME::Error &err2, const QString &, const GpgME::Error &) {
|
||||
Q_EMIT asyncDone();
|
||||
if (err2) {
|
||||
QFAIL(qPrintable(QString("The ChangeExpiryJob failed with '%1'.").arg(err2.asString())));
|
||||
QFAIL(qPrintable(QString("The ChangeExpiryJob failed with '%1'.").arg(errorAsString(err2))));
|
||||
}
|
||||
});
|
||||
|
||||
@ -211,7 +212,7 @@ private Q_SLOTS:
|
||||
this, [this] (const GpgME::Error &err2, const QString &, const GpgME::Error &) {
|
||||
Q_EMIT asyncDone();
|
||||
if (err2) {
|
||||
QFAIL(qPrintable(QString("The ChangeExpiryJob failed with '%1'.").arg(err2.asString())));
|
||||
QFAIL(qPrintable(QString("The ChangeExpiryJob failed with '%1'.").arg(errorAsString(err2))));
|
||||
}
|
||||
});
|
||||
|
||||
@ -274,7 +275,7 @@ private Q_SLOTS:
|
||||
this, [this] (const GpgME::Error &err2, const QString &, const GpgME::Error &) {
|
||||
Q_EMIT asyncDone();
|
||||
if (err2) {
|
||||
QFAIL(qPrintable(QString("The ChangeExpiryJob failed with '%1'.").arg(err2.asString())));
|
||||
QFAIL(qPrintable(QString("The ChangeExpiryJob failed with '%1'.").arg(errorAsString(err2))));
|
||||
}
|
||||
});
|
||||
|
||||
@ -342,7 +343,7 @@ private Q_SLOTS:
|
||||
this, [this] (const GpgME::Error &err2, const QString &, const GpgME::Error &) {
|
||||
Q_EMIT asyncDone();
|
||||
if (err2) {
|
||||
QFAIL(qPrintable(QString("The ChangeExpiryJob failed with '%1'.").arg(err2.asString())));
|
||||
QFAIL(qPrintable(QString("The ChangeExpiryJob failed with '%1'.").arg(errorAsString(err2))));
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include <QDebug>
|
||||
#include <QTest>
|
||||
#include <QSignalSpy>
|
||||
#include "debug.h"
|
||||
#include "keylistjob.h"
|
||||
#include "protocol.h"
|
||||
#include <gpgme++/keylistresult.h>
|
||||
@ -69,7 +70,7 @@ private Q_SLOTS:
|
||||
connect(job2, &ChangeOwnerTrustJob::result, this, [this](Error e)
|
||||
{
|
||||
if (e) {
|
||||
qDebug() << "Error in result: " << e.asString();
|
||||
qDebug() << "Error in result: " << e;
|
||||
}
|
||||
QVERIFY(!e);
|
||||
Q_EMIT asyncDone();
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include <QTest>
|
||||
#include <QSignalSpy>
|
||||
#include <QTemporaryDir>
|
||||
#include "debug.h"
|
||||
#include "keylistjob.h"
|
||||
#include "protocol.h"
|
||||
#include "signkeyjob.h"
|
||||
@ -90,7 +91,7 @@ public:
|
||||
const GpgME::Error) {
|
||||
Q_EMIT asyncDone();
|
||||
if (err2) {
|
||||
qDebug() << "Error: " << err2.asString();
|
||||
qDebug() << "Error: " << err2;
|
||||
}
|
||||
QVERIFY(err2);
|
||||
});
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include <QTemporaryDir>
|
||||
#include <QSignalSpy>
|
||||
|
||||
#include "debug.h"
|
||||
#include "protocol.h"
|
||||
#include <gpgme++/tofuinfo.h>
|
||||
#include "tofupolicyjob.h"
|
||||
@ -377,7 +378,7 @@ private Q_SLOTS:
|
||||
|
||||
if (keys.empty()) {
|
||||
qDebug() << "bravo@example.net not found";
|
||||
qDebug() << "Error: " << result.error().asString();
|
||||
qDebug() << "Error: " << result.error();
|
||||
const auto homedir = QString::fromLocal8Bit(qgetenv("GNUPGHOME"));
|
||||
qDebug() << "Homedir is: " << homedir;
|
||||
QFileInfo fi(homedir + "/pubring.gpg");
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include <gpgme++/engineinfo.h>
|
||||
#include "protocol.h"
|
||||
#include "signkeyjob.h"
|
||||
#include "util.h"
|
||||
|
||||
#include <QRegularExpression>
|
||||
#include <QSignalSpy>
|
||||
@ -94,9 +95,9 @@ private Q_SLOTS:
|
||||
if (err2) {
|
||||
if (err2.code() == GPG_ERR_GENERAL) {
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.\n"
|
||||
"Hint: Run with GPGMEPP_INTERACTOR_DEBUG=stderr to debug the edit interaction.").arg(err2.asString())));
|
||||
"Hint: Run with GPGMEPP_INTERACTOR_DEBUG=stderr to debug the edit interaction.").arg(errorAsString(err2))));
|
||||
} else {
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.").arg(err2.asString())));
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.").arg(errorAsString(err2))));
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -138,9 +139,9 @@ private Q_SLOTS:
|
||||
if (err2) {
|
||||
if (err2.code() == GPG_ERR_GENERAL) {
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.\n"
|
||||
"Hint: Run with GPGMEPP_INTERACTOR_DEBUG=stderr to debug the edit interaction.").arg(err2.asString())));
|
||||
"Hint: Run with GPGMEPP_INTERACTOR_DEBUG=stderr to debug the edit interaction.").arg(errorAsString(err2))));
|
||||
} else {
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.").arg(err2.asString())));
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.").arg(errorAsString(err2))));
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -205,9 +206,9 @@ private Q_SLOTS:
|
||||
if (err2) {
|
||||
if (err2.code() == GPG_ERR_GENERAL) {
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.\n"
|
||||
"Hint: Run with GPGMEPP_INTERACTOR_DEBUG=stderr to debug the edit interaction.").arg(err2.asString())));
|
||||
"Hint: Run with GPGMEPP_INTERACTOR_DEBUG=stderr to debug the edit interaction.").arg(errorAsString(err2))));
|
||||
} else {
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.").arg(err2.asString())));
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.").arg(errorAsString(err2))));
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -249,9 +250,9 @@ private Q_SLOTS:
|
||||
if (err2) {
|
||||
if (err2.code() == GPG_ERR_GENERAL) {
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.\n"
|
||||
"Hint: Run with GPGMEPP_INTERACTOR_DEBUG=stderr to debug the edit interaction.").arg(err2.asString())));
|
||||
"Hint: Run with GPGMEPP_INTERACTOR_DEBUG=stderr to debug the edit interaction.").arg(errorAsString(err2))));
|
||||
} else {
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.").arg(err2.asString())));
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.").arg(errorAsString(err2))));
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -317,9 +318,9 @@ private Q_SLOTS:
|
||||
if (err2) {
|
||||
if (err2.code() == GPG_ERR_GENERAL) {
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.\n"
|
||||
"Hint: Run with GPGMEPP_INTERACTOR_DEBUG=stderr to debug the edit interaction.").arg(err2.asString())));
|
||||
"Hint: Run with GPGMEPP_INTERACTOR_DEBUG=stderr to debug the edit interaction.").arg(errorAsString(err2))));
|
||||
} else {
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.").arg(err2.asString())));
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.").arg(errorAsString(err2))));
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -361,9 +362,9 @@ private Q_SLOTS:
|
||||
if (err2) {
|
||||
if (err2.code() == GPG_ERR_GENERAL) {
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.\n"
|
||||
"Hint: Run with GPGMEPP_INTERACTOR_DEBUG=stderr to debug the edit interaction.").arg(err2.asString())));
|
||||
"Hint: Run with GPGMEPP_INTERACTOR_DEBUG=stderr to debug the edit interaction.").arg(errorAsString(err2))));
|
||||
} else {
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.").arg(err2.asString())));
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.").arg(errorAsString(err2))));
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -428,9 +429,9 @@ private Q_SLOTS:
|
||||
if (err2) {
|
||||
if (err2.code() == GPG_ERR_GENERAL) {
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.\n"
|
||||
"Hint: Run with GPGMEPP_INTERACTOR_DEBUG=stderr to debug the edit interaction.").arg(err2.asString())));
|
||||
"Hint: Run with GPGMEPP_INTERACTOR_DEBUG=stderr to debug the edit interaction.").arg(errorAsString(err2))));
|
||||
} else {
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.").arg(err2.asString())));
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.").arg(errorAsString(err2))));
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -473,9 +474,9 @@ private Q_SLOTS:
|
||||
if (err2) {
|
||||
if (err2.code() == GPG_ERR_GENERAL) {
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.\n"
|
||||
"Hint: Run with GPGMEPP_INTERACTOR_DEBUG=stderr to debug the edit interaction.").arg(err2.asString())));
|
||||
"Hint: Run with GPGMEPP_INTERACTOR_DEBUG=stderr to debug the edit interaction.").arg(errorAsString(err2))));
|
||||
} else {
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.").arg(err2.asString())));
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.").arg(errorAsString(err2))));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include <QTemporaryDir>
|
||||
#include "keylistjob.h"
|
||||
#include "protocol.h"
|
||||
#include "util.h"
|
||||
#include <gpgme++/keylistresult.h>
|
||||
#include <gpgme++/context.h>
|
||||
#include <gpgme++/engineinfo.h>
|
||||
@ -265,9 +266,9 @@ private Q_SLOTS:
|
||||
if (err2) {
|
||||
if (err2.code() == GPG_ERR_GENERAL) {
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.\n"
|
||||
"Hint: Run with GPGMEPP_INTERACTOR_DEBUG=stderr to debug the edit interaction.").arg(err2.asString())));
|
||||
"Hint: Run with GPGMEPP_INTERACTOR_DEBUG=stderr to debug the edit interaction.").arg(errorAsString(err2))));
|
||||
} else {
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.").arg(err2.asString())));
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.").arg(errorAsString(err2))));
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -321,9 +322,9 @@ private Q_SLOTS:
|
||||
if (err2) {
|
||||
if (err2.code() == GPG_ERR_GENERAL) {
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.\n"
|
||||
"Hint: Run with GPGMEPP_INTERACTOR_DEBUG=stderr to debug the edit interaction.").arg(err2.asString())));
|
||||
"Hint: Run with GPGMEPP_INTERACTOR_DEBUG=stderr to debug the edit interaction.").arg(errorAsString(err2))));
|
||||
} else {
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.").arg(err2.asString())));
|
||||
QFAIL(qPrintable(QString("The SignKeyJob failed with '%1'.").arg(errorAsString(err2))));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user