From 99fd565889f3d22459ff82296b206fa228a4c468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Mon, 2 May 2022 15:06:56 +0200 Subject: [PATCH] qt: Add debug helper for Result classes with output stream operator * lang/qt/src/util.h (toLogString): New. -- GnuPG-bug-id: 5951 --- lang/qt/src/util.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lang/qt/src/util.h b/lang/qt/src/util.h index c6aa87ce..6aba62e6 100644 --- a/lang/qt/src/util.h +++ b/lang/qt/src/util.h @@ -36,6 +36,7 @@ #include +#include #include #include @@ -55,4 +56,12 @@ std::vector toStrings(const QStringList &l); QStringList toFingerprints(const std::vector &keys); +template +std::string toLogString(const Result &result) +{ + std::stringstream stream; + stream << result; + return stream.str(); +} + #endif // __QGPGME_UTIL_H__