From b950d9b10fc64b2d73b832aea6569f3f1daf8f4f Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 12 Mar 2017 20:01:37 +0100 Subject: [PATCH] QGuiApplication: fix QString comparison The code compared a QString* with a QString, which only compiled because the QStringRef(const QString*) ctor was implicit. We're going to fix that, and it's nice to see that the change exposes bugs like this one. The fix is to deref the QString* argument, which we know from previous checks to be non-nullptr, to enable normal QString/QString comparison. Change-Id: Idc7b214cb26e8b7c18ee1ba0a2b7236f814f0810 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/gui/kernel/qguiapplication.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index c057fccadec..19f6a213f8b 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -670,7 +670,7 @@ void QGuiApplication::setApplicationDisplayName(const QString &name) disconnect(qGuiApp, &QGuiApplication::applicationNameChanged, qGuiApp, &QGuiApplication::applicationDisplayNameChanged); - if (QGuiApplicationPrivate::displayName != applicationName()) + if (*QGuiApplicationPrivate::displayName != applicationName()) emit qGuiApp->applicationDisplayNameChanged(); } } else if (name != *QGuiApplicationPrivate::displayName) {