diff options
Diffstat (limited to 'src/mainwindow/mainwindow.cpp')
-rw-r--r-- | src/mainwindow/mainwindow.cpp | 17 |
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) |