[Xfce4-commits] <thunar:master> Avoid GIO 2.20 calls; fix the recursive file manager launch check.
Jannis Pohlmann
noreply at xfce.org
Sat Dec 4 16:30:01 CET 2010
Updating branch refs/heads/master
to 01236511efffe38645d962d2d4129dd322b21607 (commit)
from 2133f883d1cc752374f176f0fcc0c61bcc48f42d (commit)
commit 01236511efffe38645d962d2d4129dd322b21607
Author: Jannis Pohlmann <jannis at xfce.org>
Date: Sat Dec 4 16:23:37 2010 +0100
Avoid GIO 2.20 calls; fix the recursive file manager launch check.
NEWS | 3 +++
thunar/thunar-file.c | 7 +++----
thunar/thunar-gio-extensions.c | 2 ++
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/NEWS b/NEWS
index 3bf9944..2a83af0 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,9 @@
- Fix a typo in configure.in.in (bug #6724).
- Use GTK_STOCK_FILE as the fallback icon for files (bug #6662).
- Use Name field as display name of desktop entries (bug #6860).
+- Avoid GIO 2.20 function calls.
+- Properly avoid launching the file manager recursively by checking
+ the GAppInfo id/name.
1.1.4
=====
diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c
index dc0f59b..1171527 100644
--- a/thunar/thunar-file.c
+++ b/thunar/thunar-file.c
@@ -1158,7 +1158,6 @@ thunar_file_launch (ThunarFile *file,
GAppInfo *app_info;
gboolean succeed;
GList path_list;
- const gchar *command_line;
_thunar_return_val_if_fail (THUNAR_IS_FILE (file), FALSE);
_thunar_return_val_if_fail (error == NULL || *error == NULL, FALSE);
@@ -1199,9 +1198,9 @@ thunar_file_launch (ThunarFile *file,
/* HACK: check if we're not trying to launch another file manager again, possibly
* ourselfs which will end in a loop */
- command_line = g_app_info_get_commandline (app_info);
- if (command_line != NULL
- && strstr (command_line, "exo-helper-1 --launch FileManager") != NULL)
+ if (g_strcmp0 (g_app_info_get_id (app_info), "exo-file-manager.desktop") == 0
+ || g_strcmp0 (g_app_info_get_id (app_info), "Thunar.desktop") == 0
+ || g_strcmp0 (g_app_info_get_name (app_info), "exo-file-manager") == 0)
{
g_object_unref (G_OBJECT (app_info));
thunar_show_chooser_dialog (parent, file, TRUE);
diff --git a/thunar/thunar-gio-extensions.c b/thunar/thunar-gio-extensions.c
index e4717b3..58360eb 100644
--- a/thunar/thunar-gio-extensions.c
+++ b/thunar/thunar-gio-extensions.c
@@ -555,12 +555,14 @@ thunar_g_volume_is_present (GVolume *volume)
g_object_unref (drive);
}
+#if GLIB_CHECK_VERSION (2, 20, 0)
mount = g_volume_get_mount (volume);
if (mount != NULL)
{
is_shadowed = g_mount_is_shadowed (mount);
g_object_unref (mount);
}
+#endif
return has_media && !is_shadowed;
}
More information about the Xfce4-commits
mailing list