From 7ede081a140c2da01e66283ea67b7dea66da19e3 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Fri, 24 Aug 2012 14:34:44 +0400 Subject: [PATCH 1/2] Ticket #2862: fix syncronization with filelist and tree panels ...in case of rename and delete directories. Steps to reproduce the problem: * Choose "file listing" mode for one panel and "directory tree" mode for the other. * Perform all operations on the "file listing" panel. * Create a new directory -> tree view will update correctly. * Perform an operation, which changes this directory like rename/delete. * Deleted directory will still show up on the "directory tree" view. Renamed directory will show up with the new name, but the old name will also stay there. Minor cleanup: remove extra parenthesis. Signed-off-by: Andrew Borodin --- src/filemanager/treestore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/filemanager/treestore.c b/src/filemanager/treestore.c index 18a74c54c..bfa085c52 100644 --- a/src/filemanager/treestore.c +++ b/src/filemanager/treestore.c @@ -851,13 +851,13 @@ tree_store_start_check (const vfs_path_t * vpath) len = vfs_path_len (ts.check_name); current = ts.check_start; - while (current != NULL && vfs_path_cmp (current->name, ts.check_name) == 0) + while (current != NULL && vfs_path_ncmp (current->name, ts.check_name, len) == 0) { char *current_name; gboolean ok; current_name = vfs_path_to_str (current->name); - ok = (current_name[len] == '\0' || (current_name[len] == PATH_SEP || len == 1)); + ok = (current_name[len] == '\0' || current_name[len] == PATH_SEP || len == 1); g_free (current_name); if (!ok) break; From dc52b3488d25fb5065ad0820e2755ea8a03ca974 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Fri, 24 Aug 2012 14:40:19 +0400 Subject: [PATCH 2/2] Fix of memory leak in TreeStore::check_name destruction. Signed-off-by: Andrew Borodin --- src/filemanager/treestore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filemanager/treestore.c b/src/filemanager/treestore.c index bfa085c52..076a3707d 100644 --- a/src/filemanager/treestore.c +++ b/src/filemanager/treestore.c @@ -908,7 +908,7 @@ tree_store_end_check (void) ts.add_queue_vpath = g_list_reverse (ts.add_queue_vpath); the_queue = ts.add_queue_vpath; ts.add_queue_vpath = NULL; - g_free (ts.check_name); + vfs_path_free (ts.check_name); ts.check_name = NULL; g_list_foreach (the_queue, (GFunc) vfs_path_free, NULL);