aboutsummaryrefslogtreecommitdiff
path: root/plugins/ProfileEditor/profileeditorplugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/ProfileEditor/profileeditorplugin.cpp')
-rw-r--r--plugins/ProfileEditor/profileeditorplugin.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/plugins/ProfileEditor/profileeditorplugin.cpp b/plugins/ProfileEditor/profileeditorplugin.cpp
index 2e7b261..d13e819 100644
--- a/plugins/ProfileEditor/profileeditorplugin.cpp
+++ b/plugins/ProfileEditor/profileeditorplugin.cpp
@@ -9,7 +9,7 @@
#include "profileeditorplugin.h"
#include "forms/profilemanagerdialog.h"
#include "forms/profileview.h"
-#include <QHash>
+#include <QVector>
#include <webprofile.h>
QHash<QString, std::function<int()>> ProfileEditorPlugin::commands()
@@ -22,23 +22,22 @@ QHash<QString, std::function<int()>> ProfileEditorPlugin::commands()
});
hash.insert("list-profiles", [this]() -> int {
- for(auto i = profiles->constBegin(); i != profiles->constEnd(); ++i) {
- qDebug(" - %s", qUtf8Printable(i.key()));
+ for(const WebProfile *profile : qAsConst(profiles)) {
+ qDebug(" - %s", qUtf8Printable(profile->name()));
}
return 0;
});
return hash;
}
-void ProfileEditorPlugin::setProfiles(QHash<QString, WebProfile *> *profiles)
-{
- Q_CHECK_PTR(profiles);
- this->profiles = profiles;
-}
-
QDialog *ProfileEditorPlugin::createWidget(QWidget *parent)
{
auto *widget = new ProfileManagerDialog(profiles, parent);
widget->setAttribute(Qt::WA_DeleteOnClose, true);
return widget;
}
+
+void ProfileEditorPlugin::registerProfile(WebProfile *profile)
+{
+ profiles.append(profile);
+}