[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 22:53:46 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 m a s t e r
in repository xfce/thunar.
commit eb0fa0aa0944cef940533acdf4752fed5feb68e4
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 15b0cf6..d8ac6b5 100644
--- a/plugins/thunar-uca/thunar-uca-model.c
+++ b/plugins/thunar-uca/thunar-uca-model.c
@@ -1087,6 +1087,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);
@@ -1102,13 +1103,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);
@@ -1504,6 +1507,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);
@@ -1527,9 +1531,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;
@@ -1547,9 +1551,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;
@@ -1589,9 +1593,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;
@@ -1611,9 +1615,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 9d8c536..1c93c3f 100644
--- a/plugins/thunar-uca/thunar-uca-provider.c
+++ b/plugins/thunar-uca/thunar-uca-provider.c
@@ -315,7 +315,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;
@@ -353,8 +353,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 menu item, we just use the filename as working directory */
@@ -369,7 +369,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