From 57980b04c1a9d8bde974683fbae892580aee7466 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 25 Mar 2017 16:15:33 +0900 Subject: Simplified formatJson definition Fixed the "formatJson unused" warning with that. --- util.h | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'util.h') diff --git a/util.h b/util.h index edac878f..e9f1c231 100644 --- a/util.h +++ b/util.h @@ -16,10 +16,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -/** - * @file logging_util.h - a collection of utilities to facilitate debug logging. - */ - #pragma once #include @@ -32,7 +28,7 @@ namespace QMatrixClient using QDebugManip = QDebug (*)(QDebug); /** - * @brief QDebug manipulator to setup the stream for JSON output. + * @brief QDebug manipulator to setup the stream for JSON output * * Originally made to encapsulate the change in QDebug behavior in Qt 5.4 * and the respective addition of QDebug::noquote(). @@ -41,13 +37,14 @@ namespace QMatrixClient * * @example qDebug() << formatJson << json_object; // (QJsonObject, etc.) */ - const QDebugManip formatJson = [](QDebug debug_object) { - #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) + inline QDebug formatJson(QDebug debug_object) + { +#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) return debug_object; - #else +#else return debug_object.noquote(); - #endif - }; +#endif + }; /** * @brief A helper operator to facilitate usage of formatJson (and possibly -- cgit v1.2.3