diff --git a/plugins/thunar-uca/thunar-uca-model.c b/plugins/thunar-uca/thunar-uca-model.c index d5cb8e4..dc76439 100644 --- a/plugins/thunar-uca/thunar-uca-model.c +++ b/plugins/thunar-uca/thunar-uca-model.c @@ -1026,6 +1026,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); @@ -1040,7 +1041,9 @@ 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); + g_free (path_test); + if (path_test == NULL) { /* cannot handle non-local files */ g_object_unref (location); @@ -1429,6 +1432,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); @@ -1452,9 +1456,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; @@ -1472,9 +1476,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; @@ -1514,9 +1518,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; @@ -1536,9 +1540,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 21e3c24..d530ca2 100644 --- a/plugins/thunar-uca/thunar-uca-provider.c +++ b/plugins/thunar-uca/thunar-uca-provider.c @@ -306,7 +306,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; @@ -344,8 +344,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 */ @@ -360,7 +360,7 @@ thunar_uca_provider_activated (ThunarUcaProvider *uca_provider, } } g_free (filename); - g_free (uri); + g_object_unref (location); } /* build closre for child watch */