From 5ce226277955a7d1aa6f5d0e00acb2ee98041003 Mon Sep 17 00:00:00 2001 From: Alan Fitton Date: Mon, 3 Oct 2011 09:36:52 +0000 Subject: use an icon for file wanted/unwanted --- src/util.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/util.c') diff --git a/src/util.c b/src/util.c index 0d147bf..2e0dced 100644 --- a/src/util.c +++ b/src/util.c @@ -33,6 +33,11 @@ #include "util.h" +gboolean is_magnet(gchar *string) +{ + return g_str_has_prefix(string, "magnet:"); +} + gboolean is_url(gchar *string) { //return g_regex_match_simple ("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?", string, 0, 0); @@ -59,7 +64,7 @@ void g_str_slist_free(GSList * list) GRegex *trg_uri_host_regex_new(void) { - return g_regex_new("^[^:/?#]+:?//(?:www\\.|tracker\\.|\\d+\\.)?([^/?#:]*)", + return g_regex_new("^[^:/?#]+:?//(?:www\\.|torrent\\.|torrents\\.|tracker\\.|\\d+\\.)?([^/?#:]*)", G_REGEX_OPTIMIZE, 0, NULL); } -- cgit v1.2.3