summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRazvan Chitu <razvan.ch95@gmail.com>2016-08-06 14:23:25 +0300
committerRazvan Chitu <razvan.ch95@gmail.com>2016-08-22 12:29:03 +0300
commit9c88e6892e534425043e6b8945af9c17b66b272d (patch)
treee271058c2dac278fc1fdf14fd6d949dde3d72897
parent116b53c5f2a440487d4a5d35a72da4469aaac567 (diff)
downloadnautilus-9c88e6892e534425043e6b8945af9c17b66b272d.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.c14
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);