diff options
author | Jannis Pohlmann <jannis@xfce.org> | 2009-09-03 15:59:25 +0200 |
---|---|---|
committer | Jannis Pohlmann <jannis@xfce.org> | 2009-09-03 15:59:25 +0200 |
commit | 8fc1f1d497b935da3f2e36b353bfa7b9011f351e (patch) | |
tree | c28d1a688ca2a83a646ebe092ce5dd5208cffb0c /thunar/thunar-gio-extensions.c | |
parent | ce5907275f341662275bcf1ff38f8b18142e28bc (diff) | |
download | thunar-8fc1f1d497b935da3f2e36b353bfa7b9011f351e.tar.gz |
Add function thunar_g_vfs_is_uri_scheme_supported (const gchar *).
This function checks whether an URI scheme is supported on the system or
not. It will be used by Thunar to find out whether to show/hide
important system paths like trash:// and network:// in the side pane and
in the go to menu.
Diffstat (limited to 'thunar/thunar-gio-extensions.c')
-rw-r--r-- | thunar/thunar-gio-extensions.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/thunar/thunar-gio-extensions.c b/thunar/thunar-gio-extensions.c index 907b4024..599ce873 100644 --- a/thunar/thunar-gio-extensions.c +++ b/thunar/thunar-gio-extensions.c @@ -218,6 +218,28 @@ thunar_g_file_get_location (GFile *file) +gboolean +thunar_g_vfs_is_uri_scheme_supported (const gchar *scheme) +{ + const gchar * const *supported_schemes; + gboolean supported = FALSE; + guint n; + GVfs *gvfs; + + _thunar_return_val_if_fail (scheme != NULL && *scheme != '\0', FALSE); + + gvfs = g_vfs_get_default (); + supported_schemes = g_vfs_get_supported_uri_schemes (gvfs); + + for (n = 0; !supported && supported_schemes[n] != NULL; ++n) + if (g_strcmp0 (supported_schemes[n], scheme) == 0) + supported = TRUE; + + return supported; +} + + + GType thunar_g_file_list_get_type (void) { |