From 856ac5d821a5cd1da2824af39c3574064f1815ea Mon Sep 17 00:00:00 2001 From: o9000 Date: Mon, 7 Mar 2016 22:37:32 +0100 Subject: [PATCH] Use application-x-executable for unparseable desktop entries (issue #570) --- src/launcher/icon-theme-common.c | 3 +++ src/tint2conf/properties.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/launcher/icon-theme-common.c b/src/launcher/icon-theme-common.c index 57c62c5..9035be0 100644 --- a/src/launcher/icon-theme-common.c +++ b/src/launcher/icon-theme-common.c @@ -711,6 +711,9 @@ char *get_icon_path_from_cache(IconThemeWrapper *wrapper, const char *icon_name, return NULL; } + if (!g_file_test(value, G_FILE_TEST_EXISTS)) + return NULL; + // fprintf(stderr, "Icon path found in cache: theme = %s, icon = %s, size = %d, path = %s\n", wrapper->icon_theme_name, icon_name, size, value); return strdup(value); diff --git a/src/tint2conf/properties.c b/src/tint2conf/properties.c index bd765b5..d4d31c2 100644 --- a/src/tint2conf/properties.c +++ b/src/tint2conf/properties.c @@ -2332,14 +2332,17 @@ void load_desktop_file(const char *file, gboolean selected) g_object_unref(pixbuf); } else { printf("Could not load %s\n", file); + GdkPixbuf *pixbuf = load_icon(DEFAULT_ICON); GtkTreeIter iter; gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, - appsColIcon, NULL, + appsColIcon, pixbuf, appsColText, g_strdup(file), appsColPath, g_strdup(file), appsColIconName, g_strdup(""), -1); + if (pixbuf) + g_object_unref(pixbuf); } free_desktop_entry(&entry); }