diff options
author | Razvan Chitu <razvan.ch95@gmail.com> | 2016-08-06 14:23:25 +0300 |
---|---|---|
committer | Razvan Chitu <razvan.ch95@gmail.com> | 2016-08-23 00:36:56 +0300 |
commit | 211bfdfd538f098a31bd181fe1ee9e6dfcc1ce46 (patch) | |
tree | e8a12059a42382eec5859c28b892e4b140c751f6 | |
parent | 895ec57abeb4986f8807b74492893cf312329277 (diff) | |
download | nautilus-211bfdfd538f098a31bd181fe1ee9e6dfcc1ce46.tar.gz |
files-view: use a hashset for newly added locations
There is no hash set in GLib, so we have to use GHashTable. However there are
functions that allow to use the hash table as hash set. Use that instead of the
regular hash table functions.
https://bugzilla.gnome.org/show_bug.cgi?id=768646
-rw-r--r-- | src/nautilus-files-view.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c index e138e1f74..a47c2cf56 100644 --- a/src/nautilus-files-view.c +++ b/src/nautilus-files-view.c @@ -1567,11 +1567,11 @@ track_newly_added_locations (NautilusFilesView *view, NautilusDirectory *directory, gpointer user_data) { - NewFolderData *data; + GHashTable *added_locations; - data = user_data; + added_locations = user_data; - g_hash_table_insert (data->added_locations, nautilus_file_get_location (new_file), NULL); + g_hash_table_add (added_locations, nautilus_file_get_location (new_file)); } static void @@ -1595,7 +1595,7 @@ new_folder_done (GFile *new_folder, g_signal_handlers_disconnect_by_func (directory_view, G_CALLBACK (track_newly_added_locations), - (void *) data); + data->added_locations); if (new_folder == NULL) { goto fail; @@ -1632,7 +1632,7 @@ new_folder_done (GFile *new_folder, g_free (target_uri); } - if (g_hash_table_lookup_extended (data->added_locations, new_folder, NULL, NULL)) { + if (g_hash_table_contains (data->added_locations, new_folder)) { /* The file was already added */ nautilus_files_view_select_file (directory_view, file); nautilus_files_view_reveal_selection (directory_view); @@ -1785,7 +1785,7 @@ new_folder_dialog_controller_on_name_accepted (NautilusFileNameWidgetController g_signal_connect_data (view, "add-file", G_CALLBACK (track_newly_added_locations), - data, + data->added_locations, (GClosureNotify)NULL, G_CONNECT_AFTER); @@ -1865,7 +1865,7 @@ setup_new_folder_data (NautilusFilesView *directory_view) g_signal_connect_data (directory_view, "add-file", G_CALLBACK (track_newly_added_locations), - data, + data->added_locations, (GClosureNotify)NULL, G_CONNECT_AFTER); |