summaryrefslogtreecommitdiff
path: root/libappstream-builder/plugins
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-07-16 13:18:42 +0100
committerRichard Hughes <richard@hughsie.com>2014-07-16 14:28:30 +0100
commit6b3bb0817633954a9e546b58caf8643c0c8ceff4 (patch)
treec45dbe3086d5397ea496e227c1148bcd0c58ebd4 /libappstream-builder/plugins
parenta7c1bb82f8c5f6568f26689c19fea961a400f75c (diff)
downloadappstream-glib-6b3bb0817633954a9e546b58caf8643c0c8ceff4.tar.gz
Add oxygen-icon-theme when an application depends on kde-runtime
Diffstat (limited to 'libappstream-builder/plugins')
-rw-r--r--libappstream-builder/plugins/asb-plugin-desktop.c49
1 files changed, 36 insertions, 13 deletions
diff --git a/libappstream-builder/plugins/asb-plugin-desktop.c b/libappstream-builder/plugins/asb-plugin-desktop.c
index aa77faa..0058828 100644
--- a/libappstream-builder/plugins/asb-plugin-desktop.c
+++ b/libappstream-builder/plugins/asb-plugin-desktop.c
@@ -45,7 +45,6 @@ asb_plugin_add_globs (AsbPlugin *plugin, GPtrArray *globs)
{
asb_plugin_add_glob (globs, "/usr/share/applications/*.desktop");
asb_plugin_add_glob (globs, "/usr/share/applications/kde4/*.desktop");
- asb_plugin_add_glob (globs, "/usr/share/icons/hicolor/*/apps/*");
asb_plugin_add_glob (globs, "/usr/share/pixmaps/*");
asb_plugin_add_glob (globs, "/usr/share/icons/*");
asb_plugin_add_glob (globs, "/usr/share/*/icons/*");
@@ -186,7 +185,10 @@ asb_app_find_icon (AsbApp *app,
{
guint i;
guint j;
+ guint k;
+ guint m;
const gchar *pixmap_dirs[] = { "pixmaps", "icons", NULL };
+ const gchar *theme_dirs[] = { "hicolor", "oxygen", NULL };
const gchar *supported_ext[] = { ".png",
".gif",
".svg",
@@ -203,6 +205,20 @@ asb_app_find_icon (AsbApp *app,
"24x24",
"16x16",
NULL };
+ const gchar *types[] = { "actions",
+ "animations",
+ "apps",
+ "categories",
+ "devices",
+ "emblems",
+ "emotes",
+ "filesystems",
+ "intl",
+ "mimetypes",
+ "places",
+ "status",
+ "stock",
+ NULL };
/* is this an absolute path */
if (something[0] == '/') {
@@ -219,18 +235,25 @@ asb_app_find_icon (AsbApp *app,
return asb_app_load_icon (app, tmp, something, error);
}
- /* hicolor apps */
- for (i = 0; sizes[i] != NULL; i++) {
- for (j = 0; supported_ext[j] != NULL; j++) {
- _cleanup_free_ gchar *log;
- _cleanup_free_ gchar *tmp;
- log = g_strdup_printf ("/usr/share/icons/hicolor/%s/apps/%s%s",
- sizes[i],
- something,
- supported_ext[j]);
- tmp = g_build_filename (tmpdir, log, NULL);
- if (g_file_test (tmp, G_FILE_TEST_EXISTS))
- return asb_app_load_icon (app, tmp, log, error);
+ /* icon theme apps */
+ for (k = 0; theme_dirs[k] != NULL; k++) {
+ for (i = 0; sizes[i] != NULL; i++) {
+ for (m = 0; types[m] != NULL; m++) {
+ for (j = 0; supported_ext[j] != NULL; j++) {
+ _cleanup_free_ gchar *log;
+ _cleanup_free_ gchar *tmp;
+ log = g_strdup_printf ("/usr/share/icons/"
+ "%s/%s/%s/%s%s",
+ theme_dirs[k],
+ sizes[i],
+ types[m],
+ something,
+ supported_ext[j]);
+ tmp = g_build_filename (tmpdir, log, NULL);
+ if (g_file_test (tmp, G_FILE_TEST_EXISTS))
+ return asb_app_load_icon (app, tmp, log, error);
+ }
+ }
}
}