[Xfce4-commits] <thunar:master> Use new exo_str_looks_like_an_uri function.

Nick Schermer noreply at xfce.org
Fri Oct 16 21:40:01 CEST 2009


Updating branch refs/heads/master
         to 2aa405567f3e88a899ba280dab18f7f54d82ffe1 (commit)
       from 57ada5ce2da72c3b3c0fade8684bc6361eb2efe6 (commit)

commit 2aa405567f3e88a899ba280dab18f7f54d82ffe1
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Oct 16 21:39:26 2009 +0200

    Use new exo_str_looks_like_an_uri function.

 thunar/thunar-application.c |    4 ++--
 thunar/thunar-path-entry.c  |    2 +-
 thunar/thunar-util.c        |   30 ------------------------------
 3 files changed, 3 insertions(+), 33 deletions(-)

diff --git a/thunar/thunar-application.c b/thunar/thunar-application.c
index c6f883a..363783a 100644
--- a/thunar/thunar-application.c
+++ b/thunar/thunar-application.c
@@ -987,7 +987,7 @@ thunar_application_bulk_rename (ThunarApplication *application,
   for (n = 0; filenames[n] != NULL; ++n)
     {
       /* check if the filename is an absolute path or looks like an URI */
-      if (g_path_is_absolute (filenames[n]) || thunar_util_looks_like_an_uri (filenames[n]))
+      if (g_path_is_absolute (filenames[n]) || exo_str_looks_like_an_uri (filenames[n]))
         {
           /* determine the file for the filename directly */
           file = thunar_file_get_for_uri (filenames[n], error);
@@ -1181,7 +1181,7 @@ thunar_application_process_filenames (ThunarApplication *application,
   for (n = 0; filenames[n] != NULL; ++n)
     {
       /* check if the filename is an absolute path or looks like an URI */
-      if (g_path_is_absolute (filenames[n]) || thunar_util_looks_like_an_uri (filenames[n]))
+      if (g_path_is_absolute (filenames[n]) || exo_str_looks_like_an_uri (filenames[n]))
         {
           /* determine the file for the filename directly */
           file = thunar_file_get_for_uri (filenames[n], &derror);
diff --git a/thunar/thunar-path-entry.c b/thunar/thunar-path-entry.c
index 56795f0..06467d8 100644
--- a/thunar/thunar-path-entry.c
+++ b/thunar/thunar-path-entry.c
@@ -768,7 +768,7 @@ thunar_path_entry_changed (GtkEditable *editable)
 
   /* parse the entered string (handling URIs properly) */
   text = gtk_entry_get_text (GTK_ENTRY (path_entry));
-  if (G_UNLIKELY (thunar_util_looks_like_an_uri (text)))
+  if (G_UNLIKELY (exo_str_looks_like_an_uri (text)))
     {
       /* try to parse the URI text */
       file_path = g_file_new_for_uri (text);
diff --git a/thunar/thunar-util.c b/thunar/thunar-util.c
index 4c766b6..8cd2523 100644
--- a/thunar/thunar-util.c
+++ b/thunar/thunar-util.c
@@ -48,36 +48,6 @@
 
 
 /**
- * thunar_util_looks_like_an_uri:
- * @string : an input string.
- *
- * Returns %TRUE if the @string looks like an URI
- * according to RFC 2396, %FALSE otherwise.
- *
- * Return value: %TRUE if @string looks like an URI.
- **/
-gboolean
-thunar_util_looks_like_an_uri (const gchar *string)
-{
-  _thunar_return_val_if_fail (string != NULL, FALSE);
-
-  /* <scheme> starts with an alpha character */
-  if (g_ascii_isalpha (*string))
-    {
-      /* <scheme> continues with (alpha | digit | "+" | "-" | ".")* */
-      for (++string; g_ascii_isalnum (*string) || *string == '+' || *string == '-' || *string == '.'; ++string)
-        ;
-
-      /* <scheme> must be followed by ":" */
-      return (*string == ':');
-    }
-
-  return FALSE;
-}
-
-
-
-/**
  * thunar_util_expand_filename:
  * @filename : a local filename.
  * @error    : return location for errors or %NULL.



More information about the Xfce4-commits mailing list