Make playlist items use the full width available to them and adjust correctly when...
[amarok.git] / src / iconloader.cpp
blobeaf213fe71b876689e84a2df4c96782165a6761c
1 /***************************************************************************
2 * Copyright (C) 2006 by Mark Kretschmann <markey@web.de> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
20 #include "amarok.h"
21 #include "amarokconfig.h"
23 #include <qmap.h>
26 QString
27 Amarok::icon( const QString& name ) //declared in amarok.h
29 // We map our Amarok icon theme names to system icons, instead of using the same
30 // naming scheme. This has two advantages:
31 // 1. Our icons can have simpler and more meaningful names
32 // 2. We can map several of our icons to one system icon, if necessary
33 static QMap<QString, QString> iconMap;
35 if( iconMap.empty() ) {
36 iconMap["add_lyrics"] = "edit_add";
37 iconMap["add_playlist"] = "arrow_down";
38 iconMap["album"] = "drive-optical";
39 iconMap["artist"] = "user-female";
40 iconMap["audioscrobbler"] = "audioscrobbler";
41 iconMap["love"] = "love";
42 iconMap["back"] = "media-skip-backward";
43 iconMap["burn"] = "cdburn";
44 iconMap["change_language"] = "configure";
45 iconMap["clock"] = "history";
46 iconMap["collection"] = "collection";
47 iconMap["configure"] = "configure";
48 iconMap["covermanager"] = "covermanager";
49 iconMap["device"] = "ipod-unmount";
50 iconMap["download"] = "get-hot-new-stuff";
51 iconMap["dynamic"] = "dynamic";
52 iconMap["edit"] = "edit";
53 iconMap["editcopy"] = "editcopy";
54 iconMap["equalizer"] = "media-equalizer";
55 iconMap["external"] = "exec";
56 iconMap["fastforward"] = "2rightarrow";
57 iconMap["favourite_genres"] = "kfm";
58 iconMap["files"] = "folder";
59 iconMap["files2"] = "folder_red";
60 iconMap["info"] = "dialog-information";
61 iconMap["lyrics"] = "text-center";
62 iconMap["magnatune"] = "services";
63 iconMap["mostplayed"] = "favorites";
64 iconMap["music"] = "media-podcast";
65 iconMap["next"] = "media-skip-forward";
66 iconMap["pause"] = "media-playback-pause";
67 iconMap["play"] = "media-playback-start";
68 iconMap["playlist"] = "media-playlist";
69 iconMap["playlist_clear"] = "media-playlist-clear";
70 iconMap["playlist_refresh"] = "rebuild";
71 iconMap["queue"] = "arrow-down-double";
72 iconMap["queue_track"] = "2rightarrow";
73 iconMap["dequeue_track"] = "2leftarrow";
74 iconMap["random"] = "roll";
75 iconMap["random_album"] = "drive-optical";
76 iconMap["random_no"] = "arrow-right";
77 iconMap["random_track"] = "roll";
78 iconMap["redo"] = "edit-redo";
79 iconMap["refresh"] = "view-refresh";
80 iconMap["remove"] = "edit-delete";
81 iconMap["remove_from_playlist"] = "remove";
82 iconMap["repeat_album"] = "drive-optical";
83 iconMap["repeat_no"] = "arrow-down";
84 iconMap["repeat_playlist"] = "repeat_playlist";
85 iconMap["repeat_track"] = "repeat_track";
86 iconMap["rescan"] = "edit-refresh";
87 iconMap["rewind"] = "media-seek-backward";
88 iconMap["save"] = "document-save";
89 iconMap["scripts"] = "signature";
90 iconMap["search"] = "find";
91 iconMap["settings_engine"] = "amarok";
92 iconMap["settings_general"] = "configure";
93 iconMap["settings_indicator"] = "tv";
94 iconMap["settings_playback"] = "speaker";
95 iconMap["settings_view"] = "edit-find";
96 iconMap["stop"] = "media-playback-stop";
97 iconMap["podcast"] = "media-podcast";
98 iconMap["podcast2"] = "podcast_new";
99 iconMap["track"] = "sound";
100 iconMap["undo"] = "edit-undo";
101 iconMap["visualizations"] = "color-fill";
102 iconMap["zoom"] = "edit-find";
105 static QMap<QString, QString> amarokMap;
106 if( amarokMap.empty() ) {
107 amarokMap["queue_track"] = "fastforward";
108 amarokMap["dequeue_track"] = "rewind";
111 if( iconMap.contains( name ) )
113 if( AmarokConfig::useCustomIconTheme() )
115 if( amarokMap.contains( name ) )
116 return QString( "amarok_" ) + amarokMap[name];
117 return QString( "amarok_" ) + name;
119 else
120 return iconMap[name];
123 return name;