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()
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();
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