1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-24 12:46:35 +01:00

WebView: Only show source code action on supported schemes

This commit is contained in:
David Rosca 2018-03-16 15:34:27 +01:00
parent 6241e8d37f
commit 954cfeefd6
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8

View File

@ -783,7 +783,12 @@ void WebView::createPageContextMenu(QMenu* menu)
menu->addSeparator();
menu->addAction(QIcon::fromTheme("edit-select-all"), tr("Select &all"), this, SLOT(editSelectAll()));
menu->addSeparator();
menu->addAction(QIcon::fromTheme("text-html"), tr("Show so&urce code"), this, SLOT(showSource()));
const QString scheme = url().scheme();
if (scheme != QL1S("view-source") && WebPage::internalSchemes().contains(scheme)) {
menu->addAction(QIcon::fromTheme("text-html"), tr("Show so&urce code"), this, SLOT(showSource()));
}
if (SiteInfo::canShowSiteInfo(url()))
menu->addAction(QIcon::fromTheme("dialog-information"), tr("Show info ab&out site"), this, SLOT(showSiteInfo()));