diff --git a/ChangeLog b/ChangeLog index a18674fdc1a58dea1289deaacc3e3ce81c3262f4..09816c7c183f53898f0c970521ddd0c2cf11f309 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-02-14 Benedikt Meurer <benny@xfce.org> + + * thunar-vfs/thunar-vfs-volume-hal.c: Pass NULL for error on first + attempt to launch pumount. + * thunar/thunar-folder.c: Properly merge the current files with the + previous files when reloading the folder content. This finally fixes + bug #1457. + 2006-02-14 Benedikt Meurer <benny@xfce.org> * thunar-vfs/thunar-vfs-volume-hal.c: Fallback to mount/umount if diff --git a/thunar-vfs/thunar-vfs-volume-hal.c b/thunar-vfs/thunar-vfs-volume-hal.c index 80a29be9c7951e1d5b1571e1e357e54feed9efa2..58b198f2f71cc2a7e5a661a9e1707a47e1d94659 100644 --- a/thunar-vfs/thunar-vfs-volume-hal.c +++ b/thunar-vfs/thunar-vfs-volume-hal.c @@ -431,7 +431,7 @@ thunar_vfs_volume_hal_unmount (ThunarVfsVolume *volume, g_free (quoted); /* execute the pumount command */ - result = g_spawn_command_line_sync (command_line, NULL, &standard_error, &exit_status, error); + result = g_spawn_command_line_sync (command_line, NULL, &standard_error, &exit_status, NULL); if (G_LIKELY (result)) { /* check if the command failed */ diff --git a/thunar/thunar-folder.c b/thunar/thunar-folder.c index dc00c2ab8e00331ba5a194a3bbe133c2f7b552a9..355a49198f7933d168cad76e412bbea6272fe1df 100644 --- a/thunar/thunar-folder.c +++ b/thunar/thunar-folder.c @@ -668,6 +668,8 @@ thunar_folder_get_loading (const ThunarFolder *folder) void thunar_folder_reload (ThunarFolder *folder) { + GList *lp; + g_return_if_fail (THUNAR_IS_FOLDER (folder)); /* check if we are currently connect to a job */ @@ -686,11 +688,35 @@ thunar_folder_reload (ThunarFolder *folder) folder->handle = NULL; } - /* drop all previous files */ - thunar_file_list_free (folder->previous_files); + /* merge current files with previous files */ + if (G_LIKELY (folder->previous_files == NULL)) + { + /* just use the current files as previous files */ + folder->previous_files = folder->files; + } + else if (G_UNLIKELY (folder->files != NULL)) + { + /* process all current files */ + for (lp = folder->files; lp != NULL; lp = lp->next) + { + /* check if it's on the list of previous files */ + if (g_list_find (folder->previous_files, lp->data) == NULL) + { + /* add it to the previous files list */ + folder->previous_files = g_list_prepend (folder->previous_files, lp->data); + } + else + { + /* we already have it, no need to keep it around */ + g_object_unref (G_OBJECT (lp->data)); + } + } + + /* drop the list structure itself */ + g_list_free (folder->files); + } - /* remember the current files as previous files */ - folder->previous_files = folder->files; + /* start out with a clean list */ folder->files = NULL; /* start a new job */