Re: [E-devel] [PATCH] Efreet: use eina_list instead of ecore_dlist
Hi, Please find attached an updated patch which sets to NULL the pointer to a list being merged into another list. Regards, -- Albin Tonnerre diff --git a/src/lib/efreet_desktop.c b/src/lib/efreet_desktop.c index 9357add..2dfa357 100644 --- a/src/lib/efreet_desktop.c +++ b/src/lib/efreet_desktop.c @@ -1089,7 +1089,7 @@ efreet_desktop_environment_check(Efreet_Ini *ini) /** * @param desktop: the desktop entry - * @param files: an ecore list of file names to execute, as either absolute paths, + * @param files: an eina list of file names to execute, as either absolute paths, * relative paths, or uris * @param func: a callback to call for each prepared command line * @param data: user data passed to the callback @@ -1105,8 +1105,8 @@ efreet_desktop_command_get(Efreet_Desktop *desktop, Eina_List *files, /** * @param desktop: the desktop entry - * @param files an ecore list of local files, as absolute paths, local paths, or file:// uris (or NULL to get exec string with no files appended) - * @return Returns an ecore list of exec strings + * @param files an eina list of local files, as absolute paths, local paths, or file:// uris (or NULL to get exec string with no files appended) + * @return Returns an eina list of exec strings * @brief Get the command to use to execute a desktop entry * * The returned list and each of its elements must be freed. @@ -1153,7 +1153,7 @@ efreet_desktop_command_local_get(Efreet_Desktop *desktop, Eina_List *files) /** * @param desktop: the desktop entry - * @param files: an ecore list of file names to execute, as either absolute paths, + * @param files: an eina list of file names to execute, as either absolute paths, * relative paths, or uris * @param cb_command: a callback to call for each prepared command line * @param cb_progress: a callback to get progress for the downloads diff --git a/src/lib/efreet_menu.c b/src/lib/efreet_menu.c index 1a77a38..e11336a 100644 --- a/src/lib/efreet_menu.c +++ b/src/lib/efreet_menu.c @@ -41,7 +41,7 @@ struct Efreet_Menu_Internal } name; /** The names for this menu */ Efreet_Desktop *directory; /** The directory */ -Ecore_DList *directories; /** All the directories set in the menu file */ +Eina_List *directories; /** All the directories set in the menu file */ Efreet_Menu_Move *current_move; /** The current move */ @@ -50,7 +50,7 @@ struct Efreet_Menu_Internal Eina_List *app_pool; /** application pool */ Eina_List *applications; /** applications in this menu */ -Ecore_DList *directory_dirs;/** .directory file directories */ +Eina_List *directory_dirs;/** .directory file directories */ Eina_Hash *directory_cache;/** .directory dirs */ Eina_List *moves; /** List of moves to be handled by the menu */ @@ -1001,10 +1001,10 @@ efreet_menu_internal_free(Efreet_Menu_Internal *internal) internal-applications = eina_list_free(internal-applications); -IF_FREE_DLIST(internal-directories); +IF_FREE_LIST(internal-directories, free); IF_FREE_LIST(internal-app_dirs, efreet_menu_app_dir_free); IF_FREE_LIST(internal-app_pool, efreet_menu_desktop_free); -IF_FREE_DLIST(internal-directory_dirs); +IF_FREE_LIST(internal-directory_dirs, free); IF_FREE_HASH(internal-directory_cache); IF_FREE_LIST(internal-moves, efreet_menu_move_free); @@ -1053,10 +1053,10 @@ static int efreet_menu_handle_menu(Efreet_Menu_Internal *internal, Efreet_Xml *xml) { Efreet_Xml *child; +Eina_List *l; int (*cb)(Efreet_Menu_Internal *parent, Efreet_Xml *xml); -ecore_list_last_goto(xml-children); -while ((child = ecore_dlist_previous(xml-children))) +EINA_LIST_REVERSE_FOREACH(xml-children, l, child) { cb = eina_hash_find(efreet_menu_handle_cbs, child-tag); if (cb) @@ -1206,13 +1206,13 @@ efreet_menu_handle_directory_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml) if (!path) return 0; /* we've already got this guy in our list we can skip it */ -if (ecore_list_find(parent-directory_dirs, ECORE_COMPARE_CB(strcmp), path)) +if (eina_list_search_unsorted(parent-directory_dirs, EINA_COMPARE_CB(strcmp), path)) { FREE(path); return 1; } -ecore_dlist_prepend(parent-directory_dirs, path); +parent-directory_dirs = eina_list_prepend(parent-directory_dirs, path); return 1; } @@ -1237,10 +1237,10 @@ efreet_menu_handle_default_directory_dirs(Efreet_Menu_Internal *parent, Efreet_X desktop-directories); EINA_LIST_FOREACH(dirs, l, dir) { -if (ecore_list_find(parent-directory_dirs, ECORE_COMPARE_CB(strcmp), dir)) +if (eina_list_search_unsorted(parent-directory_dirs, EINA_COMPARE_CB(strcmp), dir)) continue; -ecore_dlist_prepend(parent-directory_dirs, strdup(dir)); +
Re: [E-devel] [PATCH] Efreet: use eina_list instead of ecore_dlist
On Thu, Mar 26, 2009 at 5:16 PM, Albin Tonnerre albin.tonne...@gmail.com wrote: Please find attached an updated patch which sets to NULL the pointer to a list being merged into another list. In svn. -- Cedric BAIL -- ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] [PATCH] Efreet: use eina_list instead of ecore_dlist
Hi, The attached patches fix three things: 0001 converts the remaining uses of ecore_dlist to using eina_list 0002 replaces the use of Eina_Compare_Cb with the use of EINA_COMPARE_CB 0003 Allows the e17-specified menu to be chosen as a menu only if STRICT_SPEC is not defined, as it is obviously not conforming to the spec. I tested a bit on my system and everything seems to be working correctly, however I haven't tested it really thoroughly. Comments welcome. Regards, -- Albin Tonnerre diff --git a/src/lib/efreet_desktop.c b/src/lib/efreet_desktop.c index 9357add..2dfa357 100644 --- a/src/lib/efreet_desktop.c +++ b/src/lib/efreet_desktop.c @@ -1089,7 +1089,7 @@ efreet_desktop_environment_check(Efreet_Ini *ini) /** * @param desktop: the desktop entry - * @param files: an ecore list of file names to execute, as either absolute paths, + * @param files: an eina list of file names to execute, as either absolute paths, * relative paths, or uris * @param func: a callback to call for each prepared command line * @param data: user data passed to the callback @@ -1105,8 +1105,8 @@ efreet_desktop_command_get(Efreet_Desktop *desktop, Eina_List *files, /** * @param desktop: the desktop entry - * @param files an ecore list of local files, as absolute paths, local paths, or file:// uris (or NULL to get exec string with no files appended) - * @return Returns an ecore list of exec strings + * @param files an eina list of local files, as absolute paths, local paths, or file:// uris (or NULL to get exec string with no files appended) + * @return Returns an eina list of exec strings * @brief Get the command to use to execute a desktop entry * * The returned list and each of its elements must be freed. @@ -1153,7 +1153,7 @@ efreet_desktop_command_local_get(Efreet_Desktop *desktop, Eina_List *files) /** * @param desktop: the desktop entry - * @param files: an ecore list of file names to execute, as either absolute paths, + * @param files: an eina list of file names to execute, as either absolute paths, * relative paths, or uris * @param cb_command: a callback to call for each prepared command line * @param cb_progress: a callback to get progress for the downloads diff --git a/src/lib/efreet_menu.c b/src/lib/efreet_menu.c index 1a77a38..57c85fa 100644 --- a/src/lib/efreet_menu.c +++ b/src/lib/efreet_menu.c @@ -41,7 +41,7 @@ struct Efreet_Menu_Internal } name; /** The names for this menu */ Efreet_Desktop *directory; /** The directory */ -Ecore_DList *directories; /** All the directories set in the menu file */ +Eina_List *directories; /** All the directories set in the menu file */ Efreet_Menu_Move *current_move; /** The current move */ @@ -50,7 +50,7 @@ struct Efreet_Menu_Internal Eina_List *app_pool; /** application pool */ Eina_List *applications; /** applications in this menu */ -Ecore_DList *directory_dirs;/** .directory file directories */ +Eina_List *directory_dirs;/** .directory file directories */ Eina_Hash *directory_cache;/** .directory dirs */ Eina_List *moves; /** List of moves to be handled by the menu */ @@ -1001,10 +1001,10 @@ efreet_menu_internal_free(Efreet_Menu_Internal *internal) internal-applications = eina_list_free(internal-applications); -IF_FREE_DLIST(internal-directories); +IF_FREE_LIST(internal-directories, free); IF_FREE_LIST(internal-app_dirs, efreet_menu_app_dir_free); IF_FREE_LIST(internal-app_pool, efreet_menu_desktop_free); -IF_FREE_DLIST(internal-directory_dirs); +IF_FREE_LIST(internal-directory_dirs, free); IF_FREE_HASH(internal-directory_cache); IF_FREE_LIST(internal-moves, efreet_menu_move_free); @@ -1053,10 +1053,10 @@ static int efreet_menu_handle_menu(Efreet_Menu_Internal *internal, Efreet_Xml *xml) { Efreet_Xml *child; +Eina_List *l; int (*cb)(Efreet_Menu_Internal *parent, Efreet_Xml *xml); -ecore_list_last_goto(xml-children); -while ((child = ecore_dlist_previous(xml-children))) +EINA_LIST_REVERSE_FOREACH(xml-children, l, child) { cb = eina_hash_find(efreet_menu_handle_cbs, child-tag); if (cb) @@ -1206,13 +1206,13 @@ efreet_menu_handle_directory_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml) if (!path) return 0; /* we've already got this guy in our list we can skip it */ -if (ecore_list_find(parent-directory_dirs, ECORE_COMPARE_CB(strcmp), path)) +if (eina_list_search_unsorted(parent-directory_dirs, EINA_COMPARE_CB(strcmp), path)) { FREE(path); return 1; } -ecore_dlist_prepend(parent-directory_dirs, path); +parent-directory_dirs = eina_list_prepend(parent-directory_dirs, path); return 1; } @@ -1237,10 +1237,10 @@ efreet_menu_handle_default_directory_dirs(Efreet_Menu_Internal *parent, Efreet_X