aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow/mainwindow.cpp
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/mainwindow/mainwindow.cpp
parentMove ProfileManager to libweb (diff)
downloadsmolbote-ccae7d1520548aaec95f6bd7302dd72c6fbdd6b9.tar.xz
Replace ProfileManager::profileList() with ProfileManager::idList()
Diffstat (limited to 'src/mainwindow/mainwindow.cpp')
-rw-r--r--src/mainwindow/mainwindow.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/mainwindow/mainwindow.cpp b/src/mainwindow/mainwindow.cpp
index 91e820a..eb4d34f 100644
--- a/src/mainwindow/mainwindow.cpp
+++ b/src/mainwindow/mainwindow.cpp
@@ -161,6 +161,7 @@ MainWindow::MainWindow(const std::unique_ptr<Configuration> &config, QWidget *pa
QPrintDialog dlg(printer, this);
if(dlg.exec() == QDialog::Accepted) {
currentView->page()->print(printer, [printer](bool success) {
+ Q_UNUSED(success);
delete printer;
});
}
@@ -379,19 +380,9 @@ void MainWindow::updatePageLoadProfileMenu()
if(currentView == nullptr)
return;
- auto *browser = qobject_cast<Browser *>(qApp);
- Q_CHECK_PTR(browser);
-
- ProfileIterator it(profileManager->profileList());
- while(it.hasNext()) {
- it.next();
- auto *profile = it.value();
- auto *loadAction = pageLoadProfileMenu->addAction(profile->name());
-
- connect(loadAction, &QAction::triggered, this, [=]() {
- currentView->setProfile(profile);
- });
- }
+ pageLoadProfileMenu->addActions(profileManager->createProfileMenu([this](WebProfile *profile) {
+ this->currentView->setProfile(profile);
+ }, this)->actions());
}
void MainWindow::closeEvent(QCloseEvent *event)