Skip to content

Commit ec8e375

Browse files
author
Thomas
committed
Fix issue where context menu was not working (forgot to add section
scope..._
1 parent 1c8c498 commit ec8e375

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/mainwindow.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,16 +282,18 @@ void MainWindow::restore() {
282282
}
283283

284284
void MainWindow::createContextMenu(const QStringList &keys) {
285+
appSettings->beginGroup("providers");
285286
for (const auto &i : keys) {
286287
if (!i.startsWith("#")) {
287-
QString url = appSettings->value(i).toString();
288+
auto url = appSettings->value(i).toUrl();
288289
contextMenu.addAction(i, [this, url]() {
289-
qDebug() << "URL is :" << url;
290+
qDebug() << "Switching to : " << url;
290291
webview->setUrl(QUrl(url));
291292
});
292293
contextMenu.addSeparator();
293294
}
294295
}
296+
appSettings->endGroup();
295297
}
296298

297299
void MainWindow::readSettings() {
@@ -327,7 +329,7 @@ void MainWindow::fullScreenRequested(QWebEngineFullScreenRequest request) {
327329
void MainWindow::ShowContextMenu(const QPoint &pos) // this is a slot
328330
{
329331
QPoint globalPos = webview->mapToGlobal(pos);
330-
QAction *selectedItem = contextMenu.exec(globalPos);
332+
contextMenu.exec(globalPos);
331333
}
332334

333335
void MainWindow::parseCommand() {

0 commit comments

Comments
 (0)