Skip to content

Commit a6e96b4

Browse files
committed
Handle missing Icon= in .desktop file better
...by omitting the icon attribute rather than outputting icon="(null)" Helped-by: @Consolatis
1 parent ebb8240 commit a6e96b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ print_app_to_buffer(struct app *app, GString *submenu)
9191

9292
g_string_append_printf(submenu, " <item label=\"%s\"",
9393
app->name_localized ? app->name_localized : app->name);
94-
if (show_icons) {
94+
if (show_icons && app->icon) {
9595
g_string_append_printf(submenu, " icon=\"%s\"", app->icon);
9696
}
9797
g_string_append_printf(submenu, ">\n");
@@ -207,7 +207,7 @@ print_menu(GList *dirs, GList *apps)
207207
}
208208

209209
printf(" <menu id=\"%s\" label=\"%s\"", dir->name, dir->name_localized ? : dir->name);
210-
if (show_icons) {
210+
if (show_icons && dir->icon) {
211211
printf(" icon=\"%s\"", dir->icon);
212212
}
213213
printf(">\n");

0 commit comments

Comments
 (0)