1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 17:28:50 -05:00

Server: pass plugins subdirectory to the PluginManager::loadPlugins method

This commit is contained in:
f4exb 2017-12-17 10:36:22 +01:00
parent eceb3ac68d
commit f2cdacb057
3 changed files with 10 additions and 10 deletions

View File

@ -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));
}
}

View File

@ -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)

View File

@ -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);