aboutsummaryrefslogtreecommitdiff
path: root/src/subwindow
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/subwindow
parentMove ProfileManager to libweb (diff)
downloadsmolbote-ccae7d1520548aaec95f6bd7302dd72c6fbdd6b9.tar.xz
Replace ProfileManager::profileList() with ProfileManager::idList()
Diffstat (limited to 'src/subwindow')
-rw-r--r--src/subwindow/subwindow.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/subwindow/subwindow.cpp b/src/subwindow/subwindow.cpp
index 4e79a03..0873010 100644
--- a/src/subwindow/subwindow.cpp
+++ b/src/subwindow/subwindow.cpp
@@ -50,17 +50,10 @@ SubWindow::SubWindow(const std::unique_ptr<Configuration> &config, QWidget *pare
Browser *browser = qobject_cast<Browser *>(qApp);
Q_CHECK_PTR(browser);
- ProfileIterator it(profileManager->profileList());
- while(it.hasNext()) {
- it.next();
- auto *profile = it.value();
- auto *loadAction = loadProfile_menu->addAction(profile->name());
-
- connect(loadAction, &QAction::triggered, this, [=]() {
- this->setProfile(profile);
- profileName_action->setText(tr("Profile: %1").arg(profile->name()));
- });
- }
+ loadProfile_menu->addActions(profileManager->createProfileMenu([this, profileName_action](WebProfile *profile) {
+ this->setProfile(profile);
+ profileName_action->setText(tr("Profile: %1").arg(profile->name()));
+ }, this)->actions());
menu->insertSeparator(firstAction);
}