Author: benny
Date: 2006-07-28 12:21:49 +0000 (Fri, 28 Jul 2006)
New Revision: 22546
Modified:
thunar/trunk/ChangeLog
thunar/trunk/thunar/thunar-dbus-service.c
thunar/trunk/thunar/thunar-tree-model.c
Log:
2006-07-28 Benedikt Meurer <[EMAIL PROTECTED]>
* thunar/thunar-dbus-service.c, thunar/thunar-tree-model.c: Monitor
the trash bin for changes.
Modified: thunar/trunk/ChangeLog
===================================================================
--- thunar/trunk/ChangeLog 2006-07-28 11:48:14 UTC (rev 22545)
+++ thunar/trunk/ChangeLog 2006-07-28 12:21:49 UTC (rev 22546)
@@ -1,5 +1,10 @@
2006-07-28 Benedikt Meurer <[EMAIL PROTECTED]>
+ * thunar/thunar-dbus-service.c, thunar/thunar-tree-model.c: Monitor
+ the trash bin for changes.
+
+2006-07-28 Benedikt Meurer <[EMAIL PROTECTED]>
+
* thunar/thunar-tree-model.c(thunar_tree_model_node_drop_dummy): We
can avoid an additional path lookup here.
Modified: thunar/trunk/thunar/thunar-dbus-service.c
===================================================================
--- thunar/trunk/thunar/thunar-dbus-service.c 2006-07-28 11:48:14 UTC (rev
22545)
+++ thunar/trunk/thunar/thunar-dbus-service.c 2006-07-28 12:21:49 UTC (rev
22546)
@@ -225,9 +225,13 @@
if (G_LIKELY (dbus_service->connection != NULL))
dbus_g_connection_unref (dbus_service->connection);
- /* release the trash bin object */
+ /* check if we are connected to the trash bin */
if (G_LIKELY (dbus_service->trash_bin != NULL))
{
+ /* unwatch the trash bin */
+ thunar_file_unwatch (dbus_service->trash_bin);
+
+ /* release the trash bin */
g_signal_handlers_disconnect_by_func (G_OBJECT
(dbus_service->trash_bin), thunar_dbus_service_trash_bin_changed, dbus_service);
g_object_unref (G_OBJECT (dbus_service->trash_bin));
}
@@ -251,6 +255,9 @@
dbus_service->trash_bin = thunar_file_get_for_path (trash_bin_path,
error);
if (G_LIKELY (dbus_service->trash_bin != NULL))
{
+ /* watch the trash bin for changes */
+ thunar_file_watch (dbus_service->trash_bin);
+
/* stay informed about changes to the trash bin */
g_signal_connect_swapped (G_OBJECT (dbus_service->trash_bin),
"changed",
G_CALLBACK
(thunar_dbus_service_trash_bin_changed),
Modified: thunar/trunk/thunar/thunar-tree-model.c
===================================================================
--- thunar/trunk/thunar/thunar-tree-model.c 2006-07-28 11:48:14 UTC (rev
22545)
+++ thunar/trunk/thunar/thunar-tree-model.c 2006-07-28 12:21:49 UTC (rev
22546)
@@ -317,6 +317,10 @@
file = thunar_file_get_for_path (system_path_list[n], NULL);
if (G_LIKELY (file != NULL))
{
+ /* watch the trash bin 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);
node = g_node_append_data (model->root, item);
@@ -1233,6 +1237,11 @@
/* disconnect from the file */
if (G_LIKELY (item->file != NULL))
{
+ /* unwatch the trash bin */
+ 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));
item->file = NULL;
}
_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits