aboutsummaryrefslogtreecommitdiff
path: root/src/webengine
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-09-08 13:13:24 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-09-08 13:13:24 +0200
commitccae7d1520548aaec95f6bd7302dd72c6fbdd6b9 (patch)
treeda6706a388a4318bc309f840ca302b3a998b7572 /src/webengine
parentMove ProfileManager to libweb (diff)
downloadsmolbote-ccae7d1520548aaec95f6bd7302dd72c6fbdd6b9.tar.xz
Replace ProfileManager::profileList() with ProfileManager::idList()
Diffstat (limited to 'src/webengine')
-rw-r--r--src/webengine/webview.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/webengine/webview.cpp b/src/webengine/webview.cpp
index 94f73bc..963a894 100644
--- a/src/webengine/webview.cpp
+++ b/src/webengine/webview.cpp
@@ -243,16 +243,12 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
createWindow(QWebEnginePage::WebBrowserTab)->load(ctxdata.linkUrl());
});
- auto *newTabMenu = new QMenu(tr("Open link in new tab with profile"), this);
- ProfileIterator it(profileManager->profileList());
- while(it.hasNext()) {
- it.next();
- connect(newTabMenu->addAction(it.key()), &QAction::triggered, this, [this, ctxdata, it]() {
- auto *view = createWindow(QWebEnginePage::WebBrowserTab);
- view->setProfile(it.value());
- view->load(ctxdata.linkUrl());
- });
- }
+ QMenu *newTabMenu = profileManager->createProfileMenu([this, ctxdata](WebProfile *profile) {
+ auto *view = this->createWindow(QWebEnginePage::WebBrowserTab);
+ view->setProfile(profile);
+ view->load(ctxdata.linkUrl());
+ }, this);
+ newTabMenu->setTitle(tr("Open link in new tab with profile"));
menu->addMenu(newTabMenu);
connect(menu->addAction(tr("Open link in new window")), &QAction::triggered, this, [this, ctxdata]() {