diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-03-25 16:15:33 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-03-25 16:15:33 +0900 |
commit | 57980b04c1a9d8bde974683fbae892580aee7466 (patch) | |
tree | 2c21890e491b6338031c8644be630e4286d2eaa7 /util.h | |
parent | 26ab888cf732f768770138f791f1ed7a2bade7f3 (diff) | |
download | libquotient-57980b04c1a9d8bde974683fbae892580aee7466.tar.gz libquotient-57980b04c1a9d8bde974683fbae892580aee7466.zip |
Simplified formatJson definition
Fixed the "formatJson unused" warning with that.
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 17 |
1 files changed, 7 insertions, 10 deletions
@@ -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 <QtCore/QDebug> @@ -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 |