From 3b611f42bf5c233ca66e406474896022b6ed78cc Mon Sep 17 00:00:00 2001
From: Aqua-sama <aqua@iserlohn-fortress.net>
Date: Sat, 25 Aug 2018 20:07:54 +0200
Subject: Add BrowserInterface to simplify plugins a bit

---
 plugins/ConfigurationEditor/configurationeditorplugin.cpp |  8 +-------
 plugins/ConfigurationEditor/configurationeditorplugin.h   | 11 +++--------
 2 files changed, 4 insertions(+), 15 deletions(-)

(limited to 'plugins/ConfigurationEditor')

diff --git a/plugins/ConfigurationEditor/configurationeditorplugin.cpp b/plugins/ConfigurationEditor/configurationeditorplugin.cpp
index 93b1c69..0d44a8a 100644
--- a/plugins/ConfigurationEditor/configurationeditorplugin.cpp
+++ b/plugins/ConfigurationEditor/configurationeditorplugin.cpp
@@ -18,13 +18,7 @@ CommandHash_t ConfigurationEditorPlugin::commands()
 
 QDialog *ConfigurationEditorPlugin::createWidget(QWidget *parent)
 {
-    auto *dlg = new ConfigurationDialog(m_config, parent);
+    auto *dlg = new ConfigurationDialog(browser->getConfiguration(), parent);
     dlg->setAttribute(Qt::WA_DeleteOnClose, true);
     return dlg;
 }
-
-void ConfigurationEditorPlugin::setConfiguration(Configuration *cfg)
-{
-    Q_CHECK_PTR(cfg);
-    m_config = cfg;
-}
diff --git a/plugins/ConfigurationEditor/configurationeditorplugin.h b/plugins/ConfigurationEditor/configurationeditorplugin.h
index 6054723..6bb72ce 100644
--- a/plugins/ConfigurationEditor/configurationeditorplugin.h
+++ b/plugins/ConfigurationEditor/configurationeditorplugin.h
@@ -5,22 +5,17 @@
 #include <interfaces.h>
 
 class QDialog;
-class ConfigurationEditorPlugin : public QObject, public PluginInterface, public ConfigurationInterface
+class ConfigurationEditorPlugin : public QObject, public PluginInterface
 {
     Q_OBJECT
-    Q_PLUGIN_METADATA(IID ProfileInterfaceIid FILE "ConfigurationEditor.json")
-    Q_INTERFACES(PluginInterface ConfigurationInterface)
+    Q_PLUGIN_METADATA(IID PluginInterfaceIid FILE "ConfigurationEditor.json")
+    Q_INTERFACES(PluginInterface)
 
 public:
     // PluginInterface
     CommandHash_t commands() override;
     QDialog *createWidget(QWidget *parent = nullptr) override;
 
-    // ConfigurationInterface
-    void setConfiguration(Configuration *cfg) override;
-
-private:
-    Configuration *m_config = nullptr;
 };
 
 #endif // CONFIGURATIONEDITOR_PLUGIN_H
-- 
cgit v1.2.1