Skip to content

Commit

Permalink
fix: [organize] files not organized after renamed.
Browse files Browse the repository at this point in the history
collection model source data not updated when files renamed.

Log: as title.

Bug: https://pms.uniontech.com/bug-view-268169.html
  • Loading branch information
itsXuSt authored and max-lvs committed Sep 13, 2024
1 parent 1954719 commit 2170200
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,12 @@ void CollectionModelPrivate::sourceDataChanged(const QModelIndex &sourceTopleft,
auto url = shell->fileUrl(q->sourceModel()->index(i, 0));
auto cur = q->index(url);

if (handler)
handler->acceptUpdate(url, roles);
if (handler && handler->acceptUpdate(url, roles)) {
if (!fileList.contains(url)) {
fileList.append(url);
fileMap.insert(url, shell->fileInfo(q->sourceModel()->index(i, 0)));
}
}

if (cur.isValid())
idxs << cur;
Expand Down

0 comments on commit 2170200

Please sign in to comment.