aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2016-09-12 11:22:01 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2016-09-19 13:02:02 +0000
commit16914894f035963ace51c92de13aad11a53c3cf8 (patch)
tree8ca786c5417b2db9295cddc8a28217bfb8dee8b2
parent213232635272440a51380237c56158a5f7f4b148 (diff)
QML: Cleanup prefix/suffixes for plug-in resolving
So now we can read it without getting cross-eyed. Change-Id: Ica6a072fcd505fd4fedca3ccfac7dfc00b522354 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r--src/qml/qml/qqmlimport.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index ee4d3efa6f..98e2f9eefd 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -1727,29 +1727,32 @@ QString QQmlImportDatabase::resolvePlugin(QQmlTypeLoader *typeLoader,
const QString &baseName)
{
#if defined(Q_OS_WIN)
- return resolvePlugin(typeLoader, qmldirPath, qmldirPluginPath, baseName,
- QStringList()
+ static const QString prefix;
+ static const QStringList suffixes = {
# ifdef QT_DEBUG
- << QLatin1String("d.dll") // try a qmake-style debug build first
+ QLatin1String("d.dll"), // try a qmake-style debug build first
# endif
- << QLatin1String(".dll"));
+ QLatin1String(".dll")
+ };
#elif defined(Q_OS_DARWIN)
-
- return resolvePlugin(typeLoader, qmldirPath, qmldirPluginPath, baseName,
- QStringList()
+ static const QString prefix = QLatin1String("lib");
+ static const QStringList suffixes = {
# ifdef QT_DEBUG
- << QLatin1String("_debug.dylib") // try a qmake-style debug build first
- << QLatin1String(".dylib")
+ QLatin1String("_debug.dylib"), // try a qmake-style debug build first
+ QLatin1String(".dylib"),
# else
- << QLatin1String(".dylib")
- << QLatin1String("_debug.dylib") // try a qmake-style debug build after
+ QLatin1String(".dylib"),
+ QLatin1String("_debug.dylib"), // try a qmake-style debug build after
# endif
- << QLatin1String(".so")
- << QLatin1String(".bundle"),
- QLatin1String("lib"));
+ QLatin1String(".so"),
+ QLatin1String(".bundle")
+ };
# else // Unix
- return resolvePlugin(typeLoader, qmldirPath, qmldirPluginPath, baseName, QStringList() << QLatin1String(".so"), QLatin1String("lib"));
+ static const QString prefix = QLatin1String("lib");
+ static const QStringList suffixes = { QLatin1String(".so") };
#endif
+
+ return resolvePlugin(typeLoader, qmldirPath, qmldirPluginPath, baseName, suffixes, prefix);
}
/*!