aboutsummaryrefslogtreecommitdiff
path: root/src/webengine
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-06-24 18:42:40 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-06-24 18:42:40 +0200
commit1581e94b9ac98f5d385a71a5bfbde81da22da2b2 (patch)
tree74bd192d5cb344e3e5d10596f7b0d09aced8ca42 /src/webengine
parentAdd Session class (diff)
downloadsmolbote-1581e94b9ac98f5d385a71a5bfbde81da22da2b2.tar.xz
Add ProfileManager
Diffstat (limited to 'src/webengine')
-rw-r--r--src/webengine/widgets/pagemenu.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/webengine/widgets/pagemenu.cpp b/src/webengine/widgets/pagemenu.cpp
index efd176b..deff511 100644
--- a/src/webengine/widgets/pagemenu.cpp
+++ b/src/webengine/widgets/pagemenu.cpp
@@ -20,6 +20,7 @@
#include <QWidgetAction>
#include <bookmarks/bookmarkswidget.h>
#include <webprofile.h>
+#include "profilemanager.h"
PageMenu::PageMenu(WebView *parent)
: QMenu(tr("Page"), parent)
@@ -108,12 +109,13 @@ void PageMenu::updateLoadProfileMenu()
auto *browser = qobject_cast<Browser *>(qApp);
Q_CHECK_PTR(browser);
- for(const QString &name : browser->profiles()) {
- auto *profile = browser->profile(name);
- Q_CHECK_PTR(profile);
+ ProfileIterator it(ProfileManager::profileList());
+ while(it.hasNext()) {
+ it.next();
+ auto *profile =it.value();
+ auto *loadAction = loadProfile_menu->addAction(profile->name());
- auto *profileAction = loadProfile_menu->addAction(profile->name());
- connect(profileAction, &QAction::triggered, this, [this, profile]() {
+ connect(loadAction, &QAction::triggered, this, [=]() {
view->setProfile(profile);
});
}