aboutsummaryrefslogtreecommitdiff
path: root/plugins/ProfileEditor/profileeditorplugin.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-06-16 13:55:35 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-06-16 13:55:35 +0200
commitb27e55b0bbba9a1678159abe44280e173374f971 (patch)
treea7a5bb75ad9b4dc3fc31b39b5ab2fe860b55a27e /plugins/ProfileEditor/profileeditorplugin.cpp
parentAdd extra-cmake-modules to make depends (diff)
downloadsmolbote-b27e55b0bbba9a1678159abe44280e173374f971.tar.xz
Sort .profile by time
Remove ProfileInterface::setProfiles ProfileView: Add General tab ProfileView: some cleanup ProfileView: Add Cookies tab
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);
+}