From 7a42b9b076d6b831c89bd0b9e996368c1c95aef3 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 18 Oct 2012 10:30:31 +0200 Subject: [all] use g_list_free() and g_strcmp0 instead of eel functions Was: general: use g_list_free_full() instead of eel functions http://git.gnome.org/browse/nautilus/commit/?id=5e669515fd7f760382e6b7aa1449734a35a2d7f4 . Instead of g_list_free_full(), we use g_list_foreach and g_list_free() to avoid unnecessary glib dependency bump to 2.28 --- libcaja-private/caja-autorun.c | 4 ++-- libcaja-private/caja-bookmark.c | 4 ++-- libcaja-private/caja-clipboard.c | 19 +++++++---------- libcaja-private/caja-customization-data.c | 12 +++++------ libcaja-private/caja-debug-log.c | 4 ++-- libcaja-private/caja-directory-async.c | 22 ++++++++++++------- libcaja-private/caja-directory.c | 19 ++++++++++------- libcaja-private/caja-dnd.c | 7 +++++-- libcaja-private/caja-emblem-utils.c | 4 ++-- libcaja-private/caja-file-changes-queue.c | 16 ++++++++------ libcaja-private/caja-file-dnd.c | 4 ++-- libcaja-private/caja-file-operations.c | 24 ++++++++++++++------- libcaja-private/caja-file-utilities.c | 3 ++- libcaja-private/caja-file.c | 28 ++++++++++++++++--------- libcaja-private/caja-icon-canvas-item.c | 10 +++++---- libcaja-private/caja-icon-container.c | 7 ++++--- libcaja-private/caja-merged-directory.c | 3 ++- libcaja-private/caja-mime-actions.c | 9 +++++--- libcaja-private/caja-mime-application-chooser.c | 8 +++---- libcaja-private/caja-open-with-dialog.c | 4 ++-- libcaja-private/caja-program-choosing.c | 14 +++++++------ libcaja-private/caja-progress-info.c | 10 ++++----- libcaja-private/caja-query.c | 5 ++++- libcaja-private/caja-search-engine-beagle.c | 4 ++-- libcaja-private/caja-search-engine-simple.c | 10 +++++---- libcaja-private/caja-search-engine-tracker.c | 4 ++-- libcaja-private/caja-undostack-manager.c | 25 ++++++++++++++-------- 27 files changed, 166 insertions(+), 117 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-autorun.c b/libcaja-private/caja-autorun.c index 89b8e63d..66534642 100644 --- a/libcaja-private/caja-autorun.c +++ b/libcaja-private/caja-autorun.c @@ -33,7 +33,6 @@ #include #include -#include #include "caja-icon-info.h" #include "caja-global-preferences.h" @@ -652,7 +651,8 @@ caja_autorun_prepare_combo_box (GtkWidget *combo_box, { g_object_unref (default_app_info); } - eel_g_object_list_free (app_info_list); + g_list_foreach (app_info_list, (GFunc) g_object_unref, NULL); + g_list_free(app_info_list); gtk_combo_box_set_model (GTK_COMBO_BOX (combo_box), GTK_TREE_MODEL (list_store)); g_object_unref (G_OBJECT (list_store)); diff --git a/libcaja-private/caja-bookmark.c b/libcaja-private/caja-bookmark.c index e20efd96..48952fbb 100644 --- a/libcaja-private/caja-bookmark.c +++ b/libcaja-private/caja-bookmark.c @@ -29,10 +29,10 @@ #include #include #include -#include #include #include #include +#include #include #include @@ -143,7 +143,7 @@ caja_bookmark_compare_with (gconstpointer a, gconstpointer b) bookmark_a = CAJA_BOOKMARK (a); bookmark_b = CAJA_BOOKMARK (b); - if (eel_strcmp (bookmark_a->details->name, + if (g_strcmp0 (bookmark_a->details->name, bookmark_b->details->name) != 0) { return 1; diff --git a/libcaja-private/caja-clipboard.c b/libcaja-private/caja-clipboard.c index bc06675a..bce5d552 100644 --- a/libcaja-private/caja-clipboard.c +++ b/libcaja-private/caja-clipboard.c @@ -33,7 +33,6 @@ #include #include -#include #include typedef struct _TargetCallbackData TargetCallbackData; @@ -662,31 +661,27 @@ caja_clipboard_clear_if_colliding_uris (GtkWidget *widget, collision = FALSE; data = gtk_clipboard_wait_for_contents (caja_clipboard_get (widget), copied_files_atom); - if (data == NULL) - { + if (data == NULL) { return; } clipboard_item_uris = caja_clipboard_get_uri_list_from_selection_data (data, NULL, copied_files_atom); - for (l = (GList *) item_uris; l; l = l->next) - { + for (l = (GList *) item_uris; l; l = l->next) { if (g_list_find_custom ((GList *) item_uris, l->data, - (GCompareFunc) g_strcmp0)) - { + (GCompareFunc) g_strcmp0)) { collision = TRUE; break; } } - if (collision) - { + if (collision) { gtk_clipboard_clear (caja_clipboard_get (widget)); } - if (clipboard_item_uris) - { - eel_g_list_free_deep (clipboard_item_uris); + if (clipboard_item_uris) { + g_list_foreach (clipboard_item_uris, (GFunc) g_free, NULL); + g_list_free(clipboard_item_uris); } } diff --git a/libcaja-private/caja-customization-data.c b/libcaja-private/caja-customization-data.c index aeeab942..01521d0a 100644 --- a/libcaja-private/caja-customization-data.c +++ b/libcaja-private/caja-customization-data.c @@ -32,10 +32,8 @@ #include #include #include -#include #include #include -#include #include #include #include @@ -260,7 +258,7 @@ caja_customization_data_get_next_element_for_display (CajaCustomizationData *dat label_out); } - is_reset_image = eel_strcmp(g_file_info_get_name (current_file_info), RESET_IMAGE_NAME) == 0; + is_reset_image = g_strcmp0(g_file_info_get_name (current_file_info), RESET_IMAGE_NAME) == 0; *emblem_name = g_strdup (g_file_info_get_name (current_file_info)); @@ -306,8 +304,10 @@ caja_customization_data_destroy (CajaCustomizationData *data) g_object_unref (data->pattern_frame); } - eel_g_object_list_free (data->public_file_list); - eel_g_object_list_free (data->private_file_list); + g_list_foreach(data->public_file_list, (GFunc) g_object_unref, NULL); + g_list_free(data->public_file_list); + g_list_foreach(data->private_file_list, (GFunc) g_object_unref, NULL); + g_list_free(data->private_file_list); if (data->name_map_hash != NULL) { @@ -427,7 +427,7 @@ format_name_for_display (CajaCustomizationData *data, const char* name) { char *formatted_str, *mapped_name; - if (!eel_strcmp(name, RESET_IMAGE_NAME)) + if (!g_strcmp0(name, RESET_IMAGE_NAME)) { return g_strdup (_("Reset")); } diff --git a/libcaja-private/caja-debug-log.c b/libcaja-private/caja-debug-log.c index 89ff6933..1ccfed0b 100644 --- a/libcaja-private/caja-debug-log.c +++ b/libcaja-private/caja-debug-log.c @@ -27,7 +27,6 @@ #include #include #include -#include #include "caja-debug-log.h" #include "caja-file.h" @@ -309,7 +308,8 @@ caja_debug_log_with_file_list (gboolean is_milestone, const char *domain, GList caja_debug_logv (is_milestone, domain, uris, format, args); va_end (args); - eel_g_list_free_deep (uris); + g_list_foreach (uris, (GFunc) g_free, NULL); + g_list_free(uris); } gboolean diff --git a/libcaja-private/caja-directory-async.c b/libcaja-private/caja-directory-async.c index a20d90d7..9694b1b0 100644 --- a/libcaja-private/caja-directory-async.c +++ b/libcaja-private/caja-directory-async.c @@ -34,7 +34,6 @@ #include "caja-link.h" #include "caja-marshal.h" #include -#include #include #include #include @@ -1080,7 +1079,8 @@ dequeue_pending_idle_callback (gpointer callback_data) file->details->got_mime_list = TRUE; file->details->mime_list_is_up_to_date = TRUE; - eel_g_list_free_deep (file->details->mime_list); + g_list_foreach (file->details->mime_list, (GFunc) g_free, NULL); + g_list_free(file->details->mime_list); file->details->mime_list = istr_set_get_as_list (dir_load_state->load_mime_list_hash); @@ -1093,7 +1093,8 @@ dequeue_pending_idle_callback (gpointer callback_data) } drain: - eel_g_object_list_free (pending_file_info); + g_list_foreach (pending_file_info, (GFunc) g_object_unref, NULL); + g_list_free(pending_file_info); /* Get the state machine running again. */ caja_directory_async_state_changed (directory); @@ -1181,7 +1182,8 @@ file_list_cancel (CajaDirectory *directory) if (directory->details->pending_file_info != NULL) { - eel_g_object_list_free (directory->details->pending_file_info); + g_list_foreach (directory->details->pending_file_info, (GFunc) g_object_unref, NULL); + g_list_free(directory->details->pending_file_info); directory->details->pending_file_info = NULL; } @@ -2786,7 +2788,8 @@ count_more_files_callback (GObject *source_object, state); } - eel_g_object_list_free (files); + g_list_foreach (files, (GFunc) g_object_unref, NULL); + g_list_free(files); if (error) { @@ -3011,7 +3014,8 @@ deep_count_state_free (DeepCountState *state) { g_object_unref (state->deep_count_location); } - eel_g_object_list_free (state->deep_count_subdirectories); + g_list_foreach (state->deep_count_subdirectories, (GFunc) g_object_unref, NULL); + g_list_free(state->deep_count_subdirectories); g_array_free (state->seen_deep_count_inodes, TRUE); g_free (state); } @@ -3319,7 +3323,8 @@ mime_list_done (MimeListState *state, gboolean success) file = state->mime_list_file; file->details->mime_list_is_up_to_date = TRUE; - eel_g_list_free_deep (file->details->mime_list); + g_list_foreach(file->details->mime_list, (GFunc) g_free, NULL); + g_list_free(file->details->mime_list); if (success) { file->details->mime_list_failed = TRUE; @@ -4574,7 +4579,8 @@ get_mount_at (GFile *target) g_object_unref (root); } - eel_g_object_list_free (mounts); + g_list_foreach (mounts, (GFunc) g_object_unref, NULL); + g_list_free(mounts); g_object_unref (monitor); diff --git a/libcaja-private/caja-directory.c b/libcaja-private/caja-directory.c index efcfc5ed..38d73794 100644 --- a/libcaja-private/caja-directory.c +++ b/libcaja-private/caja-directory.c @@ -37,8 +37,8 @@ #include "caja-vfs-directory.h" #include #include -#include #include +#include enum { @@ -175,7 +175,8 @@ caja_directory_finalize (GObject *object) if (directory->details->monitor_list != NULL) { g_warning ("destroying a CajaDirectory while it's being monitored"); - eel_g_list_free_deep (directory->details->monitor_list); + g_list_foreach(directory->details->monitor_list, (GFunc) g_free, NULL); + g_list_free(directory->details->monitor_list); } if (directory->details->monitor != NULL) @@ -212,7 +213,8 @@ caja_directory_finalize (GObject *object) g_assert (directory->details->directory_load_in_progress == NULL); g_assert (directory->details->count_in_progress == NULL); g_assert (directory->details->dequeue_pending_idle_id == 0); - eel_g_object_list_free (directory->details->pending_file_info); + g_list_foreach(directory->details->pending_file_info, (GFunc) g_object_unref, NULL); + g_list_free(directory->details->pending_file_info); EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object)); } @@ -758,7 +760,7 @@ caja_directory_find_file_by_internal_filename (CajaDirectory *directory, { CajaFile *result; - if (eel_strcmp (internal_filename, ".") == 0) + if (g_strcmp0 (internal_filename, ".") == 0) { result = caja_directory_get_existing_corresponding_file (directory); if (result != NULL) @@ -1092,7 +1094,8 @@ caja_directory_notify_files_added_by_uri (GList *uris) files = caja_file_list_from_uris (uris); caja_directory_notify_files_added (files); - eel_g_object_list_free (files); + g_list_foreach(files, (GFunc) g_object_unref, NULL); + g_list_free(files); } void @@ -1141,7 +1144,8 @@ caja_directory_notify_files_changed_by_uri (GList *uris) files = caja_file_list_from_uris (uris); caja_directory_notify_files_changed (files); - eel_g_object_list_free (files); + g_list_foreach(files, (GFunc) g_object_unref, NULL); + g_list_free(files); } void @@ -1202,7 +1206,8 @@ caja_directory_notify_files_removed_by_uri (GList *uris) files = caja_file_list_from_uris (uris); caja_directory_notify_files_changed (files); - eel_g_object_list_free (files); + g_list_foreach(files, (GFunc) g_object_unref, NULL); + g_list_free(files); } static void diff --git a/libcaja-private/caja-dnd.c b/libcaja-private/caja-dnd.c index 87617a77..feea5ca8 100644 --- a/libcaja-private/caja-dnd.c +++ b/libcaja-private/caja-dnd.c @@ -129,7 +129,8 @@ caja_drag_uri_array_from_selection_list (const GList *selection_list) uri_list = caja_drag_uri_list_from_selection_list (selection_list); uris = caja_drag_uri_array_from_list (uri_list); - eel_g_list_free_deep (uri_list); + g_list_foreach(uri_list, (GFunc) g_free, NULL); + g_list_free(uri_list); return uris; } @@ -1315,7 +1316,9 @@ slot_proxy_handle_drop (GtkWidget *widget, uri_list, target_uri, gdk_drag_context_get_selected_action (context)); - eel_g_list_free_deep (uri_list); + g_list_foreach(uri_list, (GFunc) g_free, NULL); + g_list_free(uri_list); + } else if (drag_info->info == CAJA_ICON_DND_URI_LIST) { diff --git a/libcaja-private/caja-emblem-utils.c b/libcaja-private/caja-emblem-utils.c index 3c41a016..dd70dbc3 100644 --- a/libcaja-private/caja-emblem-utils.c +++ b/libcaja-private/caja-emblem-utils.c @@ -37,7 +37,6 @@ #include #include -#include #include #include @@ -120,7 +119,8 @@ is_reserved_keyword (const char *keyword) result = g_list_find_custom (available, (char *) icon_name, (GCompareFunc) g_ascii_strcasecmp) != NULL; - eel_g_list_free_deep (available); + g_list_foreach(available, (GFunc) g_free, NULL); + g_list_free(available); g_free (icon_name); return result; } diff --git a/libcaja-private/caja-file-changes-queue.c b/libcaja-private/caja-file-changes-queue.c index b3cd1db0..39cf123e 100644 --- a/libcaja-private/caja-file-changes-queue.c +++ b/libcaja-private/caja-file-changes-queue.c @@ -24,7 +24,6 @@ #include "caja-file-changes-queue.h" #include "caja-directory-notify.h" -#include #ifdef G_THREADS_ENABLED #define MUTEX_LOCK(a) if ((a) != NULL) g_mutex_lock (a) @@ -289,7 +288,8 @@ pairs_list_free (GList *pairs) } /* delete the list and the now empty pair structs */ - eel_g_list_free_deep (pairs); + g_list_foreach(pairs, (GFunc) g_free, NULL); + g_list_free(pairs); } static void @@ -304,7 +304,8 @@ position_set_list_free (GList *list) g_object_unref (item->location); } /* delete the list and the now empty structs */ - eel_g_list_free_deep (list); + g_list_foreach(list, (GFunc) g_free, NULL); + g_list_free(list); } /* go through changes in the change queue, send ones with the same kind @@ -386,7 +387,8 @@ caja_file_changes_consume_changes (gboolean consume_all) { deletions = g_list_reverse (deletions); caja_directory_notify_files_removed (deletions); - eel_g_object_list_free (deletions); + g_list_foreach(deletions, (GFunc) g_object_unref, NULL); + g_list_free(deletions); deletions = NULL; } if (moves != NULL) @@ -400,14 +402,16 @@ caja_file_changes_consume_changes (gboolean consume_all) { additions = g_list_reverse (additions); caja_directory_notify_files_added (additions); - eel_g_object_list_free (additions); + g_list_foreach(additions, (GFunc) g_object_unref, NULL); + g_list_free(additions); additions = NULL; } if (changes != NULL) { changes = g_list_reverse (changes); caja_directory_notify_files_changed (changes); - eel_g_object_list_free (changes); + g_list_foreach(changes, (GFunc) g_object_unref, NULL); + g_list_free(changes); changes = NULL; } if (position_set_requests != NULL) diff --git a/libcaja-private/caja-file-dnd.c b/libcaja-private/caja-file-dnd.c index a44d42f3..2c239643 100644 --- a/libcaja-private/caja-file-dnd.c +++ b/libcaja-private/caja-file-dnd.c @@ -30,7 +30,6 @@ #include "caja-dnd.h" #include "caja-directory.h" #include "caja-file-utilities.h" -#include #include static gboolean @@ -182,5 +181,6 @@ caja_drag_file_receive_dropped_keyword (CajaFile *file, } caja_file_set_keywords (file, keywords); - eel_g_list_free_deep (keywords); + g_list_foreach(keywords, (GFunc) g_free, NULL); + g_list_free(keywords); } diff --git a/libcaja-private/caja-file-operations.c b/libcaja-private/caja-file-operations.c index 24bb4a19..067f52d5 100644 --- a/libcaja-private/caja-file-operations.c +++ b/libcaja-private/caja-file-operations.c @@ -1858,7 +1858,8 @@ delete_job_done (gpointer user_data) job = user_data; - eel_g_object_list_free (job->files); + g_list_foreach(job->files, (GFunc) g_object_unref, NULL); + g_list_free(job->files); if (job->done_callback) { debuting_uris = g_hash_table_new_full (g_file_hash, (GEqualFunc)g_file_equal, g_object_unref, NULL); @@ -2187,7 +2188,8 @@ has_trash_files (GMount *mount) } } - eel_g_object_list_free (dirs); + g_list_foreach(dirs, (GFunc) g_object_unref, NULL); + g_list_free(dirs); return res; } @@ -4460,7 +4462,8 @@ copy_job_done (gpointer user_data) job->done_callback (job->debuting_files, job->done_callback_data); } - eel_g_object_list_free (job->files); + g_list_foreach(job->files, (GFunc) g_object_unref, NULL); + g_list_free(job->files); if (job->destination) { g_object_unref (job->destination); } @@ -4987,7 +4990,8 @@ move_job_done (gpointer user_data) job->done_callback (job->debuting_files, job->done_callback_data); } - eel_g_object_list_free (job->files); + g_list_foreach(job->files, (GFunc) g_object_unref, NULL); + g_list_free(job->files); g_object_unref (job->destination); g_hash_table_unref (job->debuting_files); g_free (job->icon_positions); @@ -5067,7 +5071,8 @@ move_job (GIOSchedulerJob *io_job, &source_info, &transfer_info); aborted: - eel_g_list_free_deep (fallbacks); + g_list_foreach(fallbacks, (GFunc) g_free, NULL); + g_list_free(fallbacks); g_free (dest_fs_id); g_free (dest_fs_type); @@ -5321,7 +5326,8 @@ link_job_done (gpointer user_data) job->done_callback (job->debuting_files, job->done_callback_data); } - eel_g_object_list_free (job->files); + g_list_foreach(job->files, (GFunc) g_object_unref, NULL); + g_list_free(job->files); g_object_unref (job->destination); g_hash_table_unref (job->debuting_files); g_free (job->icon_positions); @@ -5773,7 +5779,8 @@ caja_file_operations_copy_move (const GList *item_uris, done_callback, done_callback_data); } - eel_g_object_list_free (locations); + g_list_foreach(locations, (GFunc) g_object_unref, NULL); + g_list_free(locations); if (dest) { g_object_unref (dest); } @@ -6251,7 +6258,8 @@ empty_trash_job_done (gpointer user_data) job = user_data; - eel_g_object_list_free (job->trash_dirs); + g_list_foreach(job->trash_dirs, (GFunc) g_object_unref, NULL); + g_list_free(job->trash_dirs); if (job->done_callback) { job->done_callback (job->done_callback_data); diff --git a/libcaja-private/caja-file-utilities.c b/libcaja-private/caja-file-utilities.c index 61ad5c47..bfe8321e 100644 --- a/libcaja-private/caja-file-utilities.c +++ b/libcaja-private/caja-file-utilities.c @@ -1428,7 +1428,8 @@ caja_restore_files_from_trash (GList *files, parent_window, NULL, NULL); - eel_g_object_list_free (locations); + g_list_foreach(locations, (GFunc) g_object_unref, NULL); + g_list_free(locations); g_object_unref (original_dir_location); } diff --git a/libcaja-private/caja-file.c b/libcaja-private/caja-file.c index 31863c9c..788eec68 100644 --- a/libcaja-private/caja-file.c +++ b/libcaja-private/caja-file.c @@ -816,11 +816,14 @@ finalize (GObject *object) eel_ref_str_unref (file->details->filesystem_id); - eel_g_list_free_deep (file->details->mime_list); - - eel_g_list_free_deep (file->details->pending_extension_emblems); - eel_g_list_free_deep (file->details->extension_emblems); - eel_g_object_list_free (file->details->pending_info_providers); + g_list_foreach(file->details->mime_list, (GFunc) g_free, NULL); + g_list_free(file->details->mime_list); + g_list_foreach(file->details->pending_extension_emblems, (GFunc) g_free, NULL); + g_list_free(file->details->pending_extension_emblems); + g_list_foreach(file->details->extension_emblems, (GFunc) g_free, NULL); + g_list_free(file->details->extension_emblems); + g_list_foreach(file->details->pending_info_providers, (GFunc) g_object_unref, NULL); + g_list_free(file->details->pending_info_providers); if (file->details->pending_extension_attributes) { g_hash_table_destroy (file->details->pending_extension_attributes); @@ -2994,7 +2997,8 @@ fill_emblem_cache_if_needed (CajaFile *file) /* Zero-terminate so we can tell where the list ends. */ *scanner = 0; - eel_g_list_free_deep (keywords); + g_list_foreach(keywords, (GFunc) g_free, NULL); + g_list_free(keywords); } static int @@ -6601,7 +6605,8 @@ caja_file_get_emblem_icons (CajaFile *file, icons = g_list_prepend (icons, icon); } - eel_g_list_free_deep (keywords); + g_list_foreach(keywords, (GFunc) g_free, NULL); + g_list_free(keywords); return icons; } @@ -6660,7 +6665,8 @@ sort_keyword_list_and_remove_duplicates (GList *keywords) if (strcmp ((const char *) p->data, (const char *) p->next->data) == 0) { duplicate_link = p->next; keywords = g_list_remove_link (keywords, duplicate_link); - eel_g_list_free_deep (duplicate_link); + g_list_foreach(duplicate_link, (GFunc) g_free, NULL); + g_list_free(duplicate_link); } else { p = p->next; } @@ -7554,7 +7560,8 @@ void caja_file_invalidate_extension_info_internal (CajaFile *file) { if (file->details->pending_info_providers) - eel_g_object_list_free (file->details->pending_info_providers); + g_list_foreach(file->details->pending_info_providers, (GFunc) g_object_unref, NULL); + g_list_free(file->details->pending_info_providers); file->details->pending_info_providers = caja_module_get_extensions_for_type (CAJA_TYPE_INFO_PROVIDER); @@ -8376,7 +8383,8 @@ caja_file_invalidate_extension_info (CajaFile *file) void caja_file_info_providers_done (CajaFile *file) { - eel_g_list_free_deep (file->details->extension_emblems); + g_list_foreach(file->details->extension_emblems, (GFunc) g_free, NULL); + g_list_free(file->details->extension_emblems); file->details->extension_emblems = file->details->pending_extension_emblems; file->details->pending_extension_emblems = NULL; diff --git a/libcaja-private/caja-icon-canvas-item.c b/libcaja-private/caja-icon-canvas-item.c index 9f6992cf..bcec72a5 100644 --- a/libcaja-private/caja-icon-canvas-item.c +++ b/libcaja-private/caja-icon-canvas-item.c @@ -327,7 +327,8 @@ caja_icon_canvas_item_finalize (GObject *object) g_object_unref (details->text_util); } - eel_gdk_pixbuf_list_free (details->emblem_pixbufs); + g_list_foreach(details->emblem_pixbufs, (GFunc) g_object_unref, NULL); + g_list_free(details->emblem_pixbufs); g_free (details->editable_text); g_free (details->additional_text); g_free (details->attach_points); @@ -419,7 +420,7 @@ caja_icon_canvas_item_set_property (GObject *object, { case PROP_EDITABLE_TEXT: - if (eel_strcmp (details->editable_text, + if (g_strcmp0 (details->editable_text, g_value_get_string (value)) == 0) { return; @@ -446,7 +447,7 @@ caja_icon_canvas_item_set_property (GObject *object, break; case PROP_ADDITIONAL_TEXT: - if (eel_strcmp (details->additional_text, + if (g_strcmp0 (details->additional_text, g_value_get_string (value)) == 0) { return; @@ -763,7 +764,8 @@ caja_icon_canvas_item_set_emblems (CajaIconCanvasItem *item, /* Take in the new list of emblems. */ eel_gdk_pixbuf_list_ref (emblem_pixbufs); - eel_gdk_pixbuf_list_free (item->details->emblem_pixbufs); + g_list_foreach(item->details->emblem_pixbufs, (GFunc) g_object_unref, NULL); + g_list_free(item->details->emblem_pixbufs); item->details->emblem_pixbufs = g_list_copy (emblem_pixbufs); caja_icon_canvas_item_invalidate_bounds_cache (item); diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index efda5cab..6b2f18e8 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -7775,7 +7775,7 @@ caja_icon_container_update_icon (CajaIconContainer *container, * happened to be typing at that moment. */ if (icon == get_icon_being_renamed (container) && - eel_strcmp (editable_text, + g_strcmp0 (editable_text, caja_icon_canvas_item_get_editable_text (icon->item)) != 0) { end_renaming_mode (container, FALSE); @@ -7795,7 +7795,8 @@ caja_icon_container_update_icon (CajaIconContainer *container, /* Let the pixbufs go. */ g_object_unref (pixbuf); - eel_gdk_pixbuf_list_free (emblem_pixbufs); + g_list_foreach(emblem_pixbufs, (GFunc) g_object_unref, NULL); + g_list_free(emblem_pixbufs); g_free (editable_text); g_free (additional_text); @@ -9678,7 +9679,7 @@ caja_icon_container_set_font (CajaIconContainer *container, { g_return_if_fail (CAJA_IS_ICON_CONTAINER (container)); - if (eel_strcmp (container->details->font, font) == 0) + if (g_strcmp0 (container->details->font, font) == 0) { return; } diff --git a/libcaja-private/caja-merged-directory.c b/libcaja-private/caja-merged-directory.c index 0dc1b10c..a3e2a9b2 100644 --- a/libcaja-private/caja-merged-directory.c +++ b/libcaja-private/caja-merged-directory.c @@ -589,7 +589,8 @@ real_directory_notify_files_removed (CajaDirectory *real_directory) caja_directory_notify_files_removed_by_uri (files); } - eel_g_list_free_deep (files); + g_list_foreach(files, (GFunc) g_free, NULL); + g_list_free(files); } static void diff --git a/libcaja-private/caja-mime-actions.c b/libcaja-private/caja-mime-actions.c index 794c84b0..4668e0ac 100644 --- a/libcaja-private/caja-mime-actions.c +++ b/libcaja-private/caja-mime-actions.c @@ -230,7 +230,8 @@ static void application_launch_parameters_free (ApplicationLaunchParameters *parameters) { g_object_unref (parameters->application); - eel_g_list_free_deep (parameters->uris); + g_list_foreach(parameters->uris, (GFunc) g_free, NULL); + g_list_free(parameters->uris); g_free (parameters); } @@ -512,7 +513,8 @@ caja_mime_has_any_applications_for_file (CajaFile *file) if (apps) { result = TRUE; - eel_g_object_list_free (apps); + g_list_foreach(apps, (GFunc) g_object_unref, NULL); + g_list_free(apps); } else { @@ -733,7 +735,8 @@ trash_or_delete_files (GtkWindow *parent_window, caja_file_operations_trash_or_delete (locations, parent_window, NULL, NULL); - eel_g_object_list_free (locations); + g_list_foreach(locations, (GFunc) g_object_unref, NULL); + g_list_free(locations); } static void diff --git a/libcaja-private/caja-mime-application-chooser.c b/libcaja-private/caja-mime-application-chooser.c index 32767f38..dd8af544 100644 --- a/libcaja-private/caja-mime-application-chooser.c +++ b/libcaja-private/caja-mime-application-chooser.c @@ -32,8 +32,6 @@ #include "caja-signaller.h" #include "caja-file.h" #include -#include -#include #include #include @@ -565,7 +563,8 @@ refresh_model (CajaMimeApplicationChooser *chooser) g_object_unref (default_app); } - eel_g_object_list_free (applications); + g_list_foreach(applications, (GFunc) g_object_unref, NULL); + g_list_free(applications); } static void @@ -673,8 +672,7 @@ set_uri_and_type_for_multiple_files (CajaMimeApplicationChooser *chooser, char *extension_current; extension_current = get_extension_from_file (CAJA_FILE (iter->data)); - if (eel_strcmp (first_extension, extension_current)) - { + if (g_strcmp0 (first_extension, extension_current)) { same_extension = FALSE; g_free (extension_current); break; diff --git a/libcaja-private/caja-open-with-dialog.c b/libcaja-private/caja-open-with-dialog.c index 93e376c9..50ca03ef 100644 --- a/libcaja-private/caja-open-with-dialog.c +++ b/libcaja-private/caja-open-with-dialog.c @@ -29,7 +29,6 @@ #include "caja-open-with-dialog.h" #include "caja-signaller.h" -#include #include #include @@ -291,7 +290,8 @@ add_or_find_application (CajaOpenWithDialog *dialog) if (applications != NULL) { - eel_g_object_list_free (applications); + g_list_foreach(applications, (GFunc) g_object_unref, NULL); + g_list_free(applications); } } diff --git a/libcaja-private/caja-program-choosing.c b/libcaja-private/caja-program-choosing.c index 56d6e8eb..f7b3fa42 100644 --- a/libcaja-private/caja-program-choosing.c +++ b/libcaja-private/caja-program-choosing.c @@ -31,10 +31,8 @@ #include "caja-icon-info.h" #include "caja-recent.h" #include "caja-desktop-icon-file.h" -#include #include #include -#include #include #include #include @@ -165,7 +163,8 @@ caja_launch_application (GAppInfo *application, uris = g_list_reverse (uris); caja_launch_application_by_uri (application, uris, parent_window); - eel_g_list_free_deep (uris); + g_list_foreach(uris, (GFunc) g_free, NULL); + g_list_free(uris); } void @@ -274,7 +273,8 @@ caja_launch_application_by_uri (GAppInfo *application, } } - eel_g_object_list_free (locations); + g_list_foreach(locations, (GFunc) g_object_unref, NULL); + g_list_free(locations); } /** @@ -450,7 +450,8 @@ caja_launch_desktop_file (GdkScreen *screen, " drop them again."), parent_window); - eel_g_object_list_free (files); + g_list_foreach(files, (GFunc) g_object_unref, NULL); + g_list_free(files); g_object_unref (app_info); return; } @@ -502,7 +503,8 @@ caja_launch_desktop_file (GdkScreen *screen, g_free (message); } - eel_g_object_list_free (files); + g_list_foreach(files, (GFunc) g_object_unref, NULL); + g_list_free(files); g_object_unref (context); g_object_unref (app_info); } diff --git a/libcaja-private/caja-progress-info.c b/libcaja-private/caja-progress-info.c index b547ead8..789b5de0 100644 --- a/libcaja-private/caja-progress-info.c +++ b/libcaja-private/caja-progress-info.c @@ -26,9 +26,9 @@ #include #include #include -#include #include #include "caja-progress-info.h" +#include enum { @@ -800,7 +800,7 @@ caja_progress_info_take_status (CajaProgressInfo *info, { G_LOCK (progress_info); - if (eel_strcmp (info->status, status) != 0) + if (g_strcmp0 (info->status, status) != 0) { g_free (info->status); info->status = status; @@ -822,7 +822,7 @@ caja_progress_info_set_status (CajaProgressInfo *info, { G_LOCK (progress_info); - if (eel_strcmp (info->status, status) != 0) + if (g_strcmp0 (info->status, status) != 0) { g_free (info->status); info->status = g_strdup (status); @@ -841,7 +841,7 @@ caja_progress_info_take_details (CajaProgressInfo *info, { G_LOCK (progress_info); - if (eel_strcmp (info->details, details) != 0) + if (g_strcmp0 (info->details, details) != 0) { g_free (info->details); info->details = details; @@ -863,7 +863,7 @@ caja_progress_info_set_details (CajaProgressInfo *info, { G_LOCK (progress_info); - if (eel_strcmp (info->details, details) != 0) + if (g_strcmp0 (info->details, details) != 0) { g_free (info->details); info->details = g_strdup (details); diff --git a/libcaja-private/caja-query.c b/libcaja-private/caja-query.c index 42804eda..9c6044af 100644 --- a/libcaja-private/caja-query.c +++ b/libcaja-private/caja-query.c @@ -118,7 +118,10 @@ caja_query_get_mime_types (CajaQuery *query) void caja_query_set_mime_types (CajaQuery *query, GList *mime_types) { - eel_g_list_free_deep (query->details->mime_types); + g_list_foreach(query->details->mime_types, (GFunc) g_free, NULL); + g_list_free(query->details->mime_types); + g_list_foreach(query->details->mime_types, (GFunc) g_free, NULL); + g_list_free(query->details->mime_types); query->details->mime_types = eel_g_str_list_copy (mime_types); } diff --git a/libcaja-private/caja-search-engine-beagle.c b/libcaja-private/caja-search-engine-beagle.c index 0a2c34ff..6e59b060 100644 --- a/libcaja-private/caja-search-engine-beagle.c +++ b/libcaja-private/caja-search-engine-beagle.c @@ -25,7 +25,6 @@ #include "caja-search-engine-beagle.h" #include -#include #include typedef struct _BeagleHit BeagleHit; @@ -342,7 +341,8 @@ caja_search_engine_beagle_start (CajaSearchEngine *engine) /* These must live during the lifetime of the query */ g_free (text); - eel_g_list_free_deep (mimetypes); + g_list_foreach(mimetypes, (GFunc) g_free, NULL); + g_list_free(mimetypes); } static void diff --git a/libcaja-private/caja-search-engine-simple.c b/libcaja-private/caja-search-engine-simple.c index 5e906334..cf50497f 100644 --- a/libcaja-private/caja-search-engine-simple.c +++ b/libcaja-private/caja-search-engine-simple.c @@ -28,7 +28,6 @@ #include #include -#include #include #define BATCH_SIZE 500 @@ -138,8 +137,10 @@ search_thread_data_free (SearchThreadData *data) g_hash_table_destroy (data->visited); g_object_unref (data->cancellable); g_strfreev (data->words); - eel_g_list_free_deep (data->mime_types); - eel_g_list_free_deep (data->uri_hits); + g_list_foreach(data->mime_types, (GFunc) g_free, NULL); + g_list_free(data->mime_types); + g_list_foreach(data->uri_hits, (GFunc) g_free, NULL); + g_list_free(data->uri_hits); g_free (data); } @@ -181,7 +182,8 @@ search_thread_add_hits_idle (gpointer user_data) hits->uris); } - eel_g_list_free_deep (hits->uris); + g_list_foreach(hits->uris, (GFunc) g_free, NULL); + g_list_free(hits->uris); g_free (hits); return FALSE; diff --git a/libcaja-private/caja-search-engine-tracker.c b/libcaja-private/caja-search-engine-tracker.c index ea56a924..e47af045 100644 --- a/libcaja-private/caja-search-engine-tracker.c +++ b/libcaja-private/caja-search-engine-tracker.c @@ -24,7 +24,6 @@ #include #include "caja-search-engine-tracker.h" #include -#include #include #include @@ -462,7 +461,8 @@ caja_search_engine_tracker_start (CajaSearchEngine *engine) tracker->details->query_pending = TRUE; g_free (search_text); - eel_g_list_free_deep (mimetypes); + g_list_foreach(mimetypes, (GFunc) g_free, NULL); + g_list_free(mimetypes); } static void diff --git a/libcaja-private/caja-undostack-manager.c b/libcaja-private/caja-undostack-manager.c index 465e35e1..0a19934e 100644 --- a/libcaja-private/caja-undostack-manager.c +++ b/libcaja-private/caja-undostack-manager.c @@ -33,7 +33,6 @@ #include #include #include -#include /* ***************************************************************** Private fields @@ -432,7 +431,8 @@ caja_undostack_manager_redo (CajaUndoStackManager * manager, uris = construct_gfile_list (action->sources, action->src_dir); caja_file_operations_copy (uris, NULL, action->dest_dir, NULL, undo_redo_done_transfer_callback, action); - eel_g_object_list_free (uris); + g_list_foreach(uris, (GFunc) g_object_unref, NULL); + g_list_free(uris); break; case CAJA_UNDOSTACK_CREATEFILEFROMTEMPLATE: puri = get_uri_parent (action->target_uri); @@ -448,14 +448,16 @@ caja_undostack_manager_redo (CajaUndoStackManager * manager, uris = construct_gfile_list (action->sources, action->src_dir); caja_file_operations_duplicate (uris, NULL, NULL, undo_redo_done_transfer_callback, action); - eel_g_object_list_free (uris); + g_list_foreach(uris, (GFunc) g_object_unref, NULL); + g_list_free(uris); break; case CAJA_UNDOSTACK_RESTOREFROMTRASH: case CAJA_UNDOSTACK_MOVE: uris = construct_gfile_list (action->sources, action->src_dir); caja_file_operations_move (uris, NULL, action->dest_dir, NULL, undo_redo_done_transfer_callback, action); - eel_g_object_list_free (uris); + g_list_foreach(uris, (GFunc) g_object_unref, NULL); + g_list_free(uris); break; case CAJA_UNDOSTACK_RENAME: new_name = get_uri_basename (action->new_uri); @@ -489,14 +491,16 @@ caja_undostack_manager_redo (CajaUndoStackManager * manager, caja_file_operations_trash_or_delete (uris, NULL, undo_redo_done_delete_callback, action); g_list_free (uri_to_trash); - eel_g_object_list_free (uris); + g_list_foreach(uris, (GFunc) g_object_unref, NULL); + g_list_free(uris); } break; case CAJA_UNDOSTACK_CREATELINK: uris = construct_gfile_list (action->sources, action->src_dir); caja_file_operations_link (uris, NULL, action->dest_dir, NULL, undo_redo_done_transfer_callback, action); - eel_g_object_list_free (uris); + g_list_foreach(uris, (GFunc) g_object_unref, NULL); + g_list_free(uris); break; case CAJA_UNDOSTACK_SETPERMISSIONS: file = caja_file_get_by_uri (action->target_uri); @@ -579,7 +583,8 @@ caja_undostack_manager_undo (CajaUndoStackManager * manager, if (priv->confirm_delete) { caja_file_operations_delete (uris, NULL, undo_redo_done_delete_callback, action); - eel_g_object_list_free (uris); + g_list_foreach(uris, (GFunc) g_object_unref, NULL); + g_list_free(uris); } else { /* We skip the confirmation message */ @@ -600,7 +605,8 @@ caja_undostack_manager_undo (CajaUndoStackManager * manager, uris = construct_gfile_list (action->destinations, action->dest_dir); caja_file_operations_trash_or_delete (uris, NULL, undo_redo_done_delete_callback, action); - eel_g_object_list_free (uris); + g_list_foreach(uris, (GFunc) g_object_unref, NULL); + g_list_free(uris); break; case CAJA_UNDOSTACK_MOVETOTRASH: files_to_restore = retrieve_files_to_restore (action->trashed); @@ -630,7 +636,8 @@ caja_undostack_manager_undo (CajaUndoStackManager * manager, uris = construct_gfile_list (action->destinations, action->dest_dir); caja_file_operations_move (uris, NULL, action->src_dir, NULL, undo_redo_done_transfer_callback, action); - eel_g_object_list_free (uris); + g_list_foreach(uris, (GFunc) g_object_unref, NULL); + g_list_free(uris); break; case CAJA_UNDOSTACK_RENAME: new_name = get_uri_basename (action->old_uri); -- cgit v1.2.1