[frameworks/kio] src/core: KFileItem: UDS ID changes are not detected in cmp

Méven Car <[email protected]> Wed, 5 Aug 2026 09:51:34 +0000 (UTC)
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 097a5a4dfcc035cb0b4325fdf930914b9414d461 by Méven Car, on behalf of David Wild.
Committed on 05/08/2026 at 09:38.
Pushed by meven into branch 'master'.

KFileItem: UDS ID changes are not detected in cmp

KFileItem::cmp() compares UDS_GROUP and UDS_USER as strings. If the directory listing for local files supplies UDS_GROUP/UDS_USER only as numeric IDs, cmp() reports no change. A full re-list (F5) fixes this, because cmp() is not used in this case.

This patch adds raw UDS_LOCAL_GROUP_ID/UDS_LOCAL_USER_ID comparison to cmp().

For example: in Dolphin file/folder properties dialog user changes Ownership Group. This change will not be detected, so the interface will still show the old Group.

CCBUG: 485052

M  +2    -0    src/core/kfileitem.cpp

https://invent.kde.org/frameworks/kio/-/commit/097a5a4dfcc035cb0b4325fdf930914b9414d461

diff --git a/src/core/kfileitem.cpp b/src/core/kfileitem.cpp
index 7b12d58821..01ace725a7 100644
--- a/src/core/kfileitem.cpp
+++ b/src/core/kfileitem.cpp
@@ -508,6 +508,8 @@ inline bool KFileItemPrivate::cmp(const KFileItemPrivate &item) const
             && m_permissions == item.m_permissions
             && m_entry.stringValue(KIO::UDSEntry::UDS_GROUP) == item.m_entry.stringValue(KIO::UDSEntry::UDS_GROUP)
             && m_entry.stringValue(KIO::UDSEntry::UDS_USER) == item.m_entry.stringValue(KIO::UDSEntry::UDS_USER)
+            && m_entry.numberValue(KIO::UDSEntry::UDS_LOCAL_GROUP_ID, -1) == item.m_entry.numberValue(KIO::UDSEntry::UDS_LOCAL_GROUP_ID, -1)
+            && m_entry.numberValue(KIO::UDSEntry::UDS_LOCAL_USER_ID, -1) == item.m_entry.numberValue(KIO::UDSEntry::UDS_LOCAL_USER_ID, -1)
             && m_entry.stringValue(KIO::UDSEntry::UDS_EXTENDED_ACL) == item.m_entry.stringValue(KIO::UDSEntry::UDS_EXTENDED_ACL)
             && m_entry.stringValue(KIO::UDSEntry::UDS_ACL_STRING) == item.m_entry.stringValue(KIO::UDSEntry::UDS_ACL_STRING)
             && m_entry.stringValue(KIO::UDSEntry::UDS_DEFAULT_ACL_STRING) == item.m_entry.stringValue(KIO::UDSEntry::UDS_DEFAULT_ACL_STRING)