aboutsummaryrefslogtreecommitdiffstats
path: root/lang/qt/tests/run-importjob.cpp
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2023-08-15 09:56:40 +0000
committerIngo Klöcker <[email protected]>2023-08-15 09:56:40 +0000
commitc3171d0cf1a249618f0763fe141ab84d8a4be240 (patch)
treeadcd7fd1fb94c4998c782a657e37895210c06011 /lang/qt/tests/run-importjob.cpp
parentcpp: Remove unused include (diff)
downloadgpgme-c3171d0cf1a249618f0763fe141ab84d8a4be240.tar.gz
gpgme-c3171d0cf1a249618f0763fe141ab84d8a4be240.zip
qt: Make toLogString helper public
* 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
Diffstat (limited to 'lang/qt/tests/run-importjob.cpp')
-rw-r--r--lang/qt/tests/run-importjob.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lang/qt/tests/run-importjob.cpp b/lang/qt/tests/run-importjob.cpp
index b1814fa0..0ae92b09 100644
--- a/lang/qt/tests/run-importjob.cpp
+++ b/lang/qt/tests/run-importjob.cpp
@@ -34,6 +34,7 @@
#include "config.h"
#endif
+#include <debug.h>
#include <importjob.h>
#include <importresult.h>
#include <protocol.h>
@@ -44,7 +45,6 @@
#include <QDebug>
#include <set>
-#include <sstream>
GpgME::Protocol guessProtocol(const QString &filename)
{
@@ -90,9 +90,7 @@ int main(int argc, char **argv)
auto job = (protocol == GpgME::CMS ? QGpgME::smime() : QGpgME::openpgp())->importJob();
const auto result = job->exec(keyData);
qDebug() << "Result error:" << result.error().asString();
- std::ostringstream ostr;
- ostr << result;
- for (const auto &line : QString::fromStdString(ostr.str()).split('\n')) {
+ for (const auto &line : QString::fromStdString(QGpgME::toLogString(result)).split('\n')) {
qDebug().noquote() << line;
}
return 0;