summaryrefslogtreecommitdiff
path: root/src/file-manager
diff options
context:
space:
mode:
authorJasmine Hassan <[email protected]>2012-10-18 10:30:31 +0200
committerJasmine Hassan <[email protected]>2012-11-16 09:49:19 +0200
commit7a42b9b076d6b831c89bd0b9e996368c1c95aef3 (patch)
treee878419f312aa059effcd796b11b7f84125e7ad2 /src/file-manager
parentdecb73c787a2709f977305a4a6da052227d7b37d (diff)
downloadcaja-7a42b9b076d6b831c89bd0b9e996368c1c95aef3.tar.bz2
caja-7a42b9b076d6b831c89bd0b9e996368c1c95aef3.tar.xz
[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
Diffstat (limited to 'src/file-manager')
-rw-r--r--src/file-manager/fm-directory-view.c38
-rw-r--r--src/file-manager/fm-list-model.c11
-rw-r--r--src/file-manager/fm-list-view.c6
-rw-r--r--src/file-manager/fm-properties-window.c35
-rw-r--r--src/file-manager/fm-tree-model.c4
-rw-r--r--src/file-manager/fm-tree-view.c11
6 files changed, 66 insertions, 39 deletions
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index a4119ec4..c40a40ba 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -1025,7 +1025,8 @@ delete_selected_files (FMDirectoryView *view)
caja_file_operations_delete (locations, fm_directory_view_get_containing_window (view), NULL, NULL);
- eel_g_object_list_free (locations);
+ g_list_foreach(locations, (GFunc) g_object_unref, NULL);
+ g_list_free(locations);
caja_file_list_free (selection);
}
@@ -1934,7 +1935,8 @@ fm_directory_view_set_selection_locations (CajaView *caja_view,
/* If we are still loading, set the list of pending URIs instead.
* done_loading() will eventually select the pending URIs and reveal them.
*/
- eel_g_object_list_free (view->details->pending_locations_selected);
+ g_list_foreach(view->details->pending_locations_selected, (GFunc) g_object_unref, NULL);
+ g_list_free(view->details->pending_locations_selected);
view->details->pending_locations_selected =
eel_g_object_list_copy (selection_locations);
}
@@ -2548,7 +2550,8 @@ done_loading (FMDirectoryView *view,
fm_directory_view_reveal_selection (view);
}
}
- eel_g_object_list_free (locations_selected);
+ g_list_foreach(locations_selected, (GFunc) g_object_unref, NULL);
+ g_list_free(locations_selected);
fm_directory_view_display_selection_info (view);
}
@@ -3790,7 +3793,8 @@ fm_directory_view_create_links_for_files (FMDirectoryView *view, GList *files,
caja_file_operations_copy_move (uris, relative_item_points, dir_uri, GDK_ACTION_LINK,
GTK_WIDGET (view), copy_move_done_callback, copy_move_done_data);
g_free (dir_uri);
- eel_g_list_free_deep (uris);
+ g_list_foreach(uris, (GFunc) g_free, NULL);
+ g_list_free(uris);
}
static void
@@ -3822,7 +3826,8 @@ fm_directory_view_duplicate_selection (FMDirectoryView *view, GList *files,
copy_move_done_data = pre_copy_move (view);
caja_file_operations_copy_move (uris, relative_item_points, NULL, GDK_ACTION_COPY,
GTK_WIDGET (view), copy_move_done_callback, copy_move_done_data);
- eel_g_list_free_deep (uris);
+ g_list_foreach(uris, (GFunc) g_free, NULL);
+ g_list_free(uris);
}
/* special_link_in_selection
@@ -3926,7 +3931,8 @@ trash_or_delete_files (GtkWindow *parent_window,
parent_window,
(CajaDeleteCallback) trash_or_delete_done_cb,
view);
- eel_g_object_list_free (locations);
+ g_list_foreach(locations, (GFunc) g_object_unref, NULL);
+ g_list_free(locations);
}
static gboolean
@@ -4675,7 +4681,8 @@ reset_open_with_menu (FMDirectoryView *view, GList *selection)
index,
menu_path, popup_path, submenu_visible);
}
- eel_g_object_list_free (applications);
+ g_list_foreach(applications, (GFunc) g_object_unref, NULL);
+ g_list_free(applications);
if (default_app != NULL) {
g_object_unref (default_app);
}
@@ -5970,7 +5977,8 @@ move_copy_selection_to_location (FMDirectoryView *view,
0, 0,
view);
- eel_g_list_free_deep (uris);
+ g_list_foreach(uris, (GFunc) g_free, NULL);
+ g_list_free(uris);
caja_file_list_free (selection);
}
@@ -6110,7 +6118,10 @@ paste_clipboard_data (FMDirectoryView *view,
gtk_clipboard_clear (caja_clipboard_get (GTK_WIDGET (view)));
}
- eel_g_list_free_deep (item_uris);
+ g_list_foreach(item_uris, (GFunc) g_free, NULL);
+ g_list_free(item_uris);
+ g_list_foreach(item_uris, (GFunc) g_free, NULL);
+ g_list_free(item_uris);
}
}
@@ -7104,7 +7115,8 @@ action_location_delete_callback (GtkAction *action,
caja_file_operations_delete (files, fm_directory_view_get_containing_window (view),
NULL, NULL);
- eel_g_object_list_free (files);
+ g_list_foreach(files, (GFunc) g_object_unref, NULL);
+ g_list_free(files);
}
static void
@@ -9787,7 +9799,8 @@ fm_directory_view_stop (FMDirectoryView *view)
view->details->old_added_files = NULL;
file_and_directory_list_free (view->details->old_changed_files);
view->details->old_changed_files = NULL;
- eel_g_object_list_free (view->details->pending_locations_selected);
+ g_list_foreach(view->details->pending_locations_selected, (GFunc) g_object_unref, NULL);
+ g_list_free(view->details->pending_locations_selected);
view->details->pending_locations_selected = NULL;
if (view->details->model != NULL) {
@@ -10565,7 +10578,8 @@ fm_directory_view_handle_uri_list_drop (FMDirectoryView *view,
target_uri != NULL ? target_uri : container_uri,
action, x, y, view);
- eel_g_list_free_deep (real_uri_list);
+ g_list_foreach(real_uri_list, (GFunc) g_free, NULL);
+ g_list_free(real_uri_list);
if (points != NULL)
g_array_free (points, TRUE);
diff --git a/src/file-manager/fm-list-model.c b/src/file-manager/fm-list-model.c
index b814a313..f6ba0168 100644
--- a/src/file-manager/fm-list-model.c
+++ b/src/file-manager/fm-list-model.c
@@ -29,8 +29,6 @@
#include <libegg/eggtreemultidnd.h>
#include <string.h>
-#include <eel/eel-gtk-macros.h>
-#include <eel/eel-glib-extensions.h>
#include <eel/eel-gdk-pixbuf-extensions.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
@@ -373,7 +371,8 @@ fm_list_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, int column
g_object_unref (emblem);
}
- eel_g_object_list_free (emblem_icons);
+ g_list_foreach (emblem_icons, (GFunc) g_object_unref, NULL);
+ g_list_free(emblem_icons);
g_object_unref (gicon);
gicon = emblemed_icon;
@@ -679,7 +678,8 @@ fm_list_model_get_first_iter_for_file (FMListModel *model,
res = TRUE;
*iter = *(GtkTreeIter *)list->data;
}
- eel_g_list_free_deep (list);
+ g_list_foreach(list, (GFunc) g_free, NULL);
+ g_list_free(list);
return res;
}
@@ -1806,7 +1806,8 @@ refresh_row (gpointer data,
gtk_tree_path_free (path);
}
- eel_g_list_free_deep (iters);
+ g_list_foreach(iters, (GFunc) g_free, NULL);
+ g_list_free(iters);
}
void
diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c
index e9fdd88b..f487c333 100644
--- a/src/file-manager/fm-list-view.c
+++ b/src/file-manager/fm-list-view.c
@@ -2325,7 +2325,8 @@ fm_list_view_set_selection (FMDirectoryView *view, GList *selection)
gtk_tree_selection_select_iter (tree_selection,
(GtkTreeIter *)l->data);
}
- eel_g_list_free_deep (iters);
+ g_list_foreach(iters, (GFunc) g_free, NULL);
+ g_list_free(iters);
}
g_signal_handlers_unblock_by_func (tree_selection, list_selection_changed_callback, view);
@@ -2362,7 +2363,8 @@ fm_list_view_invert_selection (FMDirectoryView *view)
gtk_tree_selection_unselect_iter (tree_selection,
(GtkTreeIter *)l->data);
}
- eel_g_list_free_deep (iters);
+ g_list_foreach(iters, (GFunc) g_free, NULL);
+ g_list_free(iters);
}
g_list_free (selection);
diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c
index ea07b1c4..4a7b7c54 100644
--- a/src/file-manager/fm-properties-window.c
+++ b/src/file-manager/fm-properties-window.c
@@ -37,7 +37,6 @@
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-labeled-image.h>
#include <eel/eel-stock-dialogs.h>
-#include <eel/eel-string.h>
#include <eel/eel-vfs-extensions.h>
#include <eel/eel-wrap-table.h>
#include <gtk/gtk.h>
@@ -700,7 +699,7 @@ update_name_field (FMPropertiesWindow *window)
set_name_field (window, original_name, current_name);
if (original_name == NULL ||
- eel_strcmp (original_name, current_name) != 0) {
+ g_strcmp0 (original_name, current_name) != 0) {
g_object_set_data_full (G_OBJECT (window->details->name_field),
"original_name",
current_name,
@@ -842,7 +841,8 @@ file_has_keyword (CajaFile *file, const char *keyword)
keywords = caja_file_get_keywords (file);
word = g_list_find_custom (keywords, keyword, (GCompareFunc) strcmp);
- eel_g_list_free_deep (keywords);
+ g_list_foreach(keywords, (GFunc) g_free, NULL);
+ g_list_free(keywords);
return (word != NULL);
}
@@ -932,7 +932,8 @@ emblem_button_toggled (GtkToggleButton *button,
keywords = g_list_prepend (keywords, g_strdup (name));
}
caja_file_set_keywords (file, keywords);
- eel_g_list_free_deep (keywords);
+ g_list_foreach(keywords, (GFunc) g_free, NULL);
+ g_list_free(keywords);
}
for (l = files_off; l != NULL; l = l->next) {
@@ -945,10 +946,12 @@ emblem_button_toggled (GtkToggleButton *button,
word = g_list_find_custom (keywords, name, (GCompareFunc)strcmp);
if (word) {
keywords = g_list_remove_link (keywords, word);
- eel_g_list_free_deep (word);
+ g_list_foreach(word, (GFunc) g_free, NULL);
+ g_list_free(word);
}
caja_file_set_keywords (file, keywords);
- eel_g_list_free_deep (keywords);
+ g_list_foreach(keywords, (GFunc) g_free, NULL);
+ g_list_free(keywords);
}
g_list_free (files_on);
@@ -1204,7 +1207,8 @@ properties_window_update (FMPropertiesWindow *window,
refresh_extension_pages (window);
}
- eel_g_list_free_deep (window->details->mime_list);
+ g_list_foreach(window->details->mime_list, (GFunc) g_free, NULL);
+ g_list_free(window->details->mime_list);
window->details->mime_list = mime_list;
}
}
@@ -1813,7 +1817,8 @@ synch_groups_combo_box (GtkComboBox *combo_box, CajaFile *file)
gtk_combo_box_set_active (combo_box, current_group_index);
g_free (current_group_name);
- eel_g_list_free_deep (groups);
+ g_list_foreach(groups, (GFunc) g_free, NULL);
+ g_list_free(groups);
}
static gboolean
@@ -2168,7 +2173,8 @@ synch_user_menu (GtkComboBox *combo_box, CajaFile *file)
gtk_combo_box_set_active (combo_box, owner_index);
g_free (owner_name);
- eel_g_list_free_deep (users);
+ g_list_foreach(users, (GFunc) g_free, NULL);
+ g_list_free(users);
}
static GtkComboBox*
@@ -3424,7 +3430,7 @@ get_initial_emblems (GList *files)
ret = g_hash_table_new_full (g_direct_hash,
g_direct_equal,
NULL,
- (GDestroyNotify)eel_g_list_free_deep);
+ (GFunc) g_free);
for (l = files; l != NULL; l = l->next) {
CajaFile *file;
@@ -3563,7 +3569,8 @@ create_emblems_page (FMPropertiesWindow *window)
gtk_container_add (GTK_CONTAINER (emblems_table), button);
}
- eel_g_list_free_deep (icons);
+ g_list_foreach(icons, (GFunc) g_free, NULL);
+ g_list_free(icons);
gtk_widget_show_all (emblems_table);
}
@@ -5047,7 +5054,8 @@ get_pending_key (GList *file_list)
g_string_append (key, ";");
}
- eel_g_list_free_deep (uris);
+ g_list_foreach(uris, (GFunc) g_free, NULL);
+ g_list_free(uris);
ret = key->str;
g_string_free (key, FALSE);
@@ -5620,7 +5628,8 @@ real_finalize (GObject *object)
window = FM_PROPERTIES_WINDOW (object);
- eel_g_list_free_deep (window->details->mime_list);
+ g_list_foreach(window->details->mime_list, (GFunc) g_free, NULL);
+ g_list_free(window->details->mime_list);
g_free (window->details->pending_name);
g_free (window->details);
diff --git a/src/file-manager/fm-tree-model.c b/src/file-manager/fm-tree-model.c
index 3a3e3604..3423e2d1 100644
--- a/src/file-manager/fm-tree-model.c
+++ b/src/file-manager/fm-tree-model.c
@@ -29,7 +29,6 @@
#include <config.h>
#include "fm-tree-model.h"
-#include <eel/eel-glib-extensions.h>
#include <eel/eel-gdk-pixbuf-extensions.h>
#include <glib/gi18n.h>
#include <libcaja-private/caja-directory.h>
@@ -320,7 +319,8 @@ get_menu_icon_for_file (TreeNode *node,
}
}
- eel_g_object_list_free (emblem_icons);
+ g_list_foreach (emblem_icons, (GFunc) g_object_unref, NULL);
+ g_list_free(emblem_icons);
info = caja_icon_info_lookup (gicon, size);
retval = caja_icon_info_get_pixbuf_nodefault_at_size (info, size);
diff --git a/src/file-manager/fm-tree-view.c b/src/file-manager/fm-tree-view.c
index d673c70b..37559f53 100644
--- a/src/file-manager/fm-tree-view.c
+++ b/src/file-manager/fm-tree-view.c
@@ -35,9 +35,7 @@
#include "fm-tree-model.h"
#include "fm-properties-window.h"
#include <string.h>
-#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
-#include <eel/eel-stock-dialogs.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <gio/gio.h>
@@ -1061,7 +1059,8 @@ paste_clipboard_data (FMTreeView *view,
gtk_clipboard_clear (caja_clipboard_get (GTK_WIDGET (view)));
}
- eel_g_list_free_deep (item_uris);
+ g_list_foreach(item_uris, (GFunc) g_free, NULL);
+ g_list_free(item_uris);
}
}
@@ -1124,7 +1123,8 @@ fm_tree_view_trash_cb (GtkWidget *menu_item,
caja_file_operations_trash_or_delete (list,
fm_tree_view_get_containing_window (view),
NULL, NULL);
- eel_g_object_list_free (list);
+ g_list_foreach(list, (GFunc) g_object_unref, NULL);
+ g_list_free(list);
}
static void
@@ -1142,7 +1142,8 @@ fm_tree_view_delete_cb (GtkWidget *menu_item,
caja_file_get_location (view->details->popup_file));
caja_file_operations_delete (location_list, fm_tree_view_get_containing_window (view), NULL, NULL);
- eel_g_object_list_free (location_list);
+ g_list_foreach(location_list, (GFunc) g_object_unref, NULL);
+ g_list_free(location_list);
}
static void