diff --git a/sdrbase/plugin/pluginmanager.cpp b/sdrbase/plugin/pluginmanager.cpp index 7bcec75ec..dd719eab4 100644 --- a/sdrbase/plugin/pluginmanager.cpp +++ b/sdrbase/plugin/pluginmanager.cpp @@ -53,18 +53,18 @@ PluginManager::~PluginManager() // freeAll(); } -void PluginManager::loadPlugins() +void PluginManager::loadPlugins(const QString& pluginsSubDir) { QString applicationDirPath = QCoreApplication::instance()->applicationDirPath(); - QString applicationLibPath = applicationDirPath + "/../lib/plugins"; - QString applicationBuildPath = applicationDirPath + "/plugins"; + QString applicationLibPath = applicationDirPath + "/../lib/" + pluginsSubDir; + QString applicationBuildPath = applicationDirPath + "/" + pluginsSubDir; qDebug() << "PluginManager::loadPlugins: " << qPrintable(applicationLibPath) << "," << qPrintable(applicationBuildPath); QDir pluginsLibDir = QDir(applicationLibPath); QDir pluginsBuildDir = QDir(applicationBuildPath); - loadPlugins(pluginsLibDir); - loadPlugins(pluginsBuildDir); + loadPluginsDir(pluginsLibDir); + loadPluginsDir(pluginsBuildDir); qSort(m_plugins); @@ -113,7 +113,7 @@ void PluginManager::registerSampleSink(const QString& sinkName, PluginInterface* m_sampleSinkRegistrations.append(PluginAPI::SamplingDeviceRegistration(sinkName, plugin)); } -void PluginManager::loadPlugins(const QDir& dir) +void PluginManager::loadPluginsDir(const QDir& dir) { QDir pluginsDir(dir); @@ -152,7 +152,7 @@ void PluginManager::loadPlugins(const QDir& dir) foreach (QString dirName, pluginsDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) { - loadPlugins(pluginsDir.absoluteFilePath(dirName)); + loadPluginsDir(pluginsDir.absoluteFilePath(dirName)); } } diff --git a/sdrbase/plugin/pluginmanager.h b/sdrbase/plugin/pluginmanager.h index dd6857159..442a21719 100644 --- a/sdrbase/plugin/pluginmanager.h +++ b/sdrbase/plugin/pluginmanager.h @@ -42,7 +42,7 @@ public: ~PluginManager(); PluginAPI *getPluginAPI() { return &m_pluginAPI; } - void loadPlugins(); + void loadPlugins(const QString& pluginsSubDir); const Plugins& getPlugins() const { return m_plugins; } // Callbacks from the plugins @@ -112,7 +112,7 @@ private: static const QString m_fileSinkHardwareID; //!< FileSource source hardware ID static const QString m_fileSinkDeviceTypeID; //!< FileSink sink plugin ID - void loadPlugins(const QDir& dir); + void loadPluginsDir(const QDir& dir); }; static inline bool operator<(const PluginManager::Plugin& a, const PluginManager::Plugin& b) diff --git a/sdrgui/mainwindow.cpp b/sdrgui/mainwindow.cpp index 898a6e4f5..79e1f3e76 100644 --- a/sdrgui/mainwindow.cpp +++ b/sdrgui/mainwindow.cpp @@ -134,7 +134,7 @@ MainWindow::MainWindow(qtwebapp::LoggerWithFile *logger, const MainParser& parse "QTabBar::tab:selected { background: rgb(100,100,100); }"); m_pluginManager = new PluginManager(this); - m_pluginManager->loadPlugins(); + m_pluginManager->loadPlugins(QString("plugins")); connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleMessages()), Qt::QueuedConnection);