diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-06-24 18:42:40 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-06-24 18:42:40 +0200 |
commit | 1581e94b9ac98f5d385a71a5bfbde81da22da2b2 (patch) | |
tree | 74bd192d5cb344e3e5d10596f7b0d09aced8ca42 /src/webengine | |
parent | Add Session class (diff) | |
download | smolbote-1581e94b9ac98f5d385a71a5bfbde81da22da2b2.tar.xz |
Add ProfileManager
Diffstat (limited to 'src/webengine')
-rw-r--r-- | src/webengine/widgets/pagemenu.cpp | 12 |
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); }); } |