diff options
Diffstat (limited to 'plugins/ProfileEditor/profileeditorplugin.cpp')
-rw-r--r-- | plugins/ProfileEditor/profileeditorplugin.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/plugins/ProfileEditor/profileeditorplugin.cpp b/plugins/ProfileEditor/profileeditorplugin.cpp index d0341b9..2e7b261 100644 --- a/plugins/ProfileEditor/profileeditorplugin.cpp +++ b/plugins/ProfileEditor/profileeditorplugin.cpp @@ -10,26 +10,30 @@ #include "forms/profilemanagerdialog.h" #include "forms/profileview.h" #include <QHash> +#include <webprofile.h> QHash<QString, std::function<int()>> ProfileEditorPlugin::commands() { QHash<QString, std::function<int()>> hash; - hash.insert("profileEditor:about", []() -> int { - qDebug("ProfileEditor for smolbote"); - return 0; - }); - hash.insert("profileEditor:edit", [this]() -> int { + hash.insert("edit-profiles-ui", [this]() -> int { auto *dialog = createWidget(nullptr); return dialog->exec(); }); + + hash.insert("list-profiles", [this]() -> int { + for(auto i = profiles->constBegin(); i != profiles->constEnd(); ++i) { + qDebug(" - %s", qUtf8Printable(i.key())); + } + return 0; + }); return hash; } -void ProfileEditorPlugin::addProfile(const QString &name, QWebEngineProfile *profile) +void ProfileEditorPlugin::setProfiles(QHash<QString, WebProfile *> *profiles) { - Q_CHECK_PTR(profile); - profiles.insert(name, profile); + Q_CHECK_PTR(profiles); + this->profiles = profiles; } QDialog *ProfileEditorPlugin::createWidget(QWidget *parent) |