summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@digia.com>2013-06-05 15:40:10 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-11 12:29:24 +0200
commit0d7d53fd46e8ab512bed88d0dab114cfada227ce (patch)
tree9291467685d9d8679383b3435e5b3c003c495be9 /src/gui
parent9ddcd900f6616da19bed344583ce08ced46fec36 (diff)
Improve error output when platform plugin cannot be loaded
Forgetting to deploy the platform plugin, or deploying it to the wrong folder, is a common mistake. The old error message didn't made it however explicit what was happening. Make the log more verbose, and explicitly state that the missing plugin is the reason for termination. Change-Id: I810a0ef8da5f8e898e7e0c6f853972514a05c75d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qguiapplication.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 29a7e87d46..3c3cea2910 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -782,12 +782,14 @@ static void init_platform(const QString &pluginArgument, const QString &platform
QGuiApplicationPrivate::platform_name = new QString(name);
} else {
QStringList keys = QPlatformIntegrationFactory::keys(platformPluginPath);
- QString fatalMessage =
- QString::fromLatin1("Failed to load platform plugin \"%1\". Available platforms are: \n").arg(name);
- foreach(const QString &key, keys) {
- fatalMessage.append(key + QLatin1Char('\n'));
- }
- qFatal("%s", fatalMessage.toLocal8Bit().constData());
+
+ QString fatalMessage
+ = QStringLiteral("Failed to find or load platform plugin \"%1\".\n").arg(name);
+ if (!keys.isEmpty())
+ fatalMessage += QStringLiteral("Available platforms are: %1\n").arg(
+ keys.join(QStringLiteral(", ")));
+ fatalMessage += QStringLiteral("GUI applications require a platform plugin. Terminating.");
+ qFatal(qPrintable(fatalMessage));
return;
}