summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/systrace.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2013-01-28 21:18:12 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2013-02-08 22:38:57 +0100
commit2dab7c97751d34cf6fc888305f949d290c292f48 (patch)
tree895a3c4e52543494203c87a72b4884ad7f8e8db0 /rbutil/rbutilqt/systrace.cpp
parentd06779d9879e04964e533dd02e62e5c7007cb0b3 (diff)
downloadrockbox-2dab7c97751d34cf6fc888305f949d290c292f48.tar.gz
rockbox-2dab7c97751d34cf6fc888305f949d290c292f48.tar.bz2
rockbox-2dab7c97751d34cf6fc888305f949d290c292f48.zip
Create Qt5 compatible version of trace event handler.
Qt5 deprecates the way this was done before. Change-Id: Ic66bce2d1ffcb572a9ed9345abbbbc6bb6475af0
Diffstat (limited to 'rbutil/rbutilqt/systrace.cpp')
-rw-r--r--rbutil/rbutilqt/systrace.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/rbutil/rbutilqt/systrace.cpp b/rbutil/rbutilqt/systrace.cpp
index f713a45d4c..943f34f7b9 100644
--- a/rbutil/rbutilqt/systrace.cpp
+++ b/rbutil/rbutilqt/systrace.cpp
@@ -93,6 +93,7 @@ void SysTrace::savePreviousTrace(void)
return;
}
+#if QT_VERSION < 0x050000
void SysTrace::debug(QtMsgType type, const char* msg)
{
(void)type;
@@ -109,6 +110,25 @@ void SysTrace::debug(QtMsgType type, const char* msg)
repeat++;
}
}
+#else
+void SysTrace::debug(QtMsgType type, const QMessageLogContext &context, const QString &msg)
+{
+ (void)type;
+ QByteArray localMsg = msg.toLocal8Bit();
+ if(lastmessage != msg) {
+ lastmessage = msg;
+ flush();
+ debugbuffer.append(msg + "\n");
+#if !defined(NODEBUG)
+ fprintf(stderr, "%s\n", localMsg.constData());
+#endif
+ repeat = 1;
+ }
+ else {
+ repeat++;
+ }
+}
+#endif
void SysTrace::flush(void)
{