Version: (using KDE KDE 3.1.4) Installed from: RedHat RPMs OS: Linux Using .directory files you can set an icon for a directory using for example [Desktop Entry] Icon = /mp3/rem/folder.jpg We can only use absolute pathnames, or pathnames relative to some directory specified by the kde distribution (i.e. $KDEDIR/share/icons/). This is a problem if you want to move directories and want to keep the icon with the directory. It would be nice if there was some option to use the path of the directory itself, i.e something like [Desktop Entry] Icon = $LOCALDIR/folder.jpg
Created attachment 4394 [details] partial patch Based on the patch by Pieter, this turns ./foo.jpg into an absolute path when parsing the .directory file. But it doesn't seem to work, KMimeType::pixmap() passes the full path to KIconLoader (which is necessary anyway, to apply icon effects etc.), and KIconLoader returns an null pixmap. Needs debugging inside kiconloader... (no time for that right now).
I tested the patch by David attached for KDE 3.1.5 (compiled with konstruct) and it works for me. The exact .directory file I used was [Desktop Entry] Icon = ./.folder.png with of course a corresponding image .folder.png present. I also cannot image that there is any problem in KIconLoader since KFolderType::icon() (which is affected by the patch) only passes a string to the rest of the program. Perhaps the image file was not present? Could someone compile kdelibs with the patch and test if konqueror works? thanks, pieter
CVS commit by faure: Support for Icon=./foo.png in .directory files, bsaed on patch by Pieter Eendebak. CCMAIL: 73463-done@bugs.kde.org M +8 -0 kmimetype.cpp 1.187 --- kdelibs/kio/kio/kmimetype.cpp #1.186:1.187 @@ -631,4 +631,12 @@ QString KFolderType::icon( const KURL& _ return KMimeType::icon( _url, _is_local ); + if ( icon.startsWith( "./" ) ) { + // path is relative with respect to the location + // of the .directory file (#73463) + KURL v( _url ); + v.addPath( icon.mid( 2 ) ); + icon = v.path(); + } + return icon; }
*** Bug 68507 has been marked as a duplicate of this bug. ***
*** Bug 224449 has been marked as a duplicate of this bug. ***