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/ProfileEditor | |
parent | MainWindow: fix load session action (diff) | |
download | smolbote-3b611f42bf5c233ca66e406474896022b6ed78cc.tar.xz |
Add BrowserInterface to simplify plugins a bit
Diffstat (limited to 'plugins/ProfileEditor')
-rw-r--r-- | plugins/ProfileEditor/profileeditorplugin.cpp | 15 | ||||
-rw-r--r-- | plugins/ProfileEditor/profileeditorplugin.h | 12 |
2 files changed, 5 insertions, 22 deletions
diff --git a/plugins/ProfileEditor/profileeditorplugin.cpp b/plugins/ProfileEditor/profileeditorplugin.cpp index d13e819..5d5c18a 100644 --- a/plugins/ProfileEditor/profileeditorplugin.cpp +++ b/plugins/ProfileEditor/profileeditorplugin.cpp @@ -20,24 +20,13 @@ QHash<QString, std::function<int()>> ProfileEditorPlugin::commands() auto *dialog = createWidget(nullptr); return dialog->exec(); }); - - hash.insert("list-profiles", [this]() -> int { - for(const WebProfile *profile : qAsConst(profiles)) { - qDebug(" - %s", qUtf8Printable(profile->name())); - } - return 0; - }); return hash; } QDialog *ProfileEditorPlugin::createWidget(QWidget *parent) { - auto *widget = new ProfileManagerDialog(profiles, parent); + Q_CHECK_PTR(browser); + auto *widget = new ProfileManagerDialog(browser->profiles(), parent); widget->setAttribute(Qt::WA_DeleteOnClose, true); return widget; } - -void ProfileEditorPlugin::registerProfile(WebProfile *profile) -{ - profiles.append(profile); -} diff --git a/plugins/ProfileEditor/profileeditorplugin.h b/plugins/ProfileEditor/profileeditorplugin.h index bc95708..c3e08af 100644 --- a/plugins/ProfileEditor/profileeditorplugin.h +++ b/plugins/ProfileEditor/profileeditorplugin.h @@ -14,11 +14,11 @@ class QWebEngineProfile; class QDialog; -class ProfileEditorPlugin : public QObject, public PluginInterface, public ProfileInterface +class ProfileEditorPlugin : public QObject, public PluginInterface { Q_OBJECT - Q_PLUGIN_METADATA(IID ProfileInterfaceIid FILE "ProfileEditor.json") - Q_INTERFACES(PluginInterface ProfileInterface) + Q_PLUGIN_METADATA(IID PluginInterfaceIid FILE "ProfileEditor.json") + Q_INTERFACES(PluginInterface) public: // PluginInterface @@ -26,12 +26,6 @@ public: // ProfileInterface QDialog *createWidget(QWidget *parent) override; - -public slots: - void registerProfile(WebProfile *profile) override; - -private: - QVector<WebProfile *> profiles; }; #endif //PROFILEEDITOR_PLUGIN_H |