aboutsummaryrefslogtreecommitdiff
path: root/src/plugin.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugin.h')
-rw-r--r--src/plugin.h51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/plugin.h b/src/plugin.h
index 4de3407..e43215b 100644
--- a/src/plugin.h
+++ b/src/plugin.h
@@ -39,55 +39,4 @@ inline Plugin loadPluginFromPath(const QString &path)
return p;
}
-inline QVector<Plugin> loadPlugins(const QString &path)
-{
- QVector<Plugin> list;
-
- // quit if there's nothing to load
- if(path.isEmpty())
- return list;
-
- // plugins can be a semicolon-separated list
- if(path.contains(';')) {
- auto pluginList = path.split(';');
- for(const auto &pluginPath : pluginList) {
- auto plugin = loadPluginFromPath(pluginPath);
- if(plugin.instance)
- list.append(plugin);
- }
-
- return list;
- }
-
- // check if path is path to a file or a folder
- QFileInfo location(path);
-
- if(!location.exists()) {
- qDebug("Plugin path doesn't exist.");
- return list;
- }
-
- if(location.isFile()) {
- // only load this one plugin
- auto p = loadPluginFromPath(location.absoluteFilePath());
- if(p.instance)
- list.append(p);
-
- } else if(location.isDir()) {
- // load all profiles from this directory
- const auto entries = QDir(location.absoluteFilePath()).entryInfoList(QDir::Files | QDir::Readable);
- for(const auto &f : entries) {
- auto p = loadPluginFromPath(f.absoluteFilePath());
- if(p.instance)
- list.append(p);
- }
-#ifdef QT_DEBUG
- } else {
- qDebug("Path is neither file nor folder: %s", qUtf8Printable(path));
-#endif
- }
-
- return list;
-}
-
#endif // SMOLBOTE_PLUGIN_H