[Xfce4-commits] <exo:xfce-4.6> Open trash:// uris with the file manager (bug #5777).
Nick Schermer
noreply at xfce.org
Thu Oct 8 12:34:02 CEST 2009
Updating branch refs/heads/xfce-4.6
to 5ac37c2552cf0d4231cf71fe69902ace2daca1d2 (commit)
from f5735309d8f8bf9fb35fe893de85733ee402fb29 (commit)
commit 5ac37c2552cf0d4231cf71fe69902ace2daca1d2
Author: Nick Schermer <nick at xfce.org>
Date: Thu Oct 8 12:32:51 2009 +0200
Open trash:// uris with the file manager (bug #5777).
exo/exo-url.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/exo/exo-url.c b/exo/exo-url.c
index cc9ab37..45316c4 100644
--- a/exo/exo-url.c
+++ b/exo/exo-url.c
@@ -149,8 +149,10 @@ _exo_url_to_local_path (const gchar *url)
}
else
{
- /* check if url is an absolute path */
- if (g_path_is_absolute (url))
+ /* check if url is an absolute path or trash uri (ie. something we
+ * can send directly to the file manager) */
+ if (g_path_is_absolute (url)
+ || g_str_has_prefix (url, "trash://"))
{
/* well, we got our path then */
path = g_strdup (url);
@@ -227,10 +229,12 @@ exo_url_show_on_screen (const gchar *url,
/* determine the display name for the screen */
display_name = gdk_screen_make_display_name (screen);
- /* check if we have a local HTML file here */
- if (fnmatch ("*.xhtml", local_path, FNM_CASEFOLD) == 0
- || fnmatch ("*.htm", local_path, FNM_CASEFOLD) == 0
- || fnmatch ("*.html", local_path, FNM_CASEFOLD) == 0)
+ /* check if we have a local HTML file here that is not
+ * in the trash */
+ if (!g_str_has_prefix (url, "trash://")
+ && (fnmatch ("*.xhtml", local_path, FNM_CASEFOLD) == 0
+ || fnmatch ("*.htm", local_path, FNM_CASEFOLD) == 0
+ || fnmatch ("*.html", local_path, FNM_CASEFOLD) == 0))
{
/* transform the path to a file:-URI */
uri = g_filename_to_uri (local_path, NULL, error);
More information about the Xfce4-commits
mailing list