diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-08-25 20:07:54 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-08-25 20:07:54 +0200 |
commit | 3b611f42bf5c233ca66e406474896022b6ed78cc (patch) | |
tree | cbf30d20220f91c5eccaf8d89a2aac1989241b08 /plugins/ConfigurationEditor | |
parent | MainWindow: fix load session action (diff) | |
download | smolbote-3b611f42bf5c233ca66e406474896022b6ed78cc.tar.xz |
Add BrowserInterface to simplify plugins a bit
Diffstat (limited to 'plugins/ConfigurationEditor')
-rw-r--r-- | plugins/ConfigurationEditor/configurationeditorplugin.cpp | 8 | ||||
-rw-r--r-- | plugins/ConfigurationEditor/configurationeditorplugin.h | 11 |
2 files changed, 4 insertions, 15 deletions
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 |