Skip to content

Commit

Permalink
Fix issue where context menu was not working (forgot to add section
Browse files Browse the repository at this point in the history
scope..._
  • Loading branch information
lecler-i committed Jun 10, 2019
1 parent 1c8c498 commit ec8e375
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit ec8e375

Please sign in to comment.