Version: 4.3.0 (using KDE 4.3.0) Compiler: gcc-4.3.2-r2 OS: Linux Installed from: Gentoo Packages When I change icon for folder, which place on samba filesystem. In this directory appears file ".directory" (it is correctly), but folder not change icon.
kdelibs-4.3.1/kdecore/services/kfoldermimetype.cpp contains the code: // There are also other directories with 0 size, such as /proc, that may // be mounted, but those are unlikely to contain .directory (and checking // this would require KMountPoint from kio). KDE_struct_stat buff; if (KDE_stat( QFile::encodeName( _url.toLocalFile()), &buff ) == 0 && S_ISDIR( buff.st_mode ) && buff.st_size == 0 ) { return KMimeTypePrivate::iconName( _url ); } With this code kdelibs ignores folders located in mounted cifs filesystem, because size of this folder is 0.
KIO probably is the place this needs dealing with. I've talked to another dev and we kinda think this is intentional regardless because we wouldn't want unnecessary reads on .directory for network resources really. If so the UI shouldn't allow you setting an icon though, allowing to set an icon but then not showing it is clearly a bug.
I agree that changing the icon should not be possible for Samba share locations, for the reasons you've indicated. And also that the feature should be disabled in the UI so you can't futilely try anyway.
Git commit a2335335ecfe4b211a2898594a21d52c79107b7a by Ahmad Samir. Committed on 11/04/2020 at 09:33. Pushed by ahmadsamir into branch 'master'. [KPropertiesDialog] Disable changing remote dir icons Summary: Changing the icon of a dir on e.g. a samba share doesn't seem to have an effect, this is intentional as reading .directory would impact network resources negatively, see the bug report for more details. Change the code to only show the KIconButton only for local dirs and desktop:/. Test Plan: make && ctest And testing an sftp://, the button to change the icon isn't shown Reviewers: #frameworks, dfaure, sitter Reviewed By: dfaure Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D28679 M +6 -3 src/widgets/kpropertiesdialog.cpp https://commits.kde.org/kio/a2335335ecfe4b211a2898594a21d52c79107b7a