diff options
author | monsta <[email protected]> | 2016-02-08 10:48:43 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2016-02-08 10:57:20 +0300 |
commit | 883201a49341d588f5a6ffe2b7fd54676eb71019 (patch) | |
tree | e890e8b3003425f369e44d18c44f6ea9f14ceb23 | |
parent | 35a84bbc4f81914136c894dd55630f21acbeb54a (diff) | |
download | caja-883201a49341d588f5a6ffe2b7fd54676eb71019.tar.bz2 caja-883201a49341d588f5a6ffe2b7fd54676eb71019.tar.xz |
use g_hash_table_remove_all and get rid of some callbacks
taken from
https://git.gnome.org/browse/nautilus/commit/?id=564264cc6cc6fa44390791248019547a7133d70d
and applied in some other places as well
-rw-r--r-- | libcaja-private/caja-desktop-directory.c | 4 | ||||
-rw-r--r-- | libcaja-private/caja-directory-async.c | 8 | ||||
-rw-r--r-- | src/file-manager/fm-directory-view.c | 8 |
3 files changed, 4 insertions, 16 deletions
diff --git a/libcaja-private/caja-desktop-directory.c b/libcaja-private/caja-desktop-directory.c index bb03f06a..de998cd2 100644 --- a/libcaja-private/caja-desktop-directory.c +++ b/libcaja-private/caja-desktop-directory.c @@ -480,8 +480,8 @@ update_desktop_directory (CajaDesktopDirectory *desktop) real_directory = desktop->details->real_directory; if (real_directory != NULL) { - g_hash_table_foreach_remove (desktop->details->callbacks, (GHRFunc) gtk_true, NULL); - g_hash_table_foreach_remove (desktop->details->monitors, (GHRFunc) gtk_true, NULL); + g_hash_table_remove_all (desktop->details->callbacks); + g_hash_table_remove_all (desktop->details->monitors); g_signal_handlers_disconnect_by_func (real_directory, done_loading_callback, desktop); g_signal_handlers_disconnect_by_func (real_directory, forward_files_added_cover, desktop); diff --git a/libcaja-private/caja-directory-async.c b/libcaja-private/caja-directory-async.c index a795c161..5bab5858 100644 --- a/libcaja-private/caja-directory-async.c +++ b/libcaja-private/caja-directory-async.c @@ -1162,12 +1162,6 @@ directory_load_cancel (CajaDirectory *directory) } } -static gboolean -remove_callback (gpointer key, gpointer value, gpointer user_data) -{ - return TRUE; -} - static void file_list_cancel (CajaDirectory *directory) { @@ -1187,7 +1181,7 @@ file_list_cancel (CajaDirectory *directory) if (directory->details->hidden_file_hash) { - g_hash_table_foreach_remove (directory->details->hidden_file_hash, remove_callback, NULL); + g_hash_table_remove_all (directory->details->hidden_file_hash); } } diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c index 031dd8d2..df7a2988 100644 --- a/src/file-manager/fm-directory-view.c +++ b/src/file-manager/fm-directory-view.c @@ -9930,12 +9930,6 @@ fm_directory_view_reveal_selection (FMDirectoryView *view) reveal_selection, (view)); } -static gboolean -remove_all (gpointer key, gpointer value, gpointer callback_data) -{ - return TRUE; -} - /** * fm_directory_view_stop: * @@ -9956,7 +9950,7 @@ fm_directory_view_stop (FMDirectoryView *view) view->details->new_added_files = NULL; file_and_directory_list_free (view->details->new_changed_files); view->details->new_changed_files = NULL; - g_hash_table_foreach_remove (view->details->non_ready_files, remove_all, NULL); + g_hash_table_remove_all (view->details->non_ready_files); file_and_directory_list_free (view->details->old_added_files); view->details->old_added_files = NULL; file_and_directory_list_free (view->details->old_changed_files); |