[Xfce4-commits] [xfce/xfdesktop] 05/19: Use the Path key of desktop files if a path is not set (Bug #8741)

noreply at xfce.org noreply at xfce.org
Sun Nov 9 15:36:47 CET 2014


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

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

commit b145689dab1e8ebedd5b95382668a608b3e04909
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Sat Apr 28 14:05:12 2012 +0300

    Use the Path key of desktop files if a path is not set (Bug #8741)
---
 src/xfdesktop-file-utils.c |   25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/src/xfdesktop-file-utils.c b/src/xfdesktop-file-utils.c
index 2670bbd..a99417c 100644
--- a/src/xfdesktop-file-utils.c
+++ b/src/xfdesktop-file-utils.c
@@ -1171,6 +1171,31 @@ xfdesktop_file_utils_execute(GFile *working_directory,
             uris[n] = g_file_get_uri(lp->data);
         uris[n] = NULL;
 
+        /* If the working_dir wasn't set check if this is a .desktop file
+         * we can parse a working dir from */
+        if(working_dir == NULL) {
+            GFileInfo *info = g_file_query_info(file,
+                                                XFDESKTOP_FILE_INFO_NAMESPACE,
+                                                G_FILE_QUERY_INFO_NONE,
+                                                NULL, NULL);
+
+            if(xfdesktop_file_utils_is_desktop_file(info)) {
+                XfceRc *rc;
+                gchar *path = g_file_get_path(file);
+                if(path != NULL) {
+                    rc = xfce_rc_simple_open(path, TRUE);
+                    if(rc != NULL) {
+                        working_dir = g_strdup(xfce_rc_read_entry(rc, "Path", NULL));
+                        xfce_rc_close(rc);
+                    }
+                    g_free(path);
+                }
+            }
+
+            if(info)
+                g_object_unref(info);
+        }
+
         if(!xfdesktop_file_manager_proxy_execute(fileman_proxy,
                                                  working_dir, uri,
                                                  (const gchar **)uris,

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


More information about the Xfce4-commits mailing list