From 8f043b2958477d3fe2ef094b7e42f792f4cf0b02 Mon Sep 17 00:00:00 2001 From: Akseli Lahtinen Date: Fri, 15 Dec 2023 13:07:12 +0000 Subject: Resort directory size count after refreshing After refreshing the view when size count is selected as the sortRole, count is 0 at first. When the actual count is loaded, the sorting is done according to the count being 0. This can break the sort order and cause view and model to be out of sync. Making sure we always resort all items when the directory size/item count is changed fixes this BUG:473999 --- src/kitemviews/kfileitemmodel.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/kitemviews/kfileitemmodel.cpp') diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 4fd1ebd57..8de22318b 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -260,6 +260,13 @@ void KFileItemModel::setShowTrashMime(bool show) } } +void KFileItemModel::scheduleResortAllItems() +{ + if (!m_resortAllItemsTimer->isActive()) { + m_resortAllItemsTimer->start(); + } +} + void KFileItemModel::setShowHiddenFiles(bool show) { m_dirLister->setShowHiddenFiles(show); -- cgit v1.3