Last active
May 11, 2019 12:35
-
-
Save romildo/0a5dca94f30163ad9230726bdefc0193 to your computer and use it in GitHub Desktop.
using an environment variable to obtain the plugin files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void PluginManager::load() | |
{ | |
QStringList pluginsDirs = QProcessEnvironment::systemEnvironment().value("DDE_POLKIT_PLUGINS_DIRS").split(':'); | |
pluginsDirs.append("/usr/lib/polkit-1-dde/plugins/"); | |
for (const QString &dirName : pluginsDirs) { | |
QDir dir(dirName); | |
QFileInfoList pluginFiles = dir.entryInfoList((QStringList("*.so"))); | |
for (const QFileInfo &pluginFile : pluginFiles) { | |
AgentExtension *plugin = loadFile(pluginFile.absoluteFilePath()); | |
if (plugin) | |
m_plugins << plugin; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the form of a patch: