Enlightenment CVS committal

Author  : englebass
Project : e17
Module  : libs/efreet

Dir     : e17/libs/efreet/src/lib


Modified Files:
        efreet_utils.c 


Log Message:
Keep the first element found if there are several with equal properties.

===================================================================
RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet_utils.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- efreet_utils.c      25 Mar 2007 21:49:49 -0000      1.16
+++ efreet_utils.c      25 Mar 2007 22:54:28 -0000      1.17
@@ -425,17 +425,22 @@
                 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)



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to