1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 09:42:10 +02:00

WebView: Don't show "Show image" action when showing image

This commit is contained in:
David Rosca 2018-03-31 11:06:28 +02:00
parent 94e1421d30
commit d7dc9ba9f6
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8

View File

@ -830,11 +830,13 @@ void WebView::createLinkContextMenu(QMenu* menu, const WebHitTestResult &hitTest
void WebView::createImageContextMenu(QMenu* menu, const WebHitTestResult &hitTest)
{
menu->addSeparator();
Action* act = new Action(tr("Show i&mage"));
act->setData(hitTest.imageUrl());
connect(act, SIGNAL(triggered()), this, SLOT(openActionUrl()));
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(userDefinedOpenUrlInNewTab()));
menu->addAction(act);
if (hitTest.imageUrl() != url()) {
Action *act = new Action(tr("Show i&mage"));
act->setData(hitTest.imageUrl());
connect(act, SIGNAL(triggered()), this, SLOT(openActionUrl()));
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(userDefinedOpenUrlInNewTab()));
menu->addAction(act);
}
menu->addAction(tr("Copy image"), this, SLOT(copyImageToClipboard()));
menu->addAction(QIcon::fromTheme("edit-copy"), tr("Copy image ad&dress"), this, SLOT(copyLinkToClipboard()))->setData(hitTest.imageUrl());
menu->addSeparator();