fix: crash when switching view

This commit is contained in:
kateleet 2021-12-21 22:35:56 +08:00
parent c026d3a844
commit 3dd4433645
3 changed files with 9 additions and 4 deletions

View file

@ -32,13 +32,14 @@ ShortCut::ShortCut(QObject *parent)
void ShortCut::install(QObject *target) void ShortCut::install(QObject *target)
{ {
if (m_object) { // No need to remove, because memory space is automatically freed in qml.
m_object->removeEventFilter(this); // if (m_object) {
} // m_object->removeEventFilter(this);
// }
if (target) { if (target) {
target->installEventFilter(this); target->installEventFilter(this);
m_object = target; // m_object = target;
} }
} }

View file

@ -27,6 +27,8 @@ import FishUI 1.0 as FishUI
GridView { GridView {
id: control id: control
objectName: "FolderGridView"
property bool isDesktopView: false property bool isDesktopView: false
property Item rubberBand: null property Item rubberBand: null

View file

@ -26,6 +26,8 @@ import Cutefish.DragDrop 1.0 as DragDrop
ListView { ListView {
id: control id: control
objectName: "FolderListView"
property Item rubberBand: null property Item rubberBand: null
property Item hoveredItem: null property Item hoveredItem: null
property Item pressedItem: null property Item pressedItem: null