[Xfce4-commits] [xfce/xfdesktop] 01/01: Desktop icons order resets (Bug #11266) - Added link to last used configuration as fallback

noreply at xfce.org noreply at xfce.org
Thu May 2 21:09:06 CEST 2019


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

a   l   e   x       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       x   f   c   e   -   4   .   1   2   
   in repository xfce/xfdesktop.

commit 399090b197aee2cd98e3ba5c49a56632dd388eb8
Author: Alexander Schwinn <alexxcons at xfce.org>
Date:   Tue Apr 30 22:38:24 2019 +0200

    Desktop icons order resets (Bug #11266) - Added link to last used configuration as fallback
---
 src/xfdesktop-file-icon-manager.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c
index 2c4a9b8..8b2a74f 100644
--- a/src/xfdesktop-file-icon-manager.c
+++ b/src/xfdesktop-file-icon-manager.c
@@ -48,6 +48,10 @@
 #include <errno.h>
 #endif
 
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
 #ifndef PATH_MAX
 #define PATH_MAX 4096
 #endif
@@ -1943,7 +1947,7 @@ static gboolean
 xfdesktop_file_icon_manager_save_icons(gpointer user_data)
 {
     XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(user_data);
-    gchar relpath[PATH_MAX], *tmppath, *path;
+    gchar relpath[PATH_MAX], *tmppath, *path, *last_path;
     XfceRc *rcfile;
     gint x = 0, y = 0, width = 0, height = 0;
     
@@ -1999,6 +2003,14 @@ xfdesktop_file_icon_manager_save_icons(gpointer user_data)
                       strerror(errno));
             unlink(tmppath);
         }
+        else {
+            last_path = xfce_resource_save_location(XFCE_RESOURCE_CONFIG, "xfce4/desktop/icons.screen.latest.rc", TRUE);
+            if(last_path != NULL) {
+                  unlink(last_path);
+                  symlink(path, last_path);
+                  g_free(last_path);
+            }
+        }
     } else {
         XF_DEBUG("didn't write anything in the RC file, desktop is probably empty");
     }
@@ -2071,6 +2083,11 @@ xfdesktop_file_icon_manager_get_cached_icon_position(XfdesktopFileIconManager *f
         filename = xfce_resource_lookup(XFCE_RESOURCE_CONFIG, relpath);
     }
 
+    /* Still nothing ? Just use the latest available file as fallback */
+    if(filename == NULL) {
+        filename = xfce_resource_lookup(XFCE_RESOURCE_CONFIG, "xfce4/desktop/icons.screen.latest.rc");
+    }
+
     if(filename != NULL) {
         XfceRc *rcfile;
         const gchar *icon_name;

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


More information about the Xfce4-commits mailing list