[Xfce4-commits] <thunar:master> Only watch the trash in the tree view side pane.
Jannis Pohlmann
noreply at xfce.org
Fri Dec 18 18:00:03 CET 2009
Updating branch refs/heads/master
to c44d1c8a0b83862c69cbf69f791c43672d6cfc1d (commit)
from cc5395b970c210f1140338eb9633558eddced4a4 (commit)
commit c44d1c8a0b83862c69cbf69f791c43672d6cfc1d
Author: Jannis Pohlmann <jannis at xfce.org>
Date: Fri Dec 18 17:57:44 2009 +0100
Only watch the trash in the tree view side pane.
This is what we had before and it avoids a lot of critical warnings due
to unwatching files (e.g. volume mounts) that are not being watched at
all.
thunar/thunar-tree-model.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/thunar/thunar-tree-model.c b/thunar/thunar-tree-model.c
index ff5fa4b..11f04e7 100644
--- a/thunar/thunar-tree-model.c
+++ b/thunar/thunar-tree-model.c
@@ -337,8 +337,9 @@ thunar_tree_model_init (ThunarTreeModel *model)
file = thunar_file_get (lp->data, NULL);
if (G_LIKELY (file != NULL))
{
- /* watch the file for changes */
- thunar_file_watch (file);
+ /* watch the trash for changes */
+ if (thunar_file_is_trashed (file) && thunar_file_is_root (file))
+ thunar_file_watch (file);
/* create and append the new node */
item = thunar_tree_model_item_new_with_file (model, file);
@@ -1270,8 +1271,9 @@ thunar_tree_model_item_reset (ThunarTreeModelItem *item)
/* disconnect from the file */
if (G_LIKELY (item->file != NULL))
{
- /* unwatch the file */
- thunar_file_unwatch (item->file);
+ /* unwatch the trash */
+ if (thunar_file_is_trashed (item->file) && thunar_file_is_root (item->file))
+ thunar_file_unwatch (item->file);
/* release and reset the file */
g_object_unref (G_OBJECT (item->file));
More information about the Xfce4-commits
mailing list