Skip to content

Commit 38e79e3

Browse files
Friedemann KleintFriedemann Kleint
Friedemann Kleint
authored and
Friedemann Kleint
committed
Qt Service/Windows: Fix compilation with Qt 5 / QTSERVICE_DEBUG.
Fix oversight of last commit. Change-Id: Iec9963313edf9d7438a90f9f3a7a4c6ae5065132 Task-number: QTSOLBUG-184 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
1 parent e994358 commit 38e79e3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

qtservice/src/qtservice_win.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,11 @@ bool QtServiceController::sendCommand(int code)
418418
}
419419

420420
#if defined(QTSERVICE_DEBUG)
421+
# if QT_VERSION >= 0x050000
422+
extern void qtServiceLogDebug(QtMsgType type, const QMessageLogContext &context, const QString &msg);
423+
# else
421424
extern void qtServiceLogDebug(QtMsgType type, const char* msg);
425+
# endif
422426
#endif
423427

424428
void QtServiceBase::logMessage(const QString &message, MessageType type,
@@ -433,8 +437,11 @@ void QtServiceBase::logMessage(const QString &message, MessageType type,
433437
case Information: //fall through
434438
default: dbgMsg += "Information] "; break;
435439
}
436-
dbgMsg += message.toAscii();
437-
qtServiceLogDebug((QtMsgType)-1, dbgMsg.constData());
440+
# if QT_VERSION >= 0x050000
441+
qtServiceLogDebug((QtMsgType)-1, QMessageLogContext(), QLatin1String(dbgMsg) + message);
442+
# else
443+
qtServiceLogDebug((QtMsgType)-1, (dbgMsg + message.toAscii()).constData());
444+
# endif
438445
#endif
439446

440447
Q_D(QtServiceBase);

0 commit comments

Comments
 (0)