Try to load app dir first

This commit is contained in:
Hannah von Reth 2017-08-03 10:49:46 +02:00
parent e8d83d205b
commit ca4a339e15
1 changed files with 3 additions and 4 deletions

View File

@ -152,7 +152,6 @@ const QDir &PluginContainer::pluginDir()
if (!isLoaded) {
isLoaded = true;
QString appDir = qApp->applicationDirPath();
QStringList list;
#ifdef Q_OS_MAC
if (appDir == QLatin1String("MacOS")) {
list << appDir;
@ -164,12 +163,12 @@ const QDir &PluginContainer::pluginDir()
appDir = dir.absolutePath();
}
#endif
QString suffix = QLatin1String("/libsnore") + QLatin1String(SNORE_SUFFIX);
const auto suffix = QStringLiteral("/libsnore" SNORE_SUFFIX);
QStringList list { appDir };
for (const QString &s : qApp->libraryPaths()) {
list << s + suffix;
}
list << appDir
<< appDir + suffix
list<< appDir + suffix
<< appDir + QStringLiteral("/../lib/plugins") + suffix
<< appDir + QStringLiteral("/../lib64/plugins") + suffix
<< QStringLiteral(LIBSNORE_PLUGIN_PATH);