This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[SOLVED] icon naming doubts

Tags: None
(comma "," separated)
fluca1978
Registered Member
Posts
81
Karma
0
OS

[SOLVED] icon naming doubts

Fri Apr 20, 2012 11:38 am
Hi,
in my piece of code I'm using UDSEntry to create a set of folders, and I'd like to give different icons to a subset of them. However, while I see that the "devices" and "filesystem" icons can be referred by their name, other icons (e.g., "apps") cannot.
In my code I use something like the following:

Code: Select all

QString const RoleFS::ICON_FOLDER_OK( "folder-green" );   
QString const RoleFS::ICON_FOLDER_KO( "folder-red" );   
QString const RoleFS::ICON_PERMISSIONS( "oxy48-app-kpgp" );   
QString const RoleFS::ICON_FILESYSTEM( "drive-harddisk" );


dirEntry->insert( KIO::UDSEntry::UDS_ICON_NAME,
            RoleFS::ICON_PERMISSIONS );


I've tried to follow the guidelines from the icon tutorial (http://techbase.kde.org/Development/Tutorials/Icons) but it not clear to me if the naming schema refers only to KIcon objects or can be used also for normal UDSEntry and in such case why the above piece of code is not working (a blank document-not-found icon is shown).

Last edited by fluca1978 on Thu Apr 26, 2012 2:17 pm, edited 1 time in total.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: icon naming doubts

Wed Apr 25, 2012 12:21 am
I assume you are referring to the icon of KGpg rather than a application named "KPGP".
The icon name "oxy48-app-kpgp" is not valid, the name itself is all that matters, not the directory it is in.

In this case, try using the name "kgpg", although you might find "object-locked" to be more relevant here.
You can use "kdialog --geticon icons" to get a graphical selector you can use to find icons. When you select the icon, it will output it to the terminal.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
fluca1978
Registered Member
Posts
81
Karma
0
OS

Re: icon naming doubts

Thu Apr 26, 2012 2:17 pm
Thanks for the trick, using kdialog --geticon allowed me to use the right naming schema!


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft