]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge branch 'release/21.04'
authorFelix Ernst <fe.a.ernst@gmail.com>
Tue, 22 Jun 2021 09:55:53 +0000 (11:55 +0200)
committerFelix Ernst <fe.a.ernst@gmail.com>
Tue, 22 Jun 2021 09:55:53 +0000 (11:55 +0200)
src/dolphincontextmenu.cpp
src/dolphincontextmenu.h
src/dolphinmainwindow.cpp

index e2a41e907bf27a53526cdb41c6bc10d516c568f7..47f0cdd407f7991e2a4bf33f065efac2db334a84 100644 (file)
@@ -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()
index 7f0b6988a682e25a265f0e3ef40621a440f48e41..afd8b8c4d8d77c0679266e097519e47a0b738644 100644 (file)
@@ -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();
index 5595d0f5ba2e74c6c4e4e9ce2b12c8dfaeff953f..737856b23dd00e115ec82b6b71ea2e66397d5569 100644 (file)
@@ -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