summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2011-10-03 09:36:52 +0000
committerGravatar Alan Fitton <ajf@eth0.org.uk>2011-10-03 09:36:52 +0000
commit5ce226277955a7d1aa6f5d0e00acb2ee98041003 (patch)
treeabe471016e38d7ea8d9559eee35afe0ef6687261 /src/util.c
parenta9780439e066ea76d7b5aa6af66a8a539c59b0cf (diff)
use an icon for file wanted/unwanted
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c7
1 files changed, 6 insertions, 1 deletions
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);
}