[Xfce4-commits] <xfdesktop:master> Use xfdesktop_file_icon_update_file_info() when a file icon has changed.

Jannis Pohlmann noreply at xfce.org
Tue Nov 2 01:14:25 CET 2010


Updating branch refs/heads/master
         to e96012395ee3e41c3406456dae818762447b4b9b (commit)
       from 5f1001a155aa7509d776409cd6ff87b920bade9e (commit)

commit e96012395ee3e41c3406456dae818762447b4b9b
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Fri Oct 22 13:08:16 2010 +0200

    Use xfdesktop_file_icon_update_file_info() when a file icon has changed.

 src/xfdesktop-file-icon-manager.c |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c
index 0855183..4ffa7f1 100644
--- a/src/xfdesktop-file-icon-manager.c
+++ b/src/xfdesktop-file-icon-manager.c
@@ -2360,19 +2360,14 @@ xfdesktop_file_icon_manager_file_changed(GFileMonitor     *monitor,
             
             icon = g_hash_table_lookup(fmanager->priv->icons, file);
             if(icon) {
-                DBG("found file in HT");
+                file_info = g_file_query_info(file, XFDESKTOP_FILE_INFO_NAMESPACE,
+                                              G_FILE_QUERY_INFO_NONE, NULL, NULL);
                 
-                /* TODO remove this workaround to convert the GFile into a ThunarVfsInfo.
-                 * Instead, load the GFileInfo for it and call update_file_info */
-                pathname = g_file_get_path(file);
-                path = thunar_vfs_path_new(pathname, NULL);
-                info = thunar_vfs_info_new_for_path(path, NULL);
+                /* the file info query HAS to succeed because the file still exists */
+                g_assert(file_info);
 
-                xfdesktop_file_icon_update_info(icon, info);
-
-                /*thunar_vfs_info_unref(info);*/
-                thunar_vfs_path_unref(path);
-                g_free(pathname);
+                xfdesktop_file_icon_update_file_info(icon, file_info);
+                g_object_unref(file_info);
             }
             break;
         case G_FILE_MONITOR_EVENT_CREATED:



More information about the Xfce4-commits mailing list