mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 01:39:05 -05:00
Server: pass plugins subdirectory to the PluginManager::loadPlugins method
This commit is contained in:
parent
eceb3ac68d
commit
f2cdacb057
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user