summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qtservice/src/qtservice_win.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/qtservice/src/qtservice_win.cpp b/qtservice/src/qtservice_win.cpp
index f4b8cc9..e5b7ecc 100644
--- a/qtservice/src/qtservice_win.cpp
+++ b/qtservice/src/qtservice_win.cpp
@@ -418,7 +418,11 @@ bool QtServiceController::sendCommand(int code)
}
#if defined(QTSERVICE_DEBUG)
+# if QT_VERSION >= 0x050000
+extern void qtServiceLogDebug(QtMsgType type, const QMessageLogContext &context, const QString &msg);
+# else
extern void qtServiceLogDebug(QtMsgType type, const char* msg);
+# endif
#endif
void QtServiceBase::logMessage(const QString &message, MessageType type,
@@ -433,8 +437,11 @@ void QtServiceBase::logMessage(const QString &message, MessageType type,
case Information: //fall through
default: dbgMsg += "Information] "; break;
}
- dbgMsg += message.toAscii();
- qtServiceLogDebug((QtMsgType)-1, dbgMsg.constData());
+# if QT_VERSION >= 0x050000
+ qtServiceLogDebug((QtMsgType)-1, QMessageLogContext(), QLatin1String(dbgMsg) + message);
+# else
+ qtServiceLogDebug((QtMsgType)-1, (dbgMsg + message.toAscii()).constData());
+# endif
#endif
Q_D(QtServiceBase);