summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@blame.services>2021-06-09 01:20:36 +0200
committerDave Davenport <qball@blame.services>2021-06-09 01:20:36 +0200
commit3950204760a5887b4af73a2f731d59d59efbab1a (patch)
tree458d77eb26bdb52af387746b0b0dbd99113560ef
parentaf8e2865c129d79eea15174e810ed04f545fb5e6 (diff)
[DRun] Do not use show-icons options, handle no-icon desktopfile better.
-rw-r--r--source/dialogs/drun.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/source/dialogs/drun.c b/source/dialogs/drun.c
index 2bb12009..b8500f96 100644
--- a/source/dialogs/drun.c
+++ b/source/dialogs/drun.c
@@ -610,12 +610,7 @@ static void read_desktop_file ( DRunModePrivateData *pd, const char *root, const
else {
pd->entry_list[pd->cmd_list_length].comment = NULL;
}
- if ( config.show_icons ) {
- pd->entry_list[pd->cmd_list_length].icon_name = g_key_file_get_locale_string ( kf, DRUN_GROUP_NAME, "Icon", NULL, NULL );
- }
- else{
- pd->entry_list[pd->cmd_list_length].icon_name = NULL;
- }
+ pd->entry_list[pd->cmd_list_length].icon_name = g_key_file_get_locale_string ( kf, DRUN_GROUP_NAME, "Icon", NULL, NULL );
pd->entry_list[pd->cmd_list_length].icon = NULL;
// Keep keyfile around.
@@ -1265,20 +1260,19 @@ static cairo_surface_t *_get_icon ( const Mode *sw, unsigned int selected_line,
}
g_return_val_if_fail ( pd->entry_list != NULL, NULL );
DRunModeEntry *dr = &( pd->entry_list[selected_line] );
- if ( dr->icon_name == NULL ) {
- return NULL;
- }
- if ( dr->icon_fetch_uid > 0 ) {
+ if ( dr->icon_name != NULL ) {
+ if ( dr->icon_fetch_uid > 0 ) {
+ cairo_surface_t *icon = rofi_icon_fetcher_get ( dr->icon_fetch_uid );
+ if ( icon ) {
+ return icon;
+ }
+ return fallback_icon ( pd, height );
+ }
+ dr->icon_fetch_uid = rofi_icon_fetcher_query ( dr->icon_name, height );
cairo_surface_t *icon = rofi_icon_fetcher_get ( dr->icon_fetch_uid );
if ( icon ) {
return icon;
}
- return fallback_icon ( pd, height );
- }
- dr->icon_fetch_uid = rofi_icon_fetcher_query ( dr->icon_name, height );
- cairo_surface_t *icon = rofi_icon_fetcher_get ( dr->icon_fetch_uid );
- if ( icon ) {
- return icon;
}
return fallback_icon ( pd, height );
}