From ec8e375b6c9cc8a6bce04530c277ee2fd4d0d760 Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 10 Jun 2019 10:51:00 +0200 Subject: [PATCH] Fix issue where context menu was not working (forgot to add section scope..._ --- src/mainwindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 66df587..1da8d55 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -282,16 +282,18 @@ void MainWindow::restore() { } void MainWindow::createContextMenu(const QStringList &keys) { + appSettings->beginGroup("providers"); for (const auto &i : keys) { if (!i.startsWith("#")) { - QString url = appSettings->value(i).toString(); + auto url = appSettings->value(i).toUrl(); contextMenu.addAction(i, [this, url]() { - qDebug() << "URL is :" << url; + qDebug() << "Switching to : " << url; webview->setUrl(QUrl(url)); }); contextMenu.addSeparator(); } } + appSettings->endGroup(); } void MainWindow::readSettings() { @@ -327,7 +329,7 @@ void MainWindow::fullScreenRequested(QWebEngineFullScreenRequest request) { void MainWindow::ShowContextMenu(const QPoint &pos) // this is a slot { QPoint globalPos = webview->mapToGlobal(pos); - QAction *selectedItem = contextMenu.exec(globalPos); + contextMenu.exec(globalPos); } void MainWindow::parseCommand() {