From f23691cb9eb4b3b5662db6941afbada5c0f7d2ec Mon Sep 17 00:00:00 2001 From: Sebastian Dransfeld Date: Sun, 25 Mar 2007 22:54:28 +0000 Subject: [PATCH] Keep the first element found if there are several with equal properties. SVN revision: 29161 --- legacy/efreet/src/lib/efreet_utils.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/legacy/efreet/src/lib/efreet_utils.c b/legacy/efreet/src/lib/efreet_utils.c index f0018611cd..99101cea35 100644 --- a/legacy/efreet/src/lib/efreet_utils.c +++ b/legacy/efreet/src/lib/efreet_utils.c @@ -425,17 +425,22 @@ _efreet_util_cache_fill(void *data) desktop = efreet_desktop_get(buf); if (!desktop || desktop->type != EFREET_DESKTOP_TYPE_APPLICATION) continue; - ecore_hash_set(desktop_by_file_id, (void *)ecore_string_instance(file_id), desktop); + if (!ecore_hash_get(desktop_by_file_id, file_id)) + ecore_hash_set(desktop_by_file_id, (void *)ecore_string_instance(file_id), + desktop); exec = ecore_file_app_exe_get(desktop->exec); if (exec) { /* TODO: exec can be with and without full path, we should handle that */ - ecore_hash_set(desktop_by_exec, (void *)ecore_string_instance(exec), desktop); + if (!ecore_hash_get(desktop_by_exec, exec)) + ecore_hash_set(desktop_by_exec, (void *)ecore_string_instance(exec), + desktop); free(exec); } - ecore_hash_set(file_id_by_desktop_path, - (void *)ecore_string_instance(desktop->orig_path), - (void *)ecore_string_instance(file_id)); + if (!ecore_hash_get(file_id_by_desktop_path, desktop->orig_path)) + ecore_hash_set(file_id_by_desktop_path, + (void *)ecore_string_instance(desktop->orig_path), + (void *)ecore_string_instance(file_id)); } } if (!file)