From 2e7956320b2b8268492ae3ddbba2462ef9e012c0 Mon Sep 17 00:00:00 2001 From: APTX Date: Tue, 4 Jun 2013 19:58:55 +0200 Subject: [PATCH] Fix messagehandler for Qt4. --- localmylist/messagehandler.cpp | 9 ++------- localmylist/mylist.cpp | 5 +++++ localmylist/mylist.h | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/localmylist/messagehandler.cpp b/localmylist/messagehandler.cpp index 874d4e9..78d3440 100644 --- a/localmylist/messagehandler.cpp +++ b/localmylist/messagehandler.cpp @@ -31,11 +31,6 @@ const char *messageType2Str(QtMsgType type) } } -auto debugMessageSignal = [](const QString &message) -{ - emit MyList::instance()->debugMessage(message); -}; - /* * messageHandler will try to format the debug message * and use Qt's default handlerto print it. @@ -72,7 +67,7 @@ void messageHandler(QtMsgType type, const QMessageLogContext &context, const QSt qtMessageHandler(type, context, message); - debugMessageSignal(message); + MyList::signalDebugMessage(message); } #else void messageHandler(QtMsgType type, const char *msg) @@ -91,7 +86,7 @@ void messageHandler(QtMsgType type, const char *msg) qt_message_output(type, buf.constData()); qInstallMsgHandler(messageHandler); - debugMessageSignal(message); + MyList::signalDebugMessage(message); } #endif diff --git a/localmylist/mylist.cpp b/localmylist/mylist.cpp index eaba3c6..58fbc1b 100644 --- a/localmylist/mylist.cpp +++ b/localmylist/mylist.cpp @@ -443,6 +443,11 @@ bool MyList::isUdpClientAvailable() #endif } +void MyList::signalDebugMessage(const QString &message) +{ + emit instance()->debugMessage(message); +} + const char *MyList::revision() { #ifdef REVISION diff --git a/localmylist/mylist.h b/localmylist/mylist.h index bf7a417..4d953d5 100644 --- a/localmylist/mylist.h +++ b/localmylist/mylist.h @@ -111,6 +111,7 @@ public: static void destroy(); static bool isUdpClientAvailable(); + static void signalDebugMessage(const QString &message); static const char *revision(); -- 2.52.0