aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/browser.cpp6
-rw-r--r--src/browser.h5
2 files changed, 11 insertions, 0 deletions
diff --git a/src/browser.cpp b/src/browser.cpp
index 8abe10a..7c7dca3 100644
--- a/src/browser.cpp
+++ b/src/browser.cpp
@@ -21,6 +21,7 @@
#include <QFileInfo>
#include <QFileInfoList>
#include <QPluginLoader>
+#include <QJsonArray>
inline Plugin loadPluginFromPath(const QString &path)
{
@@ -32,6 +33,11 @@ inline Plugin loadPluginFromPath(const QString &path)
qDebug("Loading plugin: %s [ok]", qUtf8Printable(path));
#endif
+ auto meta = loader.metaData().value("MetaData").toObject();
+ p.name = meta.value("name").toString();
+ p.author = meta.value("author").toString();
+ p.shortcut = QKeySequence::fromString(meta.value("shortcut").toString());
+
p.instance = std::shared_ptr<QObject>(loader.instance());
#ifdef QT_DEBUG
diff --git a/src/browser.h b/src/browser.h
index a06993d..e6b94e4 100644
--- a/src/browser.h
+++ b/src/browser.h
@@ -48,6 +48,11 @@ public:
return m_commands.keys();
}
+ const QVector<Plugin> plugins() const
+ {
+ return m_plugins;
+ }
+
public slots:
void createSession(const QString &profileName, bool newWindow, const QStringList &urls);
MainWindow *createWindow();