From 56cc94195c26c909d587901af753fc22c919f5cd Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Wed, 31 Aug 2016 09:39:00 +0200 Subject: [PATCH] DRUN: Make name key required even when hidden. (#453) --- source/dialogs/drun.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/source/dialogs/drun.c b/source/dialogs/drun.c index 6034b8fd..4492fda2 100644 --- a/source/dialogs/drun.c +++ b/source/dialogs/drun.c @@ -264,6 +264,14 @@ static void read_desktop_file ( DRunModePrivateData *pd, const char *root, const return; } g_free ( key ); + + // Name key is required. + if ( !g_key_file_has_key ( kf, "Desktop Entry", "Name", NULL ) ) { + g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Invalid DesktopFile: '%s', no 'Name' key present.\n", path ); + g_key_file_free ( kf ); + return; + } + // Skip hidden entries. if ( g_key_file_get_boolean ( kf, "Desktop Entry", "Hidden", NULL ) ) { g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Adding desktop file: %s to disabled list because: Hdden", path ); @@ -284,12 +292,6 @@ static void read_desktop_file ( DRunModePrivateData *pd, const char *root, const pd->disabled_entries_length++; return; } - // Name key is required. - if ( !g_key_file_has_key ( kf, "Desktop Entry", "Name", NULL ) ) { - g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Invalid DesktopFile: '%s', no 'Name' key present.\n", path ); - g_key_file_free ( kf ); - return; - } // We need Exec, don't support DBusActivatable if ( !g_key_file_has_key ( kf, "Desktop Entry", "Exec", NULL ) ) { g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Unsupported DesktopFile: '%s', no 'Exec' key present.\n", path );