From ccae7d1520548aaec95f6bd7302dd72c6fbdd6b9 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sat, 8 Sep 2018 13:13:24 +0200 Subject: Replace ProfileManager::profileList() with ProfileManager::idList() --- src/mainwindow/mainwindow.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src/mainwindow/mainwindow.cpp') 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 &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(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) -- cgit v1.2.1