┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFelix Ernst <[email protected]>2021-06-22 11:55:53 +0200
committerFelix Ernst <[email protected]>2021-06-22 11:55:53 +0200
commit480b3067d25e4b49ea55285313a7c10e93f98ffd (patch)
tree3024f346de6956079282756b25f65bec3ef830ba /src
parent5e79f27aec817a44606e9e4f32b055d78eeb280c (diff)
parentdc3beae3ab2c55cd3501e17f93b51e93e876a177 (diff)
Merge branch 'release/21.04'
Diffstat (limited to 'src')
-rw-r--r--src/dolphincontextmenu.cpp19
-rw-r--r--src/dolphincontextmenu.h3
-rw-r--r--src/dolphinmainwindow.cpp2
3 files changed, 10 insertions, 14 deletions
diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp
index e2a41e907..47f0cdd40 100644
--- a/src/dolphincontextmenu.cpp
+++ b/src/dolphincontextmenu.cpp
@@ -116,28 +116,23 @@ DolphinContextMenu::Command DolphinContextMenu::open()
return m_command;
}
-void DolphinContextMenu::childEvent(QChildEvent* event)
+bool DolphinContextMenu::eventFilter(QObject* object, QEvent* event)
{
- if(event->added()) {
- event->child()->installEventFilter(this);
- }
- QMenu::childEvent(event);
-}
+ Q_UNUSED(object)
-bool DolphinContextMenu::eventFilter(QObject* dest, QEvent* event)
-{
if(event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) {
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
- if(m_removeAction && keyEvent->key() == Qt::Key_Shift) {
- if(event->type() == QEvent::KeyPress) {
+
+ if (m_removeAction && keyEvent->key() == Qt::Key_Shift) {
+ if (event->type() == QEvent::KeyPress) {
m_removeAction->update(DolphinRemoveAction::ShiftState::Pressed);
} else {
m_removeAction->update(DolphinRemoveAction::ShiftState::Released);
}
- return true;
}
}
- return QMenu::eventFilter(dest, event);
+
+ return false;
}
void DolphinContextMenu::openTrashContextMenu()
diff --git a/src/dolphincontextmenu.h b/src/dolphincontextmenu.h
index 7f0b6988a..afd8b8c4d 100644
--- a/src/dolphincontextmenu.h
+++ b/src/dolphincontextmenu.h
@@ -74,8 +74,7 @@ public:
Command open();
protected:
- void childEvent(QChildEvent* event) override;
- bool eventFilter(QObject* dest, QEvent* event) override;
+ bool eventFilter(QObject* object, QEvent* event) override;
private:
void openTrashContextMenu();
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 5595d0f5b..737856b23 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -211,6 +211,8 @@ DolphinMainWindow::DolphinMainWindow() :
DolphinMainWindow::~DolphinMainWindow()
{
+ // This fixes a crash on Wayland when closing the mainwindow while another dialog is open.
+ disconnect(QGuiApplication::clipboard(), &QClipboard::dataChanged, this, &DolphinMainWindow::updatePasteAction);
}
QVector<DolphinViewContainer*> DolphinMainWindow::viewContainers() const