Use new signature for message handler
authorKai Koehne <kai.koehne@nokia.com>
Wed, 6 Jun 2012 17:58:55 +0000 (19:58 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 8 Jun 2012 21:03:21 +0000 (23:03 +0200)
The const char * argument got replaced by a QString one.

Change-Id: I7211669154b1f2108cd69efc7dc00cd159f7741b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
src/designer/src/designer/qdesigner.cpp

index 0cf8973..d24bc55 100644 (file)
@@ -69,17 +69,17 @@ QT_BEGIN_NAMESPACE
 
 static const char *designerApplicationName = "Designer";
 static const char *designerWarningPrefix = "Designer: ";
-static QMessageHandler previousMessageHandler = 0;
+static QtMessageHandler previousMessageHandler = 0;
 
-static void designerMessageHandler(QtMsgType type, const QMessageLogContext &context, const char *msg)
+static void designerMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
 {
     // Only Designer warnings are displayed as box
     QDesigner *designerApp = qDesigner;
-    if (type != QtWarningMsg || !designerApp || qstrncmp(designerWarningPrefix, msg, qstrlen(designerWarningPrefix))) {
+    if (type != QtWarningMsg || !designerApp || !msg.startsWith(QLatin1String(designerWarningPrefix))) {
         previousMessageHandler(type, context, msg);
         return;
     }
-    designerApp->showErrorMessage(msg);
+    designerApp->showErrorMessage(qPrintable(msg));
 }
 
 QDesigner::QDesigner(int &argc, char **argv)