Commit 53af2a7f authored by Carlos Alves's avatar Carlos Alves Committed by Kurt Hindenburg

Fix 'Copy Location' and 'Open With' issues with context menu

Update mouse events in mousePressEvent so the events are updated with the mouse stopped as well as moving.

BUG: 426359
BUG: 423860
FIXED-IN: 20.08.3
parent 9a4844d5
......@@ -69,16 +69,6 @@ QList<QAction *> FileFilterHotSpot::actions()
void FileFilterHotSpot::setupMenu(QMenu *menu)
{
// We are reusing the QMenu, but we need to update the actions anyhow.
// Remove the 'Open with' actions from it, then add the new ones.
QList<QAction*> toDelete;
for (auto *action : menu->actions()) {
if (action->text().toLower().remove(QLatin1Char('&')).contains(i18n("open with"))) {
toDelete.append(action);
}
}
qDeleteAll(toDelete);
const KFileItem fileItem(QUrl::fromLocalFile(_filePath));
const KFileItemList itemList({fileItem});
const KFileItemListProperties itemProperties(itemList);
......
......@@ -1791,14 +1791,6 @@ void SessionController::showDisplayContextMenu(const QPoint& position)
copy->setShortcut(Konsole::ACCEL + Qt::SHIFT + Qt::Key_C);
#endif
// remove content-specific actions such as "Open Link", "Copy Email Address" etc
if (popup->actions()[0]->objectName() == QStringLiteral("open-action") &&
popup->actions()[1]->objectName() == QStringLiteral("copy-action"))
{
popup->removeAction(popup->actions().value(0, nullptr));
popup->removeAction(popup->actions().value(0, nullptr));
}
// prepend content-specific actions such as "Open Link", "Copy Email Address" etc
QSharedPointer<HotSpot> hotSpot = _sessionDisplayConnection->view()->filterActions(position);
if (hotSpot != nullptr) {
......@@ -1837,6 +1829,15 @@ void SessionController::showDisplayContextMenu(const QPoint& position)
chosen->trigger();
}
// Remove the 'Open with' actions from it.
QList<QAction*> toDelete;
for (auto *action : popup->actions()) {
if (action->text().toLower().remove(QLatin1Char('&')).contains(i18n("open with"))) {
toDelete.append(action);
}
}
qDeleteAll(toDelete);
// Remove the Accelerator for the copy shortcut so we don't have two actions with same shortcut.
copy->setShortcut({});
} else {
......
......@@ -1434,6 +1434,10 @@ void TerminalDisplay::mousePressEvent(QMouseEvent* ev)
getCharacterPosition(ev->pos(), charLine, charColumn, !_usesMouseTracking);
QPoint pos = QPoint(charColumn, charLine);
processFilters();
_filterChain->mouseMoveEvent(this, ev, charLine, charColumn);
if (ev->button() == Qt::LeftButton) {
// request the software keyboard, if any
if (qApp->autoSipEnabled()) {
......
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