diff --git a/src/atcore.cpp b/src/atcore.cpp --- a/src/atcore.cpp +++ b/src/atcore.cpp @@ -78,25 +78,24 @@ d->tempTimer = new QTimer(this); d->tempTimer->setInterval(5000); d->tempTimer->setSingleShot(false); - - QStringList pathList = AtCoreDirectories::pluginDir; - pathList.append(QLibraryInfo::location(QLibraryInfo::PluginsPath) + QStringLiteral("/AtCore")); - - for (const auto &path : pathList) { +//Attempt to find our plugins +//For Windows and Mac we always look in plugins folder of the program using atcore. +//On others we use AtCoreDirectories::pluginDir to hold a list of dirs to check +#if defined(Q_OS_WIN) || defined(Q_OS_MAC) + d->pluginsDir = qApp->applicationDirPath() + QStringLiteral("/plugins"); +#else + for (const auto &path : AtCoreDirectories::pluginDir) { qCDebug(ATCORE_PLUGIN) << "Lookin for plugins in " << path; if (QDir(path).exists()) { d->pluginsDir = QDir(path); qCDebug(ATCORE_PLUGIN) << "Valid path for plugins found !"; break; } } +#endif if (!d->pluginsDir.exists()) { qCritical() << "No valid path for plugin !"; } - -#if defined(Q_OS_WIN) || defined(Q_OS_MAC) - d->pluginsDir = qApp->applicationDirPath() + QStringLiteral("/plugins"); -#endif qCDebug(ATCORE_PLUGIN) << d->pluginsDir; findFirmwarePlugins(); setState(AtCore::DISCONNECTED); diff --git a/src/atcore_default_folders.h.in b/src/atcore_default_folders.h.in --- a/src/atcore_default_folders.h.in +++ b/src/atcore_default_folders.h.in @@ -23,6 +23,16 @@ #include namespace AtCoreDirectories { + /** + * @brief pluginDir + * List of directories that AtCore will look for plugins. Used if OS NOT Windows and Not Mac Os + * + * In Order: + * 1 Build Dir/plugins (buildtime) + * 2 ECM set KDE PLUGIN DIR (buildtime) + * 3 Qt Plugin path/AtCore (runtime) + * 4 plugins (runtime) + */ const QStringList pluginDir = \ QStringList(QStringLiteral("@CMAKE_CURRENT_BINARY_DIR@/plugins")) \ << QStringList(QStringLiteral("@KDE_INSTALL_PLUGINDIR@/AtCore")) \