Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit b7b4429b authored by Laurent Montel's avatar Laurent Montel 😁

Simplify logic

parent e89e4fb6
......@@ -224,8 +224,8 @@ void ArticleViewerWebEngine::slotWebHitFinished(const WebEngineViewer::WebHitTes
}
QMenu popup(this);
const bool contentSelected = !selectedText().isEmpty();
if (!contentSelected) {
const bool noContentSelected = selectedText().isEmpty();
if (noContentSelected) {
if (!mCurrentUrl.isEmpty()) {
popup.addAction(createOpenLinkInNewTabAction(mCurrentUrl, this, SLOT(slotOpenLinkInForegroundTab()), &popup));
popup.addAction(createOpenLinkInExternalBrowserAction(mCurrentUrl, this, SLOT(slotOpenLinkInBrowser()), &popup));
......
......@@ -92,8 +92,8 @@ void AkrWebEngineViewer::slotWebHitFinished(const WebEngineViewer::WebHitTestRes
popup.addAction(pageAction(QWebEnginePage::Reload));
popup.addSeparator();
const bool contentSelected = !selectedText().isEmpty();
if (!contentSelected) {
const bool noContentSelected = selectedText().isEmpty();
if (noContentSelected) {
if (!mCurrentUrl.isEmpty()) {
popup.addAction(createOpenLinkInNewTabAction(mCurrentUrl, this, SLOT(slotOpenLinkInForegroundTab()), &popup));
popup.addAction(createOpenLinkInExternalBrowserAction(mCurrentUrl, this, SLOT(slotOpenLinkInBrowser()), &popup));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment