[Xfce4-commits] [xfce/xfdesktop] 01/01: Fix issues with file move events (Bug 10796)

noreply at xfce.org noreply at xfce.org
Sat Apr 5 21:00:34 CEST 2014


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository xfce/xfdesktop.

commit 9e4f3d1a2ec0d51e02b675fb7605c5eac74e3a9e
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Sat Apr 5 21:12:53 2014 +0300

    Fix issues with file move events (Bug 10796)
    
    Commit 31143fed1e36 compared file basenames which isn't what we
    should be doing. We need to compare the file's parent with our
    desktop folder to determine if the file move keeps the file on
    the desktop.
---
 common/xfdesktop-common.c         |    8 +++++---
 common/xfdesktop-common.h         |    2 +-
 src/xfdesktop-file-icon-manager.c |    2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/common/xfdesktop-common.c b/common/xfdesktop-common.c
index f272861..d253ae1 100644
--- a/common/xfdesktop-common.c
+++ b/common/xfdesktop-common.c
@@ -55,13 +55,15 @@
 
 
 gint
-xfdesktop_compare_basenames(GFile *a, GFile *b)
+xfdesktop_compare_paths(GFile *a, GFile *b)
 {
     gchar *path_a, *path_b;
     gboolean ret;
 
-    path_a = g_file_get_basename(a);
-    path_b = g_file_get_basename(b);
+    path_a = g_file_get_path(a);
+    path_b = g_file_get_path(b);
+
+    DBG("a %s, b %s", path_a, path_b);
 
     ret = g_strcmp0(path_a, path_b);
 
diff --git a/common/xfdesktop-common.h b/common/xfdesktop-common.h
index 6001ce8..a879d25 100644
--- a/common/xfdesktop-common.h
+++ b/common/xfdesktop-common.h
@@ -87,7 +87,7 @@
 
 G_BEGIN_DECLS
 
-gint xfdesktop_compare_basenames(GFile *a, GFile *b);
+gint xfdesktop_compare_paths(GFile *a, GFile *b);
 
 gboolean xfdesktop_image_file_is_valid(const gchar *filename);
 
diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c
index 42b5935..4ae7853 100644
--- a/src/xfdesktop-file-icon-manager.c
+++ b/src/xfdesktop-file-icon-manager.c
@@ -2413,7 +2413,7 @@ xfdesktop_file_icon_manager_file_changed(GFileMonitor     *monitor,
                 xfdesktop_file_icon_manager_remove_icon(fmanager, moved_icon);
             }
 
-            if(xfdesktop_compare_basenames(other_file, fmanager->priv->folder) != 0) {
+            if(xfdesktop_compare_paths(g_file_get_parent(other_file), fmanager->priv->folder)) {
                 DBG("icon moved off the desktop");
                 /* Nothing moved, this is actually a delete */
                 if(file_info)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list