Skip to content

Commit

Permalink
Fixes for LP Bug #1797746 / noquote for QT5
Browse files Browse the repository at this point in the history
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
  • Loading branch information
banad60 committed Oct 22, 2018
1 parent da4d160 commit 8e75f0c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/controllers/controllerdebug.h
@@ -1,6 +1,7 @@
#ifndef CONTROLLERDEBUG_H
#define CONTROLLERDEBUG_H

#include <QtGlobal>
#include <QDebug>


Expand Down Expand Up @@ -30,11 +31,27 @@ 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()) { \
QDebug(QtDebugMsg) << ControllerDebug::kLogMessagePrefix << stream; \
} \
} \

#endif
#endif // CONTROLLERDEBUG_H

0 comments on commit 8e75f0c

Please sign in to comment.