From 8e75f0ca17c768b21ea144436135c032672623b8 Mon Sep 17 00:00:00 2001 From: banad60 <44313677+banad60@users.noreply.github.com> Date: Sat, 20 Oct 2018 10:06:04 +0200 Subject: [PATCH] Fixes for LP Bug #1797746 / noquote for QT5 Fix for https://bugs.launchpad.net/mixxx/+bug/1797746 Without this patch, debugging messages in mixxx.log are quoted since QT > 5.4, which breaks output of engine.log() escape characters. This patch adds .noquote() to QDebug if QT_VERSION >= 5.4 --- src/controllers/controllerdebug.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/controllers/controllerdebug.h b/src/controllers/controllerdebug.h index 5df06021b488..8b76845b592b 100644 --- a/src/controllers/controllerdebug.h +++ b/src/controllers/controllerdebug.h @@ -1,6 +1,7 @@ #ifndef CONTROLLERDEBUG_H #define CONTROLLERDEBUG_H +#include #include @@ -30,6 +31,21 @@ class ControllerDebug { // We prefix every log message with Logging::kControllerDebugPrefix so that we // can bypass the --logLevel commandline argument when --controllerDebug is // specified. +// +// In order of Bug #1797746, since transition to qt5 it is needed unquote the +// output for mixxx.log with .noquote(), because in qt5 QDebug() is quoted by default. + +#if QT_VERSION > 0x050399 + +#define controllerDebug(stream) \ +{ \ + if (ControllerDebug::enabled()) { \ + QDebug(QtDebugMsg).noquote() << ControllerDebug::kLogMessagePrefix << stream; \ + } \ +} \ + +#else + #define controllerDebug(stream) \ { \ if (ControllerDebug::enabled()) { \ @@ -37,4 +53,5 @@ class ControllerDebug { } \ } \ +#endif #endif // CONTROLLERDEBUG_H