[Xfce4-commits] [xfce/thunar] 01/01: Thunar User Configurable Actions do not work for remote locations (bug #7652), patch from (bug#7305)

noreply at xfce.org noreply at xfce.org
Sun Mar 4 23:25:52 CET 2018


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/thunar.

commit 46b4f0212f72b0971bfd49f9c9610285d60e0f0b
Author: Ambroz Bizjak <ambrop7 at gmail.com>
Date:   Sun Mar 4 22:48:10 2018 +0100

    Thunar User Configurable Actions do not work for remote locations
    (bug #7652), patch from (bug#7305)
---
 plugins/thunar-uca/thunar-uca-model.c    | 30 +++++++++++++++++-------------
 plugins/thunar-uca/thunar-uca-provider.c |  8 ++++----
 2 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/plugins/thunar-uca/thunar-uca-model.c b/plugins/thunar-uca/thunar-uca-model.c
index 023245a..4cdb17e 100644
--- a/plugins/thunar-uca/thunar-uca-model.c
+++ b/plugins/thunar-uca/thunar-uca-model.c
@@ -1099,6 +1099,7 @@ thunar_uca_model_match (ThunarUcaModel *uca_model,
   GList              *lp;
   gint                n_files;
   gint                i, m, n;
+  gchar              *path_test;
 
   g_return_val_if_fail (THUNAR_UCA_IS_MODEL (uca_model), NULL);
   g_return_val_if_fail (file_infos != NULL, NULL);
@@ -1114,13 +1115,15 @@ thunar_uca_model_match (ThunarUcaModel *uca_model,
     {
       location = thunarx_file_info_get_location (lp->data);
 
-      if (!g_file_has_uri_scheme (location, "file"))
+      path_test = g_file_get_path (location);
+      if (path_test == NULL)
         {
           /* cannot handle non-local files */
           g_object_unref (location);
           g_free (files);
           return NULL;
         }
+      g_free (path_test);
 
       g_object_unref (location);
 
@@ -1516,6 +1519,7 @@ thunar_uca_model_parse_argv (ThunarUcaModel *uca_model,
   gchar              *quoted;
   gchar              *path;
   gchar              *uri;
+  GFile              *location;
 
   g_return_val_if_fail (THUNAR_UCA_IS_MODEL (uca_model), FALSE);
   g_return_val_if_fail (iter->stamp == uca_model->stamp, FALSE);
@@ -1539,9 +1543,9 @@ thunar_uca_model_parse_argv (ThunarUcaModel *uca_model,
             case 'f':
               if (G_LIKELY (file_infos != NULL))
                 {
-                  uri = thunarx_file_info_get_uri (file_infos->data);
-                  path = g_filename_from_uri (uri, NULL, error);
-                  g_free (uri);
+                  location = thunarx_file_info_get_location (file_infos->data);
+                  path = g_file_get_path (location);
+                  g_object_unref (location);
 
                   if (G_UNLIKELY (path == NULL))
                     goto error;
@@ -1559,9 +1563,9 @@ thunar_uca_model_parse_argv (ThunarUcaModel *uca_model,
                   if (G_LIKELY (lp != file_infos))
                     g_string_append_c (command_line, ' ');
 
-                  uri = thunarx_file_info_get_uri (lp->data);
-                  path = g_filename_from_uri (uri, NULL, error);
-                  g_free (uri);
+                  location = thunarx_file_info_get_location (lp->data);
+                  path = g_file_get_path (location);
+                  g_object_unref (location);
 
                   if (G_UNLIKELY (path == NULL))
                     goto error;
@@ -1601,9 +1605,9 @@ thunar_uca_model_parse_argv (ThunarUcaModel *uca_model,
             case 'd':
               if (G_LIKELY (file_infos != NULL))
                 {
-                  uri = thunarx_file_info_get_uri (file_infos->data);
-                  path = g_filename_from_uri (uri, NULL, error);
-                  g_free (uri);
+                  location = thunarx_file_info_get_location (file_infos->data);
+                  path = g_file_get_path (location);
+                  g_object_unref (location);
 
                   if (G_UNLIKELY (path == NULL))
                     goto error;
@@ -1623,9 +1627,9 @@ thunar_uca_model_parse_argv (ThunarUcaModel *uca_model,
                   if (G_LIKELY (lp != file_infos))
                     g_string_append_c (command_line, ' ');
 
-                  uri = thunarx_file_info_get_uri (lp->data);
-                  path = g_filename_from_uri (uri, NULL, error);
-                  g_free (uri);
+                  location = thunarx_file_info_get_location (lp->data);
+                  path = g_file_get_path (location);
+                  g_object_unref (location);
 
                   if (G_UNLIKELY (path == NULL))
                     goto error;
diff --git a/plugins/thunar-uca/thunar-uca-provider.c b/plugins/thunar-uca/thunar-uca-provider.c
index 60a5b19..00e8fea 100644
--- a/plugins/thunar-uca/thunar-uca-provider.c
+++ b/plugins/thunar-uca/thunar-uca-provider.c
@@ -307,7 +307,7 @@ thunar_uca_provider_activated (ThunarUcaProvider *uca_provider,
   gchar               *working_directory = NULL;
   gchar               *filename;
   gchar               *label;
-  gchar               *uri;
+  GFile               *location;
   gint                 argc;
   gchar               *icon_name = NULL;
   gboolean             startup_notify;
@@ -345,8 +345,8 @@ thunar_uca_provider_activated (ThunarUcaProvider *uca_provider,
       if (G_LIKELY (files != NULL))
         {
           /* determine the filename of the first selected file */
-          uri = thunarx_file_info_get_uri (files->data);
-          filename = g_filename_from_uri (uri, NULL, NULL);
+          location = thunarx_file_info_get_location (files->data);
+          filename = g_file_get_path (location);
           if (G_LIKELY (filename != NULL))
             {
               /* if this is a folder action, we just use the filename as working directory */
@@ -361,7 +361,7 @@ thunar_uca_provider_activated (ThunarUcaProvider *uca_provider,
                 }
             }
           g_free (filename);
-          g_free (uri);
+          g_object_unref (location);
         }
 
       /* build closre for child watch */

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


More information about the Xfce4-commits mailing list