Skip to content

Commit

Permalink
fix: Error in displaying file name after deleting the. hidden file th…
Browse files Browse the repository at this point in the history
…at appears in the hidden file

The signal sequence for sending hidden files is incorrect, resulting in deletion without sending the removefinish signal

Log: Error in displaying file name after deleting the. hidden file that appears in the hidden file
Bug: https://pms.uniontech.com/bug-view-260035.html
  • Loading branch information
liyigang1 authored and deepin-bot[bot] committed Jun 28, 2024
1 parent 0ef4bd9 commit 05116f7
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,6 @@ void RootInfo::doFileDeleted(const QUrl &url)
{
enqueueEvent(QPair<QUrl, EventType>(url, kRmFile));
metaObject()->invokeMethod(this, QT_STRINGIFY(doThreadWatcherEvent), Qt::QueuedConnection);

if (UniversalUtils::urlEquals(hiddenFileUrl, url))
Q_EMIT watcherUpdateHideFile(url);
}

void RootInfo::dofileMoved(const QUrl &fromUrl, const QUrl &toUrl)
Expand All @@ -199,13 +196,6 @@ void RootInfo::dofileMoved(const QUrl &fromUrl, const QUrl &toUrl)
info->refresh();

dofileCreated(toUrl);

// TODO(lanxs) TODO(xust) .hidden file's attribute changed signal not emitted in removable disks (vfat/exfat).
// but renamed from a .goutputstream_xxx file
// NOTE: GlobalEventType::kHideFiles event is watched in fileview, but this can be used to notify update view
// when the file is modified in other way.
if (UniversalUtils::urlEquals(hiddenFileUrl, toUrl))
Q_EMIT watcherUpdateHideFile(toUrl);
}

void RootInfo::dofileCreated(const QUrl &url)
Expand Down Expand Up @@ -535,6 +525,9 @@ void RootInfo::removeChildren(const QList<QUrl> &urlList)

if (removeChildren.count() > 0)
emit watcherRemoveFiles(removeChildren);

if (removeUrls.contains(hiddenFileUrl))
Q_EMIT watcherUpdateHideFile(hiddenFileUrl);
}

bool RootInfo::containsChild(const QUrl &url)
Expand Down

0 comments on commit 05116f7

Please sign in to comment.