diff options
author | Kai Koehne <kai.koehne@nokia.com> | 2012-09-13 15:27:43 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-16 14:11:20 +0200 |
commit | 6afdfc7d9597e0d4b9b4b49040ac032f6f27c2cb (patch) | |
tree | ea4bdb9cb5640bc7c0ee1a2b24f35d5dec535b73 /tests | |
parent | 3c3f8dd7c6f2a681ed11e941568ecc569377c389 (diff) | |
download | qtxmlpatterns-6afdfc7d9597e0d4b9b4b49040ac032f6f27c2cb.tar.gz |
Tests: Use qInstallMessageHandler()
qInstallMsgHandler got deprecated in Qt 5.
Change-Id: I4f2b7cad5f2b6a1d1c617e41a62ee0cbf11bcd47
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/xmlpatternssdk/ErrorHandler.cpp | 12 | ||||
-rw-r--r-- | tests/auto/xmlpatternssdk/ErrorHandler.h | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/auto/xmlpatternssdk/ErrorHandler.cpp b/tests/auto/xmlpatternssdk/ErrorHandler.cpp index 47d725c..de5534e 100644 --- a/tests/auto/xmlpatternssdk/ErrorHandler.cpp +++ b/tests/auto/xmlpatternssdk/ErrorHandler.cpp @@ -55,11 +55,11 @@ using namespace QPatternistSDK; ErrorHandler *ErrorHandler::handler = 0; -void qMessageHandler(QtMsgType type, const char *description) +void qMessageHandler(QtMsgType type, const QMessageLogContext &, const QString &description) { if(type == QtDebugMsg) { - std::fprintf(stderr, "%s\n", description); + std::fprintf(stderr, "%s\n", qPrintable(description)); return; } @@ -83,7 +83,7 @@ void qMessageHandler(QtMsgType type, const char *description) * But maybe not: when run from "patternistrunsingle" it could be an idea * to actually try to record it(but nevertheless fail somehow) such * that it gets reported. */ - std::fprintf(stderr, "Fatal error: %s\n", description); + std::fprintf(stderr, "Fatal error: %s\n", qPrintable(description)); t = QtFatalMsg; /* Dummy, to silence a bogus compiler warning. */ return; } @@ -100,7 +100,7 @@ void qMessageHandler(QtMsgType type, const char *description) /* This message is hacky. Ideally, we should do it the same way * ReportContext::error() constructs messages, but this is just testing * code. */ - ErrorHandler::handler->message(t, QLatin1String("<p>") + QPatternist::escape(QLatin1String(description)) + QLatin1String("</p>")); + ErrorHandler::handler->message(t, QLatin1String("<p>") + QPatternist::escape(description) + QLatin1String("</p>")); } void ErrorHandler::installQtMessageHandler(ErrorHandler *const h) @@ -108,9 +108,9 @@ void ErrorHandler::installQtMessageHandler(ErrorHandler *const h) handler = h; if(h) - qInstallMsgHandler(qMessageHandler); + qInstallMessageHandler(qMessageHandler); else - qInstallMsgHandler(0); + qInstallMessageHandler(0); } void ErrorHandler::handleMessage(QtMsgType type, diff --git a/tests/auto/xmlpatternssdk/ErrorHandler.h b/tests/auto/xmlpatternssdk/ErrorHandler.h index 756041e..070bf08 100644 --- a/tests/auto/xmlpatternssdk/ErrorHandler.h +++ b/tests/auto/xmlpatternssdk/ErrorHandler.h @@ -124,7 +124,7 @@ namespace QPatternistSDK * * If @p handler is heap allocated, it will be leaked. * - * @see qInstallMsgHandler() + * @see qInstallMessageHandler() */ static void installQtMessageHandler(ErrorHandler *const handler); |