diff options
author | Alan Fitton <ajf@eth0.org.uk> | 2011-10-03 09:36:52 +0000 |
---|---|---|
committer | Alan Fitton <ajf@eth0.org.uk> | 2011-10-03 09:36:52 +0000 |
commit | 5ce226277955a7d1aa6f5d0e00acb2ee98041003 (patch) | |
tree | abe471016e38d7ea8d9559eee35afe0ef6687261 /src/util.c | |
parent | a9780439e066ea76d7b5aa6af66a8a539c59b0cf (diff) |
use an icon for file wanted/unwanted
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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); } |