totem-pl-parser r263 - in trunk: . docs/reference plparse
- From: pwithnall svn gnome org
- To: svn-commits-list gnome org
- Subject: totem-pl-parser r263 - in trunk: . docs/reference plparse
- Date: Fri, 5 Dec 2008 23:04:48 +0000 (UTC)
Author: pwithnall
Date: Fri Dec 5 23:04:48 2008
New Revision: 263
URL: http://svn.gnome.org/viewvc/totem-pl-parser?rev=263&view=rev
Log:
2008-12-05 Philip Withnall <philip tecnocode co uk>
* docs/reference/totem-pl-parser-sections.txt:
* plparse/disc-test.c (main):
* plparse/test-parser.c (test_relative_real),
(entry_metadata_foreach), (test_parsing_real),
(test_data_get_data), (main):
* plparse/totem-disc.c (totem_cd_detect_type_from_dir),
(totem_cd_detect_type_with_url):
* plparse/totem-disc.h:
* plparse/totem-pl-parser-lines.c (totem_pl_parser_uri_to_dos),
(totem_pl_parser_write_m3u), (totem_pl_parser_parse_ram_uri),
(totem_pl_parser_add_ram), (totem_pl_parser_add_m3u):
* plparse/totem-pl-parser-media.c (totem_pl_parser_add_iso),
(totem_pl_parser_add_cue), (totem_pl_parser_add_directory),
(totem_pl_parser_add_block):
* plparse/totem-pl-parser-misc.c (totem_pl_parser_add_gvp):
* plparse/totem-pl-parser-pla.c (totem_pl_parser_add_pla):
* plparse/totem-pl-parser-pls.c (totem_pl_parser_write_pls),
(totem_pl_parser_add_pls_with_contents):
* plparse/totem-pl-parser-podcast.c (parse_rss_item),
(parse_rss_items), (totem_pl_parser_add_rss),
(totem_pl_parser_add_itpc), (totem_pl_parser_add_zune),
(parse_atom_entry), (parse_atom_entries),
(totem_pl_parser_add_atom), (totem_pl_parser_get_feed_uri),
(totem_pl_parser_get_itms_uri), (totem_pl_parser_add_itms),
(totem_pl_parser_is_itms_feed), (parse_opml_outline),
(parse_opml_head_body), (totem_pl_parser_add_opml):
* plparse/totem-pl-parser-private.h:
* plparse/totem-pl-parser-qt.c
(totem_pl_parser_add_quicktime_rtsptext),
(totem_pl_parser_add_quicktime_metalink),
(totem_pl_parser_add_quicktime):
* plparse/totem-pl-parser-smil.c (parse_smil_entry):
* plparse/totem-pl-parser-wm.c
(totem_pl_parser_add_asf_reference_parser),
(totem_pl_parser_add_asf_parser), (parse_asx_entry),
(parse_asx_entryref), (parse_asx_entries),
(totem_pl_parser_add_asx):
* plparse/totem-pl-parser-xspf.c (totem_pl_parser_write_xspf),
(parse_xspf_track):
* plparse/totem-pl-parser.c (totem_pl_parser_class_init),
(my_g_file_info_get_mime_type_with_data),
(totem_pl_parser_base_uri), (totem_pl_parser_num_entries),
(totem_pl_parser_add_uri_valist), (totem_pl_parser_add_uri),
(totem_pl_parser_add_one_uri), (totem_pl_parser_add_one_file),
(totem_pl_parser_scheme_is_ignored), (totem_pl_parser_ignore),
(totem_pl_parser_parse_internal),
(totem_pl_parser_parse_with_base), (totem_pl_parser_parse):
* plparse/totem-pl-parser.h: Cleanup usage of URL/URI/MRL in the
playlist parser. Note that this doesn't break API. (Closes: #536107)
Modified:
trunk/ChangeLog
trunk/docs/reference/totem-pl-parser-sections.txt
trunk/plparse/disc-test.c
trunk/plparse/test-parser.c
trunk/plparse/totem-disc.c
trunk/plparse/totem-disc.h
trunk/plparse/totem-pl-parser-lines.c
trunk/plparse/totem-pl-parser-media.c
trunk/plparse/totem-pl-parser-misc.c
trunk/plparse/totem-pl-parser-pla.c
trunk/plparse/totem-pl-parser-pls.c
trunk/plparse/totem-pl-parser-podcast.c
trunk/plparse/totem-pl-parser-private.h
trunk/plparse/totem-pl-parser-qt.c
trunk/plparse/totem-pl-parser-smil.c
trunk/plparse/totem-pl-parser-wm.c
trunk/plparse/totem-pl-parser-xspf.c
trunk/plparse/totem-pl-parser.c
trunk/plparse/totem-pl-parser.h
Modified: trunk/docs/reference/totem-pl-parser-sections.txt
==============================================================================
--- trunk/docs/reference/totem-pl-parser-sections.txt (original)
+++ trunk/docs/reference/totem-pl-parser-sections.txt Fri Dec 5 23:04:48 2008
@@ -13,17 +13,18 @@
totem_pl_parser_write_with_title
totem_pl_parser_parse_duration
totem_pl_parser_parse_date
-totem_pl_parser_resolve_url
totem_pl_parser_add_ignored_scheme
totem_pl_parser_add_ignored_mimetype
-TOTEM_PL_PARSER_FIELD_URL
+TOTEM_PL_PARSER_FIELD_URI
TOTEM_PL_PARSER_FIELD_GENRE
TOTEM_PL_PARSER_FIELD_TITLE
TOTEM_PL_PARSER_FIELD_AUTHOR
+TOTEM_PL_PARSER_FIELD_ALBUM
TOTEM_PL_PARSER_FIELD_BASE
TOTEM_PL_PARSER_FIELD_VOLUME
TOTEM_PL_PARSER_FIELD_AUTOPLAY
TOTEM_PL_PARSER_FIELD_DURATION
+TOTEM_PL_PARSER_FIELD_DURATION_MS
TOTEM_PL_PARSER_FIELD_STARTTIME
TOTEM_PL_PARSER_FIELD_ENDTIME
TOTEM_PL_PARSER_FIELD_COPYRIGHT
@@ -37,7 +38,9 @@
TOTEM_PL_PARSER_FIELD_FILESIZE
TOTEM_PL_PARSER_FIELD_LANGUAGE
TOTEM_PL_PARSER_FIELD_CONTACT
-TOTEM_PL_PARSER_FIELD_IMAGE_URL
+TOTEM_PL_PARSER_FIELD_IMAGE_URI
+TOTEM_PL_PARSER_FIELD_DOWNLOAD_URI
+TOTEM_PL_PARSER_FIELD_ID
TOTEM_PL_PARSER_FIELD_IS_PLAYLIST
<SUBSECTION Standard>
TOTEM_PL_PARSER
Modified: trunk/plparse/disc-test.c
==============================================================================
--- trunk/plparse/disc-test.c (original)
+++ trunk/plparse/disc-test.c Fri Dec 5 23:04:48 2008
@@ -31,7 +31,7 @@
TotemDiscMediaType type;
GError *error = NULL;
const char *type_s = NULL;
- char *url = NULL;
+ char *uri = NULL;
gboolean is_dir = FALSE;
GList *or, *list;
GVolumeMonitor *mon;
@@ -46,10 +46,10 @@
g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL);
if (g_file_test (argv[1], G_FILE_TEST_IS_DIR) != FALSE) {
- type = totem_cd_detect_type_from_dir (argv[1], &url, &error);
+ type = totem_cd_detect_type_from_dir (argv[1], &uri, &error);
is_dir = TRUE;
} else {
- type = totem_cd_detect_type_with_url (argv[1], &url, &error);
+ type = totem_cd_detect_type_with_url (argv[1], &uri, &error);
}
switch (type) {
@@ -106,11 +106,11 @@
g_print ("%s contains a %s\n", argv[1], type_s);
- if (url != NULL) {
- g_print ("URL for directory is %s\n", url);
+ if (uri != NULL) {
+ g_print ("URI for directory is %s\n", uri);
}
- g_free (url);
+ g_free (uri);
return 0;
}
Modified: trunk/plparse/test-parser.c
==============================================================================
--- trunk/plparse/test-parser.c (original)
+++ trunk/plparse/test-parser.c Fri Dec 5 23:04:48 2008
@@ -38,18 +38,18 @@
#define error(x...) { g_warning (x); exit(1); }
static void
-test_relative_real (const char *url, const char *output, const char *expected)
+test_relative_real (const char *uri, const char *output, const char *expected)
{
GFile *output_file;
char *base;
output_file = g_file_new_for_commandline_arg (output);
- base = totem_pl_parser_relative (output_file, url);
+ base = totem_pl_parser_relative (output_file, uri);
g_object_unref (output_file);
if (base == NULL && expected == NULL) {
g_print ("Relative: '%s' with output '%s' has no relative path\n",
- url, output);
+ uri, output);
return;
}
@@ -58,21 +58,21 @@
|| (strcmp (base, expected) != 0)) {
if (base == NULL) {
error ("Relative: '%s' with output '%s' got no relative path (expected '%s')",
- url, output, expected);
+ uri, output, expected);
} else {
error ("Relative: '%s' with output '%s' got '%s' (expected '%s')",
- url, output, base, expected ? expected : "none");
+ uri, output, base, expected ? expected : "none");
g_free (base);
}
return;
}
- g_print ("Relative: '%s' with output '%s' got '%s'\n", url, output, base);
+ g_print ("Relative: '%s' with output '%s' got '%s'\n", uri, output, base);
#if 0
{
char *dos;
- dos = totem_pl_parser_url_to_dos (url, output);
+ dos = totem_pl_parser_uri_to_dos (uri, output);
g_print ("DOS path: %s\n", dos);
g_print ("\n");
g_free (dos);
@@ -175,7 +175,7 @@
const char *value,
gpointer data)
{
- if (g_ascii_strcasecmp (key, TOTEM_PL_PARSER_FIELD_URL) == 0)
+ if (g_ascii_strcasecmp (key, TOTEM_PL_PARSER_FIELD_URI) == 0)
return;
if (g_ascii_strcasecmp (key, TOTEM_PL_PARSER_FIELD_DESCRIPTION) == 0
&& strlen (value) > MAX_DESCRIPTION_LEN) {
@@ -216,21 +216,21 @@
}
static void
-test_parsing_real (TotemPlParser *pl, const char *url)
+test_parsing_real (TotemPlParser *pl, const char *uri)
{
TotemPlParserResult res;
- res = totem_pl_parser_parse_with_base (pl, url, option_base_uri, FALSE);
+ res = totem_pl_parser_parse_with_base (pl, uri, option_base_uri, FALSE);
if (res != TOTEM_PL_PARSER_RESULT_SUCCESS) {
switch (res) {
case TOTEM_PL_PARSER_RESULT_UNHANDLED:
- g_print ("url '%s' unhandled\n", url);
+ g_print ("URI '%s' unhandled\n", uri);
break;
case TOTEM_PL_PARSER_RESULT_ERROR:
- g_print ("error handling url '%s'\n", url);
+ g_print ("error handling URI '%s'\n", uri);
break;
case TOTEM_PL_PARSER_RESULT_IGNORED:
- g_print ("ignored url '%s'\n", url);
+ g_print ("ignored URI '%s'\n", uri);
break;
default:
g_assert_not_reached ();
@@ -285,7 +285,7 @@
/* Open the file. */
stream = g_file_read (file, NULL, &error);
if (stream == NULL) {
- g_print ("URL '%s' couldn't be opened in test_data_get_data: '%s'\n", uri, error->message);
+ g_print ("URI '%s' couldn't be opened in test_data_get_data: '%s'\n", uri, error->message);
g_error_free (error);
return NULL;
}
@@ -299,7 +299,7 @@
}
if (bytes_read == -1) {
- g_message ("URL '%s' couldn't be read or closed in _get_mime_type_with_data: '%s'\n", uri, error->message);
+ g_message ("URI '%s' couldn't be read or closed in _get_mime_type_with_data: '%s'\n", uri, error->message);
g_error_free (error);
g_free (buffer);
return NULL;
@@ -414,7 +414,7 @@
g_print ("Error parsing arguments: %s\n", error->message);
g_error_free (error);
- g_print ("Usage: %s <-n | --no-recurse> <-d | --debug> <-h | --help> <-t | --data > <-u | --disable-unsafe> <url>\n", argv[0]);
+ g_print ("Usage: %s <-n | --no-recurse> <-d | --debug> <-h | --help> <-t | --data > <-u | --disable-unsafe> <uri>\n", argv[0]);
exit (1);
}
Modified: trunk/plparse/totem-disc.c
==============================================================================
--- trunk/plparse/totem-disc.c (original)
+++ trunk/plparse/totem-disc.c Fri Dec 5 23:04:48 2008
@@ -35,6 +35,13 @@
*
* This file has various different disc utility functions for getting
* the media types and labels of discs.
+ *
+ * The functions in this file refer to MRLs, which are a special form
+ * of URIs used by xine to refer to things such as DVDs. An example of
+ * an MRL would be <example>dvd:///dev/scd0</example>, which is not a
+ * valid URI as far as, for example, GIO is concerned.
+ *
+ * The rest of the totem-pl-parser API exclusively uses URIs.
**/
#include "config.h"
@@ -651,11 +658,11 @@
/**
* totem_cd_detect_type_from_dir:
* @dir: a directory URI
- * @url: return location for the disc's MRL, or %NULL
+ * @mrl: return location for the disc's MRL, or %NULL
* @error: return location for a #GError, or %NULL
*
* Detects the disc's type, given its mount directory URI. If
- * a string pointer is passed to @url, it will return the disc's
+ * a string pointer is passed to @mrl, it will return the disc's
* MRL as from totem_cd_mrl_from_type().
*
* Note that this function does synchronous I/O.
@@ -669,7 +676,7 @@
* Return value: #TotemDiscMediaType corresponding to the disc's type, or #MEDIA_TYPE_ERROR on failure
**/
TotemDiscMediaType
-totem_cd_detect_type_from_dir (const char *dir, char **url, GError **error)
+totem_cd_detect_type_from_dir (const char *dir, char **mrl, GError **error)
{
CdCache *cache;
TotemDiscMediaType type;
@@ -700,15 +707,15 @@
}
}
- if (url == NULL) {
+ if (mrl == NULL) {
cd_cache_free (cache);
return type;
}
if (type == MEDIA_TYPE_DVD) {
- *url = totem_cd_mrl_from_type ("dvd", cache->mountpoint);
+ *mrl = totem_cd_mrl_from_type ("dvd", cache->mountpoint);
} else if (type == MEDIA_TYPE_VCD) {
- *url = totem_cd_mrl_from_type ("vcd", cache->mountpoint);
+ *mrl = totem_cd_mrl_from_type ("vcd", cache->mountpoint);
}
cd_cache_free (cache);
@@ -719,11 +726,11 @@
/**
* totem_cd_detect_type_with_url:
* @device: a device node path
- * @url: return location for the disc's MRL, or %NULL
+ * @mrl: return location for the disc's MRL, or %NULL
* @error: return location for a #GError, or %NULL
*
* Detects the disc's type, given its device node path. If
- * a string pointer is passed to @url, it will return the disc's
+ * a string pointer is passed to @mrl, it will return the disc's
* MRL as from totem_cd_mrl_from_type().
*
* Note that this function does synchronous I/O.
@@ -734,14 +741,14 @@
**/
TotemDiscMediaType
totem_cd_detect_type_with_url (const char *device,
- char **url,
+ char **mrl,
GError **error)
{
CdCache *cache;
TotemDiscMediaType type;
- if (url != NULL)
- *url = NULL;
+ if (mrl != NULL)
+ *mrl = NULL;
if (!(cache = cd_cache_new (device, error)))
return MEDIA_TYPE_ERROR;
@@ -758,7 +765,7 @@
/* crap, nothing found */
}
- if (url == NULL) {
+ if (mrl == NULL) {
cd_cache_free (cache);
return type;
}
@@ -772,7 +779,7 @@
str = cache->mountpoint ? cache->mountpoint : device;
else
str = cache->device;
- *url = totem_cd_mrl_from_type ("dvd", str);
+ *mrl = totem_cd_mrl_from_type ("dvd", str);
}
break;
case MEDIA_TYPE_VCD:
@@ -783,7 +790,7 @@
str = cache->mountpoint ? cache->mountpoint : device;
else
str = cache->device;
- *url = totem_cd_mrl_from_type ("vcd", str);
+ *mrl = totem_cd_mrl_from_type ("vcd", str);
}
break;
case MEDIA_TYPE_CDDA:
@@ -792,9 +799,9 @@
dev = cache->device ? cache->device : device;
if (g_str_has_prefix (dev, "/dev/") != FALSE)
- *url = totem_cd_mrl_from_type ("cdda", dev + 5);
+ *mrl = totem_cd_mrl_from_type ("cdda", dev + 5);
else
- *url = totem_cd_mrl_from_type ("cdda", dev);
+ *mrl = totem_cd_mrl_from_type ("cdda", dev);
}
break;
case MEDIA_TYPE_DATA:
@@ -802,7 +809,7 @@
type = MEDIA_TYPE_ERROR;
/* No error, it's just not usable */
} else {
- *url = g_strdup (cache->mountpoint);
+ *mrl = g_strdup (cache->mountpoint);
}
break;
default:
Modified: trunk/plparse/totem-disc.h
==============================================================================
--- trunk/plparse/totem-disc.h (original)
+++ trunk/plparse/totem-disc.h Fri Dec 5 23:04:48 2008
@@ -54,10 +54,10 @@
TotemDiscMediaType totem_cd_detect_type (const char *device,
GError **error);
TotemDiscMediaType totem_cd_detect_type_with_url (const char *device,
- char **url,
+ char **mrl,
GError **error);
TotemDiscMediaType totem_cd_detect_type_from_dir (const char *dir,
- char **url,
+ char **mrl,
GError **error);
const char * totem_cd_get_human_readable_name (TotemDiscMediaType type);
char * totem_cd_mrl_from_type (const char *scheme, const char *dir);
Modified: trunk/plparse/totem-pl-parser-lines.c
==============================================================================
--- trunk/plparse/totem-pl-parser-lines.c (original)
+++ trunk/plparse/totem-pl-parser-lines.c Fri Dec 5 23:04:48 2008
@@ -45,15 +45,15 @@
#define EXTVLCOPT "#EXTVLCOPT"
static char *
-totem_pl_parser_url_to_dos (const char *url, GFile *output)
+totem_pl_parser_uri_to_dos (const char *uri, GFile *output)
{
char *retval, *i;
- /* Get a relative URL if there is one */
- retval = totem_pl_parser_relative (output, url);
+ /* Get a relative URI if there is one */
+ retval = totem_pl_parser_relative (output, uri);
if (retval == NULL)
- retval = g_strdup (url);
+ retval = g_strdup (uri);
/* Don't change URIs, but change smb:// */
if (g_str_has_prefix (retval, "smb://") != FALSE) {
@@ -105,19 +105,19 @@
for (i = 1; i <= num_entries_total; i++) {
GtkTreeIter iter;
- char *url, *title, *path2;
+ char *uri, *title, *path2;
gboolean custom_title;
GFile *file;
if (gtk_tree_model_iter_nth_child (model, &iter, NULL, i - 1) == FALSE)
continue;
- func (model, &iter, &url, &title, &custom_title, user_data);
+ func (model, &iter, &uri, &title, &custom_title, user_data);
- file = g_file_new_for_uri (url);
+ file = g_file_new_for_uri (uri);
if (totem_pl_parser_scheme_is_ignored (parser, file) != FALSE) {
g_object_unref (file);
- g_free (url);
+ g_free (uri);
g_free (title);
continue;
}
@@ -129,7 +129,7 @@
g_free (buf);
if (success == FALSE) {
g_free (title);
- g_free (url);
+ g_free (uri);
return FALSE;
}
}
@@ -138,20 +138,20 @@
if (dos_compatible == FALSE) {
char *tmp;
- tmp = totem_pl_parser_relative (output, url);
+ tmp = totem_pl_parser_relative (output, uri);
- if (tmp == NULL && g_str_has_prefix (url, "file:")) {
- path2 = g_filename_from_uri (url, NULL, NULL);
+ if (tmp == NULL && g_str_has_prefix (uri, "file:")) {
+ path2 = g_filename_from_uri (uri, NULL, NULL);
} else {
path2 = tmp;
}
} else {
- path2 = totem_pl_parser_url_to_dos (url, output);
+ path2 = totem_pl_parser_uri_to_dos (uri, output);
}
- buf = g_strdup_printf ("%s%s", path2 ? path2 : url, cr);
+ buf = g_strdup_printf ("%s%s", path2 ? path2 : uri, cr);
g_free (path2);
- g_free (url);
+ g_free (uri);
success = totem_pl_parser_write_string (G_OUTPUT_STREAM (stream), buf, error);
g_free (buf);
@@ -166,39 +166,39 @@
}
static void
-totem_pl_parser_parse_ram_url (TotemPlParser *parser, const char *url)
+totem_pl_parser_parse_ram_uri (TotemPlParser *parser, const char *uri)
{
char *mark, **params;
GString *str;
guint i, num_params;
char *title, *author, *copyright, *abstract, *screensize, *mode, *start, *end;
- if (g_str_has_prefix (url, "rtsp://") == FALSE
- && g_str_has_prefix (url, "pnm://") == FALSE) {
- totem_pl_parser_add_one_url (parser, url, NULL);
+ if (g_str_has_prefix (uri, "rtsp://") == FALSE
+ && g_str_has_prefix (uri, "pnm://") == FALSE) {
+ totem_pl_parser_add_one_uri (parser, uri, NULL);
return;
}
/* Look for "?" */
- mark = strstr (url, "?");
+ mark = strstr (uri, "?");
if (mark == NULL) {
- totem_pl_parser_add_one_url (parser, url, NULL);
+ totem_pl_parser_add_one_uri (parser, uri, NULL);
return;
}
if (mark[1] == '\0') {
- char *new_url;
+ char *new_uri;
- new_url = g_strndup (url, mark + 1 - url);
- totem_pl_parser_add_one_url (parser, new_url, NULL);
- g_free (new_url);
+ new_uri = g_strndup (uri, mark + 1 - uri);
+ totem_pl_parser_add_one_uri (parser, new_uri, NULL);
+ g_free (new_uri);
return;
}
title = author = copyright = abstract = screensize = mode = end = start = NULL;
num_params = 0;
- str = g_string_new_len (url, mark - url);
+ str = g_string_new_len (uri, mark - uri);
params = g_strsplit (mark + 1, "&", -1);
for (i = 0; params[i] != NULL; i++) {
if (g_str_has_prefix (params[i], "title=") != FALSE) {
@@ -227,8 +227,8 @@
}
}
- totem_pl_parser_add_url (parser,
- TOTEM_PL_PARSER_FIELD_URL, str->str,
+ totem_pl_parser_add_uri (parser,
+ TOTEM_PL_PARSER_FIELD_URI, str->str,
TOTEM_PL_PARSER_FIELD_TITLE, title,
TOTEM_PL_PARSER_FIELD_AUTHOR, author,
TOTEM_PL_PARSER_FIELD_COPYRIGHT, copyright,
@@ -279,7 +279,7 @@
line_file = g_file_new_for_uri (lines[i]);
/* .ram files can contain .smil entries */
if (totem_pl_parser_parse_internal (parser, line_file, NULL) != TOTEM_PL_PARSER_RESULT_SUCCESS)
- totem_pl_parser_parse_ram_url (parser, lines[i]);
+ totem_pl_parser_parse_ram_uri (parser, lines[i]);
g_object_unref (line_file);
} else if (strcmp (lines[i], "--stop--") == 0) {
/* For Real Media playlists, handle the stop command */
@@ -290,13 +290,13 @@
char *base;
/* Try with a base */
- base = totem_pl_parser_base_url (url);
+ base = totem_pl_parser_base_uri (uri);
if (totem_pl_parser_parse_internal (parser, lines[i], base) != TOTEM_PL_PARSER_RESULT_SUCCESS)
{
char *fullpath;
fullpath = g_strdup_printf ("%s/%s", base, lines[i]);
- totem_pl_parser_parse_ram_url (parser, fullpath);
+ totem_pl_parser_parse_ram_uri (parser, fullpath);
g_free (fullpath);
}
g_free (base);
@@ -405,57 +405,57 @@
/* Either it's a URI, or it has a proper path ... */
if (strstr(lines[i], "://") != NULL
|| lines[i][0] == G_DIR_SEPARATOR) {
- GFile *url;
+ GFile *uri;
- url = g_file_new_for_commandline_arg (lines[i]);
- if (totem_pl_parser_parse_internal (parser, url, NULL) != TOTEM_PL_PARSER_RESULT_SUCCESS) {
- totem_pl_parser_add_one_url (parser, lines[i],
+ uri = g_file_new_for_commandline_arg (lines[i]);
+ if (totem_pl_parser_parse_internal (parser, uri, NULL) != TOTEM_PL_PARSER_RESULT_SUCCESS) {
+ totem_pl_parser_add_one_uri (parser, lines[i],
totem_pl_parser_get_extinfo_title (extinfo));
}
- g_object_unref (url);
+ g_object_unref (uri);
extinfo = NULL;
} else if (g_ascii_isalpha (lines[i][0]) != FALSE
&& g_str_has_prefix (lines[i] + 1, ":\\")) {
/* Path relative to a drive on Windows, we need to use
* the base that was passed to us */
- GFile *url;
+ GFile *uri;
lines[i] = g_strdelimit (lines[i], "\\", '/');
/* + 2, skip drive letter */
- url = g_file_get_child (base_file, lines[i] + 2);
- totem_pl_parser_add_one_file (parser, url,
+ uri = g_file_get_child (base_file, lines[i] + 2);
+ totem_pl_parser_add_one_file (parser, uri,
totem_pl_parser_get_extinfo_title (extinfo));
- g_object_unref (url);
+ g_object_unref (uri);
extinfo = NULL;
} else if (lines[i][0] == '\\' && lines[i][1] == '\\') {
/* ... Or it's in the windows smb form
* (\\machine\share\filename), Note drive names
* (C:\ D:\ etc) are unhandled (unknown base for
* drive letters) */
- char *tmpurl;
+ char *tmpuri;
lines[i] = g_strdelimit (lines[i], "\\", '/');
- tmpurl = g_strjoin (NULL, "smb:", lines[i], NULL);
+ tmpuri = g_strjoin (NULL, "smb:", lines[i], NULL);
- totem_pl_parser_add_one_url (parser, lines[i],
+ totem_pl_parser_add_one_uri (parser, lines[i],
totem_pl_parser_get_extinfo_title (extinfo));
extinfo = NULL;
- g_free (tmpurl);
+ g_free (tmpuri);
} else {
/* Try with a base */
- GFile *url, *_base_file;
+ GFile *uri, *_base_file;
char sep;
_base_file = g_file_get_parent (file);
sep = (split_char[0] == '\n' ? '/' : '\\');
if (sep == '\\')
lines[i] = g_strdelimit (lines[i], "\\", '/');
- url = g_file_get_child (_base_file, lines[i]);
+ uri = g_file_get_child (_base_file, lines[i]);
g_object_unref (_base_file);
- totem_pl_parser_add_one_file (parser, url,
+ totem_pl_parser_add_one_file (parser, uri,
totem_pl_parser_get_extinfo_title (extinfo));
- g_object_unref (url);
+ g_object_unref (uri);
extinfo = NULL;
}
}
Modified: trunk/plparse/totem-pl-parser-media.c
==============================================================================
--- trunk/plparse/totem-pl-parser-media.c (original)
+++ trunk/plparse/totem-pl-parser-media.c Fri Dec 5 23:04:48 2008
@@ -129,7 +129,7 @@
char *label;
label = totem_pl_parser_iso_get_title (file);
- totem_pl_parser_add_one_url (parser, retval, label);
+ totem_pl_parser_add_one_uri (parser, retval, label);
g_free (label);
g_free (retval);
return TOTEM_PL_PARSER_RESULT_SUCCESS;
@@ -143,16 +143,16 @@
GFile *file,
GFile *base_file, gpointer data)
{
- char *vcdurl, *path;
+ char *vcduri, *path;
path = g_file_get_path (file);
if (path == NULL)
return TOTEM_PL_PARSER_RESULT_IGNORED;
- vcdurl = totem_cd_mrl_from_type ("vcd", path);
+ vcduri = totem_cd_mrl_from_type ("vcd", path);
g_free (path);
- totem_pl_parser_add_one_url (parser, vcdurl, NULL);
- g_free (vcdurl);
+ totem_pl_parser_add_one_uri (parser, vcduri, NULL);
+ g_free (vcduri);
return TOTEM_PL_PARSER_RESULT_SUCCESS;
}
@@ -222,12 +222,12 @@
{
TotemDiscMediaType type;
GList *list, *l;
- char *media_url, *uri;
+ char *media_uri, *uri;
uri = g_file_get_uri (file);
- type = totem_cd_detect_type_from_dir (uri, &media_url, NULL);
+ type = totem_cd_detect_type_from_dir (uri, &media_uri, NULL);
- if (type != MEDIA_TYPE_DATA && type != MEDIA_TYPE_ERROR && media_url != NULL) {
+ if (type != MEDIA_TYPE_DATA && type != MEDIA_TYPE_ERROR && media_uri != NULL) {
char *basename = NULL, *fname;
fname = g_filename_from_uri (uri, NULL, NULL);
@@ -236,9 +236,9 @@
basename = g_filename_display_basename (fname);
g_free (fname);
}
- totem_pl_parser_add_one_url (parser, media_url, basename);
+ totem_pl_parser_add_one_uri (parser, media_uri, basename);
g_free (basename);
- g_free (media_url);
+ g_free (media_uri);
return TOTEM_PL_PARSER_RESULT_SUCCESS;
}
@@ -260,7 +260,7 @@
char *item_uri;
item_uri = g_file_get_uri (item);
- totem_pl_parser_add_one_url (parser, item_uri, NULL);
+ totem_pl_parser_add_one_uri (parser, item_uri, NULL);
g_free (item_uri);
}
@@ -283,26 +283,26 @@
gpointer data)
{
TotemDiscMediaType type;
- char *media_url, *path;
+ char *media_uri, *path;
GError *err = NULL;
path = g_file_get_path (file);
if (path == NULL)
return TOTEM_PL_PARSER_RESULT_UNHANDLED;
- type = totem_cd_detect_type_with_url (path, &media_url, &err);
+ type = totem_cd_detect_type_with_url (path, &media_uri, &err);
g_free (path);
if (err != NULL) {
- DEBUG(file, g_print ("Couldn't get CD type for URL '%s': %s\n", uri, err->message));
+ DEBUG(file, g_print ("Couldn't get CD type for URI '%s': %s\n", uri, err->message));
g_error_free (err);
}
- if (type == MEDIA_TYPE_DATA || media_url == NULL)
+ if (type == MEDIA_TYPE_DATA || media_uri == NULL)
return TOTEM_PL_PARSER_RESULT_UNHANDLED;
else if (type == MEDIA_TYPE_ERROR)
return TOTEM_PL_PARSER_RESULT_ERROR;
- totem_pl_parser_add_one_url (parser, media_url, NULL);
- g_free (media_url);
+ totem_pl_parser_add_one_uri (parser, media_uri, NULL);
+ g_free (media_uri);
return TOTEM_PL_PARSER_RESULT_SUCCESS;
}
Modified: trunk/plparse/totem-pl-parser-misc.c
==============================================================================
--- trunk/plparse/totem-pl-parser-misc.c (original)
+++ trunk/plparse/totem-pl-parser-misc.c Fri Dec 5 23:04:48 2008
@@ -77,7 +77,7 @@
title = totem_pl_parser_read_ini_line_string_with_sep (lines, "title", FALSE, ":");
- totem_pl_parser_add_one_url (parser, link, title);
+ totem_pl_parser_add_one_uri (parser, link, title);
g_free (link);
g_free (title);
Modified: trunk/plparse/totem-pl-parser-pla.c
==============================================================================
--- trunk/plparse/totem-pl-parser-pla.c (original)
+++ trunk/plparse/totem-pl-parser-pla.c Fri Dec 5 23:04:48 2008
@@ -177,7 +177,7 @@
if (contents[TITLE_OFFSET] != '\0')
{
title = contents + TITLE_OFFSET;
- totem_pl_parser_add_url (parser,
+ totem_pl_parser_add_uri (parser,
TOTEM_PL_PARSER_FIELD_IS_PLAYLIST, TRUE,
TOTEM_PL_PARSER_FIELD_FILE, file,
TOTEM_PL_PARSER_FIELD_TITLE, title,
@@ -216,7 +216,7 @@
break;
}
- totem_pl_parser_add_url (parser, TOTEM_PL_PARSER_FIELD_URL, uri, NULL);
+ totem_pl_parser_add_uri (parser, TOTEM_PL_PARSER_FIELD_URI, uri, NULL);
g_free (uri);
g_free (path);
Modified: trunk/plparse/totem-pl-parser-pls.c
==============================================================================
--- trunk/plparse/totem-pl-parser-pls.c (original)
+++ trunk/plparse/totem-pl-parser-pls.c Fri Dec 5 23:04:48 2008
@@ -76,28 +76,28 @@
for (i = 1; i <= num_entries_total; i++) {
GtkTreeIter iter;
- char *url, *title, *relative;
+ char *uri, *title, *relative;
GFile *file;
gboolean custom_title;
if (gtk_tree_model_iter_nth_child (model, &iter, NULL, i - 1) == FALSE)
continue;
- func (model, &iter, &url, &title, &custom_title, user_data);
+ func (model, &iter, &uri, &title, &custom_title, user_data);
- file = g_file_new_for_uri (url);
+ file = g_file_new_for_uri (uri);
if (totem_pl_parser_scheme_is_ignored (parser, file) != FALSE) {
- g_free (url);
+ g_free (uri);
g_free (title);
g_object_unref (file);
continue;
}
g_object_unref (file);
- relative = totem_pl_parser_relative (output, url);
- buf = g_strdup_printf ("File%d=%s\n", i, relative ? relative : url);
+ relative = totem_pl_parser_relative (output, uri);
+ buf = g_strdup_printf ("File%d=%s\n", i, relative ? relative : uri);
g_free (relative);
- g_free (url);
+ g_free (uri);
success = totem_pl_parser_write_string (G_OUTPUT_STREAM (stream), buf, error);
g_free (buf);
if (success == FALSE) {
@@ -163,7 +163,7 @@
"X-GNOME-Title", dos_mode);
if (playlist_title != NULL) {
- totem_pl_parser_add_url (parser,
+ totem_pl_parser_add_uri (parser,
TOTEM_PL_PARSER_FIELD_IS_PLAYLIST, TRUE,
TOTEM_PL_PARSER_FIELD_FILE, file,
TOTEM_PL_PARSER_FIELD_TITLE, playlist_title,
@@ -239,8 +239,8 @@
target = g_file_new_for_commandline_arg (file_str);
if (length_num < 0 || totem_pl_parser_parse_internal (parser, target, NULL) != TOTEM_PL_PARSER_RESULT_SUCCESS) {
- totem_pl_parser_add_url (parser,
- TOTEM_PL_PARSER_FIELD_URL, file_str,
+ totem_pl_parser_add_uri (parser,
+ TOTEM_PL_PARSER_FIELD_URI, file_str,
TOTEM_PL_PARSER_FIELD_TITLE, title,
TOTEM_PL_PARSER_FIELD_GENRE, genre,
TOTEM_PL_PARSER_FIELD_DURATION, length,
@@ -254,7 +254,7 @@
if (length_num < 0 || totem_pl_parser_parse_internal (parser, target, base_file) != TOTEM_PL_PARSER_RESULT_SUCCESS) {
- totem_pl_parser_add_url (parser,
+ totem_pl_parser_add_uri (parser,
TOTEM_PL_PARSER_FIELD_FILE, target,
TOTEM_PL_PARSER_FIELD_TITLE, title,
TOTEM_PL_PARSER_FIELD_GENRE, genre,
Modified: trunk/plparse/totem-pl-parser-podcast.c
==============================================================================
--- trunk/plparse/totem-pl-parser-podcast.c (original)
+++ trunk/plparse/totem-pl-parser-podcast.c Fri Dec 5 23:04:48 2008
@@ -103,11 +103,11 @@
static TotemPlParserResult
parse_rss_item (TotemPlParser *parser, xml_node_t *parent)
{
- const char *title, *url, *description, *author;
+ const char *title, *uri, *description, *author;
const char *pub_date, *duration, *filesize;
xml_node_t *node;
- title = url = description = author = NULL;
+ title = uri = description = author = NULL;
pub_date = duration = filesize = NULL;
for (node = parent->child; node != NULL; node = node->next) {
@@ -117,7 +117,7 @@
if (g_ascii_strcasecmp (node->name, "title") == 0) {
title = node->data;
} else if (g_ascii_strcasecmp (node->name, "url") == 0) {
- url = node->data;
+ uri = node->data;
} else if (g_ascii_strcasecmp (node->name, "pubDate") == 0) {
pub_date = node->data;
} else if (g_ascii_strcasecmp (node->name, "description") == 0
@@ -135,7 +135,7 @@
tmp = xml_parser_get_property (node, "url");
if (tmp != NULL)
- url = tmp;
+ uri = tmp;
else
continue;
tmp = xml_parser_get_property (node, "length");
@@ -144,9 +144,9 @@
}
}
- if (url != NULL) {
- totem_pl_parser_add_url (parser,
- TOTEM_PL_PARSER_FIELD_URL, url,
+ if (uri != NULL) {
+ totem_pl_parser_add_uri (parser,
+ TOTEM_PL_PARSER_FIELD_URI, uri,
TOTEM_PL_PARSER_FIELD_TITLE, title,
TOTEM_PL_PARSER_FIELD_PUB_DATE, pub_date,
TOTEM_PL_PARSER_FIELD_DESCRIPTION, description,
@@ -160,7 +160,7 @@
}
static TotemPlParserResult
-parse_rss_items (TotemPlParser *parser, const char *url, xml_node_t *parent)
+parse_rss_items (TotemPlParser *parser, const char *uri, xml_node_t *parent)
{
const char *title, *language, *description, *author;
const char *contact, *img, *pub_date, *copyright;
@@ -204,16 +204,16 @@
}
/* Send the info we already have about the feed */
- totem_pl_parser_add_url (parser,
+ totem_pl_parser_add_uri (parser,
TOTEM_PL_PARSER_FIELD_IS_PLAYLIST, TRUE,
- TOTEM_PL_PARSER_FIELD_URL, url,
+ TOTEM_PL_PARSER_FIELD_URI, uri,
TOTEM_PL_PARSER_FIELD_TITLE, title,
TOTEM_PL_PARSER_FIELD_LANGUAGE, language,
TOTEM_PL_PARSER_FIELD_DESCRIPTION, description,
TOTEM_PL_PARSER_FIELD_AUTHOR, author,
TOTEM_PL_PARSER_FIELD_PUB_DATE, pub_date,
TOTEM_PL_PARSER_FIELD_COPYRIGHT, copyright,
- TOTEM_PL_PARSER_FIELD_IMAGE_URL, img,
+ TOTEM_PL_PARSER_FIELD_IMAGE_URI, img,
NULL);
for (node = parent->child; node != NULL; node = node->next) {
@@ -224,7 +224,7 @@
parse_rss_item (parser, node);
}
- totem_pl_parser_playlist_end (parser, url);
+ totem_pl_parser_playlist_end (parser, uri);
return TOTEM_PL_PARSER_RESULT_SUCCESS;
}
@@ -262,11 +262,11 @@
for (channel = doc->child; channel != NULL; channel = channel->next) {
if (g_ascii_strcasecmp (channel->name, "channel") == 0) {
- char *url;
+ char *uri;
- url = g_file_get_uri (file);
- parse_rss_items (parser, url, channel);
- g_free (url);
+ uri = g_file_get_uri (file);
+ parse_rss_items (parser, uri, channel);
+ g_free (uri);
/* One channel per file */
break;
@@ -291,17 +291,17 @@
WARN_NO_CAMEL;
#else
TotemPlParserResult ret;
- char *url, *new_url, *uri_scheme;
+ char *uri, *new_uri, *uri_scheme;
GFile *new_file;
- url = g_file_get_uri (file);
+ uri = g_file_get_uri (file);
uri_scheme = g_file_get_uri_scheme (file);
- new_url = g_strdup_printf ("http%s", url + strlen (uri_scheme));
- g_free (url);
+ new_uri = g_strdup_printf ("http%s", uri + strlen (uri_scheme));
+ g_free (uri);
g_free (uri_scheme);
- new_file = g_file_new_for_uri (new_url);
- g_free (new_url);
+ new_file = g_file_new_for_uri (new_uri);
+ g_free (new_uri);
ret = totem_pl_parser_add_rss (parser, new_file, base_file, data);
@@ -321,25 +321,25 @@
WARN_NO_CAMEL;
#else
TotemPlParserResult ret;
- char *url, *new_url;
+ char *uri, *new_uri;
GFile *new_file;
- url = g_file_get_uri (file);
- if (g_str_has_prefix (url, "zune://subscribe/?") == FALSE) {
- g_free (url);
+ uri = g_file_get_uri (file);
+ if (g_str_has_prefix (uri, "zune://subscribe/?") == FALSE) {
+ g_free (uri);
return TOTEM_PL_PARSER_RESULT_UNHANDLED;
}
- new_url = strchr (url + strlen ("zune://subscribe/?"), '=');
- if (new_url == NULL) {
- g_free (url);
+ new_uri = strchr (uri + strlen ("zune://subscribe/?"), '=');
+ if (new_uri == NULL) {
+ g_free (uri);
return TOTEM_PL_PARSER_RESULT_UNHANDLED;
}
/* Skip over the '=' */
- new_url++;
+ new_uri++;
- new_file = g_file_new_for_uri (new_url);
- g_free (url);
+ new_file = g_file_new_for_uri (new_uri);
+ g_free (uri);
ret = totem_pl_parser_add_rss (parser, new_file, base_file, data);
@@ -356,11 +356,11 @@
static TotemPlParserResult
parse_atom_entry (TotemPlParser *parser, xml_node_t *parent)
{
- const char *title, *author, *img, *url, *filesize;
+ const char *title, *author, *img, *uri, *filesize;
const char *copyright, *pub_date, *description;
xml_node_t *node;
- title = author = img = url = filesize = NULL;
+ title = author = img = uri = filesize = NULL;
copyright = pub_date = description = NULL;
for (node = parent->child; node != NULL; node = node->next) {
@@ -385,7 +385,7 @@
href = xml_parser_get_property (node, "href");
if (href == NULL)
continue;
- url = href;
+ uri = href;
filesize = xml_parser_get_property (node, "length");
} else if (g_ascii_strcasecmp (node->name, "license") == 0) {
const char *href;
@@ -410,11 +410,11 @@
//FIXME handle category
}
- if (url != NULL) {
- totem_pl_parser_add_url (parser,
+ if (uri != NULL) {
+ totem_pl_parser_add_uri (parser,
TOTEM_PL_PARSER_FIELD_TITLE, title,
TOTEM_PL_PARSER_FIELD_AUTHOR, author,
- TOTEM_PL_PARSER_FIELD_URL, url,
+ TOTEM_PL_PARSER_FIELD_URI, uri,
TOTEM_PL_PARSER_FIELD_FILESIZE, filesize,
TOTEM_PL_PARSER_FIELD_COPYRIGHT, copyright,
TOTEM_PL_PARSER_FIELD_PUB_DATE, pub_date,
@@ -426,7 +426,7 @@
}
static TotemPlParserResult
-parse_atom_entries (TotemPlParser *parser, const char *url, xml_node_t *parent)
+parse_atom_entries (TotemPlParser *parser, const char *uri, xml_node_t *parent)
{
const char *title, *pub_date, *description;
const char *author, *img;
@@ -458,14 +458,14 @@
if (g_ascii_strcasecmp (node->name, "entry") == 0) {
if (started == FALSE) {
/* Send the info we already have about the feed */
- totem_pl_parser_add_url (parser,
+ totem_pl_parser_add_uri (parser,
TOTEM_PL_PARSER_FIELD_IS_PLAYLIST, TRUE,
- TOTEM_PL_PARSER_FIELD_URL, url,
+ TOTEM_PL_PARSER_FIELD_URI, uri,
TOTEM_PL_PARSER_FIELD_TITLE, title,
TOTEM_PL_PARSER_FIELD_DESCRIPTION, description,
TOTEM_PL_PARSER_FIELD_AUTHOR, author,
TOTEM_PL_PARSER_FIELD_PUB_DATE, pub_date,
- TOTEM_PL_PARSER_FIELD_IMAGE_URL, img,
+ TOTEM_PL_PARSER_FIELD_IMAGE_URI, img,
NULL);
started = TRUE;
}
@@ -474,7 +474,7 @@
}
}
- totem_pl_parser_playlist_end (parser, url);
+ totem_pl_parser_playlist_end (parser, uri);
return TOTEM_PL_PARSER_RESULT_SUCCESS;
}
@@ -489,7 +489,7 @@
WARN_NO_CAMEL;
#else
xml_node_t* doc;
- char *contents, *url;
+ char *contents, *uri;
gsize size;
if (g_file_load_contents (file, NULL, &contents, &size, NULL, NULL) == FALSE)
@@ -508,9 +508,9 @@
return TOTEM_PL_PARSER_RESULT_ERROR;
}
- url = g_file_get_uri (file);
- parse_atom_entries (parser, url, doc);
- g_free (url);
+ uri = g_file_get_uri (file);
+ parse_atom_entries (parser, uri, doc);
+ g_free (uri);
g_free (contents);
xml_parser_free_tree (doc);
@@ -655,13 +655,13 @@
}
static GFile *
-totem_pl_parser_get_feed_url (const char *data, gsize len)
+totem_pl_parser_get_feed_uri (const char *data, gsize len)
{
xml_node_t* doc;
- const char *url;
+ const char *uri;
GFile *ret;
- url = NULL;
+ uri = NULL;
xml_parser_init (data, len, XML_PARSER_CASE_INSENSITIVE);
if (xml_parser_build_tree_with_options (&doc, XML_PARSER_RELAXED | XML_PARSER_MULTI_TEXT) < 0)
@@ -674,20 +674,20 @@
return NULL;
}
- url = totem_pl_parser_parse_itms_doc (doc);
- if (url == NULL) {
+ uri = totem_pl_parser_parse_itms_doc (doc);
+ if (uri == NULL) {
xml_parser_free_tree (doc);
return NULL;
}
- ret = g_file_new_for_uri (url);
+ ret = g_file_new_for_uri (uri);
xml_parser_free_tree (doc);
return ret;
}
static char *
-totem_pl_parser_get_itms_url (const char *data)
+totem_pl_parser_get_itms_uri (const char *data)
{
char *s, *end, *ret;
#define ITMS_OPEN "<body onload=\"return itmsOpen('"
@@ -717,8 +717,8 @@
#ifndef HAVE_CAMEL
WARN_NO_CAMEL;
#else
- char *contents, *uncompressed, *itms_url;
- GFile *itms_file, *feed_url;
+ char *contents, *uncompressed, *itms_uri;
+ GFile *itms_file, *feed_uri;
TotemPlParserResult ret;
gsize size;
@@ -733,16 +733,16 @@
return TOTEM_PL_PARSER_RESULT_ERROR;
/* Look for the link to the itms on phobos */
- itms_url = totem_pl_parser_get_itms_url (uncompressed);
+ itms_uri = totem_pl_parser_get_itms_uri (uncompressed);
g_free (uncompressed);
} else {
- itms_url= g_file_get_uri (file);
- memcpy (itms_url, "http", 4);
+ itms_uri= g_file_get_uri (file);
+ memcpy (itms_uri, "http", 4);
}
/* Get the phobos linked, in some weird iTunes only format */
- itms_file = g_file_new_for_uri (itms_url);
- g_free (itms_url);
+ itms_file = g_file_new_for_uri (itms_uri);
+ g_free (itms_uri);
if (g_file_load_contents (itms_file, NULL, &contents, &size, NULL, NULL) == FALSE) {
g_object_unref (itms_file);
@@ -756,12 +756,12 @@
return TOTEM_PL_PARSER_RESULT_ERROR;
/* And look in the file for the feedURL */
- feed_url = totem_pl_parser_get_feed_url (uncompressed, strlen (uncompressed) + 1);
- if (feed_url == NULL)
+ feed_uri = totem_pl_parser_get_feed_uri (uncompressed, strlen (uncompressed) + 1);
+ if (feed_uri == NULL)
return TOTEM_PL_PARSER_RESULT_ERROR;
- ret = totem_pl_parser_add_rss (parser, feed_url, NULL, NULL);
- g_object_unref (feed_url);
+ ret = totem_pl_parser_add_rss (parser, feed_uri, NULL, NULL);
+ g_object_unref (feed_uri);
return ret;
#endif /* !HAVE_CAMEL */
@@ -770,31 +770,31 @@
gboolean
totem_pl_parser_is_itms_feed (GFile *file)
{
- char *url;
+ char *uri;
g_return_val_if_fail (file != NULL, FALSE);
- url = g_file_get_uri (file);
+ uri = g_file_get_uri (file);
if (g_file_has_uri_scheme (file, "itms") != FALSE
- && strstr (url, "phobos.apple.com") != NULL
- && strstr (url, "viewPodcast") != NULL) {
- g_free (url);
+ && strstr (uri, "phobos.apple.com") != NULL
+ && strstr (uri, "viewPodcast") != NULL) {
+ g_free (uri);
return TRUE;
}
- if (strstr (url, "phobos.apple.com/") != NULL
- && strstr (url, "viewPodcast") != NULL) {
- g_free (url);
+ if (strstr (uri, "phobos.apple.com/") != NULL
+ && strstr (uri, "viewPodcast") != NULL) {
+ g_free (uri);
return TRUE;
}
- if (strstr (url, "itunes.com/podcast") != NULL) {
- g_free (url);
+ if (strstr (uri, "itunes.com/podcast") != NULL) {
+ g_free (uri);
return TRUE;
}
- g_free (url);
+ g_free (uri);
return FALSE;
}
@@ -803,22 +803,22 @@
parse_opml_outline (TotemPlParser *parser, xml_node_t *parent)
{
xml_node_t* node;
- const char *title, *url;
+ const char *title, *uri;
- title = url = NULL;
+ title = uri = NULL;
for (node = parent->child; node != NULL; node = node->next) {
if (node->name == NULL || g_ascii_strcasecmp (node->name, "outline") != 0)
continue;
- url = xml_parser_get_property (node, "xmlUrl");
+ uri = xml_parser_get_property (node, "xmlUrl");
title = xml_parser_get_property (node, "text");
- if (url == NULL)
+ if (uri == NULL)
continue;
- totem_pl_parser_add_url (parser,
+ totem_pl_parser_add_uri (parser,
TOTEM_PL_PARSER_FIELD_TITLE, title,
- TOTEM_PL_PARSER_FIELD_URL, url,
+ TOTEM_PL_PARSER_FIELD_URI, uri,
NULL);
}
@@ -826,7 +826,7 @@
}
static TotemPlParserResult
-parse_opml_head_body (TotemPlParser *parser, const char *url, xml_node_t *parent)
+parse_opml_head_body (TotemPlParser *parser, const char *uri, xml_node_t *parent)
{
xml_node_t* node;
gboolean started;
@@ -840,9 +840,9 @@
if (g_ascii_strcasecmp (node->name, "body") == 0) {
if (started == FALSE) {
/* Send the info we already have about the feed */
- totem_pl_parser_add_url (parser,
+ totem_pl_parser_add_uri (parser,
TOTEM_PL_PARSER_FIELD_IS_PLAYLIST, TRUE,
- TOTEM_PL_PARSER_FIELD_URL, url,
+ TOTEM_PL_PARSER_FIELD_URI, uri,
NULL);
started = TRUE;
}
@@ -864,7 +864,7 @@
WARN_NO_CAMEL;
#else
xml_node_t* doc;
- char *contents, *url;
+ char *contents, *uri;
gsize size;
if (g_file_load_contents (file, NULL, &contents, &size, NULL, NULL) == FALSE)
@@ -883,9 +883,9 @@
return TOTEM_PL_PARSER_RESULT_ERROR;
}
- url = g_file_get_uri (file);
- parse_opml_head_body (parser, url, doc);
- g_free (url);
+ uri = g_file_get_uri (file);
+ parse_opml_head_body (parser, uri, doc);
+ g_free (uri);
g_free (contents);
xml_parser_free_tree (doc);
Modified: trunk/plparse/totem-pl-parser-private.h
==============================================================================
--- trunk/plparse/totem-pl-parser-private.h (original)
+++ trunk/plparse/totem-pl-parser-private.h Fri Dec 5 23:04:48 2008
@@ -91,7 +91,7 @@
int totem_pl_parser_read_ini_line_int (char **lines, const char *key);
char *totem_pl_parser_read_ini_line_string_with_sep (char **lines, const char *key,
gboolean dos_mode, const char *sep);
-char *totem_pl_parser_base_url (GFile *file);
+char *totem_pl_parser_base_uri (GFile *file);
void totem_pl_parser_playlist_end (TotemPlParser *parser,
const char *playlist_title);
int totem_pl_parser_num_entries (TotemPlParser *parser,
@@ -113,17 +113,17 @@
TotemPlParserResult totem_pl_parser_parse_internal (TotemPlParser *parser,
GFile *file,
GFile *base_file);
-void totem_pl_parser_add_one_url (TotemPlParser *parser,
- const char *url,
+void totem_pl_parser_add_one_uri (TotemPlParser *parser,
+ const char *uri,
const char *title);
void totem_pl_parser_add_one_file (TotemPlParser *parser,
GFile *file,
const char *title);
-void totem_pl_parser_add_url (TotemPlParser *parser,
+void totem_pl_parser_add_uri (TotemPlParser *parser,
const char *first_property_name,
...);
gboolean totem_pl_parser_ignore (TotemPlParser *parser,
- const char *url);
+ const char *uri);
void totem_pl_parser_cleanup_xml (char *string);
#endif /* !TOTEM_PL_PARSER_MINI */
Modified: trunk/plparse/totem-pl-parser-qt.c
==============================================================================
--- trunk/plparse/totem-pl-parser-qt.c (original)
+++ trunk/plparse/totem-pl-parser-qt.c Fri Dec 5 23:04:48 2008
@@ -73,7 +73,7 @@
{
char *contents = NULL;
gboolean dos_mode = FALSE;
- char *volume, *autoplay, *rtspurl;
+ char *volume, *autoplay, *rtspuri;
gsize size;
char **lines;
@@ -90,19 +90,19 @@
autoplay = totem_pl_parser_read_ini_line_string_with_sep
(lines, "autoplay", dos_mode, "=");
- rtspurl = g_strdup (lines[0] + strlen ("RTSPtext"));
- if (rtspurl[0] == '\0') {
- g_free (rtspurl);
- rtspurl = g_strdup (lines[1]);
+ rtspuri = g_strdup (lines[0] + strlen ("RTSPtext"));
+ if (rtspuri[0] == '\0') {
+ g_free (rtspuri);
+ rtspuri = g_strdup (lines[1]);
}
- g_strstrip (rtspurl);
+ g_strstrip (rtspuri);
- totem_pl_parser_add_url (parser,
- TOTEM_PL_PARSER_FIELD_URL, rtspurl,
+ totem_pl_parser_add_uri (parser,
+ TOTEM_PL_PARSER_FIELD_URI, rtspuri,
TOTEM_PL_PARSER_FIELD_VOLUME, volume,
TOTEM_PL_PARSER_FIELD_AUTOPLAY, autoplay,
NULL);
- g_free (rtspurl);
+ g_free (rtspuri);
g_free (volume);
g_free (autoplay);
g_strfreev (lines);
@@ -118,7 +118,7 @@
xml_node_t *doc, *node;
gsize size;
char *contents;
- const char *item_url, *autoplay;
+ const char *item_uri, *autoplay;
gboolean found;
if (g_str_has_prefix (data, "RTSPtext") != FALSE
@@ -176,8 +176,8 @@
return TOTEM_PL_PARSER_RESULT_ERROR;
}
- item_url = xml_parser_get_property (doc, "src");
- if (!item_url) {
+ item_uri = xml_parser_get_property (doc, "src");
+ if (!item_uri) {
xml_parser_free_tree (doc);
return TOTEM_PL_PARSER_RESULT_ERROR;
}
@@ -187,8 +187,8 @@
if (autoplay == NULL)
autoplay = "true";
- totem_pl_parser_add_url (parser,
- TOTEM_PL_PARSER_FIELD_URL, item_url,
+ totem_pl_parser_add_uri (parser,
+ TOTEM_PL_PARSER_FIELD_URI, item_uri,
TOTEM_PL_PARSER_FIELD_AUTOPLAY, autoplay,
NULL);
xml_parser_free_tree (doc);
@@ -203,11 +203,11 @@
gpointer data)
{
if (data == NULL || totem_pl_parser_is_quicktime (data, strlen (data)) == NULL) {
- char *url;
+ char *uri;
- url = g_file_get_uri (file);
- totem_pl_parser_add_one_url (parser, url, NULL);
- g_free (url);
+ uri = g_file_get_uri (file);
+ totem_pl_parser_add_one_uri (parser, uri, NULL);
+ g_free (uri);
return TOTEM_PL_PARSER_RESULT_SUCCESS;
}
Modified: trunk/plparse/totem-pl-parser-smil.c
==============================================================================
--- trunk/plparse/totem-pl-parser-smil.c (original)
+++ trunk/plparse/totem-pl-parser-smil.c Fri Dec 5 23:04:48 2008
@@ -44,11 +44,11 @@
const char *parent_title)
{
xml_node_t *node;
- const char *title, *url, *author, *abstract, *dur, *clip_begin, *copyright;
+ const char *title, *uri, *author, *abstract, *dur, *clip_begin, *copyright;
TotemPlParserResult retval = TOTEM_PL_PARSER_RESULT_ERROR;
title = NULL;
- url = NULL;
+ uri = NULL;
author = NULL;
abstract = NULL;
dur = NULL;
@@ -62,7 +62,7 @@
/* ENTRY should only have one ref and one title nodes */
if (g_ascii_strcasecmp (node->name, "video") == 0 || g_ascii_strcasecmp (node->name, "audio") == 0) {
- url = xml_parser_get_property (node, "src");
+ uri = xml_parser_get_property (node, "src");
title = xml_parser_get_property (node, "title");
author = xml_parser_get_property (node, "author");
dur = xml_parser_get_property (node, "dur");
@@ -70,15 +70,15 @@
abstract = xml_parser_get_property (node, "abstract");
copyright = xml_parser_get_property (node, "copyright");
- if (url != NULL) {
+ if (uri != NULL) {
GFile *resolved;
- if (base_file != NULL && strstr (url, "://") == NULL)
- resolved = g_file_resolve_relative_path (base_file, url);
+ if (base_file != NULL && strstr (uri, "://") == NULL)
+ resolved = g_file_resolve_relative_path (base_file, uri);
else
- resolved = g_file_new_for_uri (url);
+ resolved = g_file_new_for_uri (uri);
- totem_pl_parser_add_url (parser,
+ totem_pl_parser_add_uri (parser,
TOTEM_PL_PARSER_FIELD_FILE, resolved,
TOTEM_PL_PARSER_FIELD_TITLE, title ? title : parent_title,
TOTEM_PL_PARSER_FIELD_ABSTRACT, abstract,
Modified: trunk/plparse/totem-pl-parser-wm.c
==============================================================================
--- trunk/plparse/totem-pl-parser-wm.c (original)
+++ trunk/plparse/totem-pl-parser-wm.c Fri Dec 5 23:04:48 2008
@@ -110,7 +110,7 @@
if (g_str_has_prefix (ref, "http") != FALSE)
memcpy(ref, "mmsh", 4);
- totem_pl_parser_add_one_url (parser, ref, NULL);
+ totem_pl_parser_add_one_uri (parser, ref, NULL);
g_free (ref);
/* Don't try to get Ref2, as it's only ever
@@ -151,7 +151,7 @@
ref = contents + 4;
if (g_str_has_prefix (ref, "http") != FALSE) {
memcpy(ref, "mmsh", 4);
- totem_pl_parser_add_one_url (parser, ref, NULL);
+ totem_pl_parser_add_one_uri (parser, ref, NULL);
retval = TOTEM_PL_PARSER_RESULT_SUCCESS;
}
@@ -166,12 +166,12 @@
xml_node_t *node;
TotemPlParserResult retval = TOTEM_PL_PARSER_RESULT_SUCCESS;
GFile *resolved;
- const char *url;
+ const char *uri;
const char *title, *duration, *starttime, *author;
const char *moreinfo, *abstract, *copyright;
title = NULL;
- url = NULL;
+ uri = NULL;
duration = NULL;
starttime = NULL;
moreinfo = NULL;
@@ -192,8 +192,8 @@
continue;
/* FIXME, should we prefer mms streams, or non-mms?
* See bug #352559 */
- if (url == NULL)
- url = tmp;
+ if (uri == NULL)
+ uri = tmp;
continue;
}
@@ -253,19 +253,19 @@
}
}
- if (url == NULL)
+ if (uri == NULL)
return TOTEM_PL_PARSER_RESULT_ERROR;
- if (base_file != NULL && strstr (url, "://") == NULL)
- resolved = g_file_resolve_relative_path (base_file, url);
+ if (base_file != NULL && strstr (uri, "://") == NULL)
+ resolved = g_file_resolve_relative_path (base_file, uri);
else
- resolved = g_file_new_for_uri (url);
+ resolved = g_file_new_for_uri (uri);
/* .asx files can contain references to other .asx files */
retval = totem_pl_parser_parse_internal (parser, resolved, NULL);
if (retval != TOTEM_PL_PARSER_RESULT_SUCCESS) {
- totem_pl_parser_add_url (parser,
+ totem_pl_parser_add_uri (parser,
TOTEM_PL_PARSER_FIELD_FILE, resolved,
TOTEM_PL_PARSER_FIELD_TITLE, title,
TOTEM_PL_PARSER_FIELD_ABSTRACT, abstract,
@@ -287,23 +287,23 @@
parse_asx_entryref (TotemPlParser *parser, GFile *base_file, xml_node_t *node)
{
TotemPlParserResult retval = TOTEM_PL_PARSER_RESULT_SUCCESS;
- const char *url;
+ const char *uri;
GFile *resolved;
- url = xml_parser_get_property (node, "href");
+ uri = xml_parser_get_property (node, "href");
- if (url == NULL)
+ if (uri == NULL)
return TOTEM_PL_PARSER_RESULT_ERROR;
- if (base_file != NULL && strstr (url, "://") == NULL)
- resolved = g_file_resolve_relative_path (base_file, url);
+ if (base_file != NULL && strstr (uri, "://") == NULL)
+ resolved = g_file_resolve_relative_path (base_file, uri);
else
- resolved = g_file_new_for_uri (url);
+ resolved = g_file_new_for_uri (uri);
/* .asx files can contain references to other .asx files */
retval = totem_pl_parser_parse_internal (parser, resolved, NULL);
if (retval != TOTEM_PL_PARSER_RESULT_SUCCESS) {
- totem_pl_parser_add_url (parser,
+ totem_pl_parser_add_uri (parser,
TOTEM_PL_PARSER_FIELD_FILE, resolved,
NULL);
retval = TOTEM_PL_PARSER_RESULT_SUCCESS;
@@ -315,7 +315,7 @@
//FIXME the retval is completely wrong
static gboolean
-parse_asx_entries (TotemPlParser *parser, const char *url, GFile *base_file, xml_node_t *parent)
+parse_asx_entries (TotemPlParser *parser, const char *uri, GFile *base_file, xml_node_t *parent)
{
char *title = NULL;
GFile *new_base;
@@ -331,9 +331,9 @@
if (g_ascii_strcasecmp (node->name, "title") == 0) {
g_free (title);
title = g_strdup (node->data);
- totem_pl_parser_add_url (parser,
+ totem_pl_parser_add_uri (parser,
TOTEM_PL_PARSER_FIELD_IS_PLAYLIST, TRUE,
- TOTEM_PL_PARSER_FIELD_URL, url,
+ TOTEM_PL_PARSER_FIELD_URI, uri,
TOTEM_PL_PARSER_FIELD_TITLE, title,
NULL);
}
@@ -358,7 +358,7 @@
}
if (g_ascii_strcasecmp (node->name, "repeat") == 0) {
/* Repeat at the top-level */
- if (parse_asx_entries (parser, url, new_base ? new_base : base_file, node) != FALSE)
+ if (parse_asx_entries (parser, uri, new_base ? new_base : base_file, node) != FALSE)
retval = TOTEM_PL_PARSER_RESULT_SUCCESS;
}
}
@@ -366,7 +366,7 @@
if (new_base != NULL)
g_object_unref (new_base);
if (title != NULL)
- totem_pl_parser_playlist_end (parser, url);
+ totem_pl_parser_playlist_end (parser, uri);
g_free (title);
return retval;
@@ -379,7 +379,7 @@
gpointer data)
{
xml_node_t* doc;
- char *contents, *url;
+ char *contents, *uri;
gsize size;
TotemPlParserResult retval = TOTEM_PL_PARSER_RESULT_UNHANDLED;
@@ -403,12 +403,12 @@
return TOTEM_PL_PARSER_RESULT_ERROR;
}
- url = g_file_get_uri (file);
+ uri = g_file_get_uri (file);
- if (parse_asx_entries (parser, url, base_file, doc) != FALSE)
+ if (parse_asx_entries (parser, uri, base_file, doc) != FALSE)
retval = TOTEM_PL_PARSER_RESULT_SUCCESS;
- g_free (url);
+ g_free (uri);
g_free (contents);
xml_parser_free_tree (doc);
Modified: trunk/plparse/totem-pl-parser-xspf.c
==============================================================================
--- trunk/plparse/totem-pl-parser-xspf.c (original)
+++ trunk/plparse/totem-pl-parser-xspf.c Fri Dec 5 23:04:48 2008
@@ -101,31 +101,31 @@
for (i = 1; i <= num_entries_total; i++) {
GtkTreeIter iter;
- char *url, *url_escaped, *relative, *title;
+ char *uri, *uri_escaped, *relative, *title;
GFile *file;
gboolean custom_title;
if (gtk_tree_model_iter_nth_child (model, &iter, NULL, i - 1) == FALSE)
continue;
- func (model, &iter, &url, &title, &custom_title, user_data);
- file = g_file_new_for_uri (url);
+ func (model, &iter, &uri, &title, &custom_title, user_data);
+ file = g_file_new_for_uri (uri);
if (totem_pl_parser_scheme_is_ignored (parser, file) != FALSE) {
g_object_unref (file);
- g_free (url);
+ g_free (uri);
g_free (title);
continue;
}
g_object_unref (file);
- relative = totem_pl_parser_relative (output, url);
- url_escaped = g_markup_escape_text (relative ? relative : url, -1);
+ relative = totem_pl_parser_relative (output, uri);
+ uri_escaped = g_markup_escape_text (relative ? relative : uri, -1);
buf = g_strdup_printf (" <track>\n"
- " <location>%s</location>\n", url_escaped);
+ " <location>%s</location>\n", uri_escaped);
success = totem_pl_parser_write_string (G_OUTPUT_STREAM (stream), buf, error);
- g_free (url);
- g_free (url_escaped);
+ g_free (uri);
+ g_free (uri_escaped);
g_free (relative);
g_free (buf);
if (success == FALSE) {
@@ -161,19 +161,19 @@
xmlNodePtr parent)
{
xmlNodePtr node;
- xmlChar *title, *url, *image_url, *artist, *album, *duration, *moreinfo;
- xmlChar *download_url, *id;
+ xmlChar *title, *uri, *image_uri, *artist, *album, *duration, *moreinfo;
+ xmlChar *download_uri, *id;
GFile *resolved;
TotemPlParserResult retval = TOTEM_PL_PARSER_RESULT_ERROR;
title = NULL;
- url = NULL;
- image_url = NULL;
+ uri = NULL;
+ image_uri = NULL;
artist = NULL;
album = NULL;
duration = NULL;
moreinfo = NULL;
- download_url = NULL;
+ download_uri = NULL;
id = NULL;
for (node = parent->children; node != NULL; node = node->next)
@@ -182,11 +182,11 @@
continue;
if (g_ascii_strcasecmp ((char *)node->name, "location") == 0)
- url = xmlNodeListGetString (doc, node->xmlChildrenNode, 1);
+ uri = xmlNodeListGetString (doc, node->xmlChildrenNode, 1);
else if (g_ascii_strcasecmp ((char *)node->name, "title") == 0)
title = xmlNodeListGetString (doc, node->xmlChildrenNode, 1);
else if (g_ascii_strcasecmp ((char *)node->name, "image") == 0)
- image_url = xmlNodeListGetString (doc, node->xmlChildrenNode, 1);
+ image_uri = xmlNodeListGetString (doc, node->xmlChildrenNode, 1);
/* Last.fm uses creator for the artist */
else if (g_ascii_strcasecmp ((char *)node->name, "creator") == 0)
artist = xmlNodeListGetString (doc, node->xmlChildrenNode, 1);
@@ -200,7 +200,7 @@
if (g_ascii_strcasecmp ((char *) rel, "http://www.last.fm/trackpage") == 0)
moreinfo = xmlNodeListGetString (doc, node->xmlChildrenNode, 1);
else if (g_ascii_strcasecmp ((char *) rel, "http://www.last.fm/freeTrackURL") == 0)
- download_url = xmlNodeListGetString (doc, node->xmlChildrenNode, 1);
+ download_uri = xmlNodeListGetString (doc, node->xmlChildrenNode, 1);
xmlFree (rel);
} else {
/* If we don't have a rel="", then it's not a last.fm playlist */
@@ -212,24 +212,24 @@
id = xmlNodeListGetString (doc, node->xmlChildrenNode, 1);
}
- if (url == NULL) {
+ if (uri == NULL) {
retval = TOTEM_PL_PARSER_RESULT_ERROR;
goto bail;
}
- if (base_file != NULL && strstr ((char *) url, "://") == NULL)
- resolved = g_file_resolve_relative_path (base_file, (const char *) url);
+ if (base_file != NULL && strstr ((char *) uri, "://") == NULL)
+ resolved = g_file_resolve_relative_path (base_file, (const char *) uri);
else
- resolved = g_file_new_for_uri ((const char *) url);
- totem_pl_parser_add_url (parser,
+ resolved = g_file_new_for_uri ((const char *) uri);
+ totem_pl_parser_add_uri (parser,
TOTEM_PL_PARSER_FIELD_FILE, resolved,
TOTEM_PL_PARSER_FIELD_TITLE, title,
TOTEM_PL_PARSER_FIELD_DURATION_MS, duration,
- TOTEM_PL_PARSER_FIELD_IMAGE_URL, image_url,
+ TOTEM_PL_PARSER_FIELD_IMAGE_URI, image_uri,
TOTEM_PL_PARSER_FIELD_AUTHOR, artist,
TOTEM_PL_PARSER_FIELD_ALBUM, album,
TOTEM_PL_PARSER_FIELD_MOREINFO, moreinfo,
- TOTEM_PL_PARSER_FIELD_DOWNLOAD_URL, download_url,
+ TOTEM_PL_PARSER_FIELD_DOWNLOAD_URI, download_uri,
TOTEM_PL_PARSER_FIELD_ID, id,
NULL);
g_object_unref (resolved);
@@ -238,8 +238,8 @@
bail:
SAFE_FREE (title);
- SAFE_FREE (url);
- SAFE_FREE (image_url);
+ SAFE_FREE (uri);
+ SAFE_FREE (image_uri);
SAFE_FREE (artist);
SAFE_FREE (album);
SAFE_FREE (duration);
Modified: trunk/plparse/totem-pl-parser.c
==============================================================================
--- trunk/plparse/totem-pl-parser.c (original)
+++ trunk/plparse/totem-pl-parser.c Fri Dec 5 23:04:48 2008
@@ -135,7 +135,7 @@
typedef const char * (*PlaylistIdenCallback) (const char *data, gsize len);
#ifndef TOTEM_PL_PARSER_MINI
-typedef TotemPlParserResult (*PlaylistCallback) (TotemPlParser *parser, GFile *url, GFile *base_file, gpointer data);
+typedef TotemPlParserResult (*PlaylistCallback) (TotemPlParser *parser, GFile *uri, GFile *base_file, gpointer data);
#endif
typedef struct {
@@ -298,7 +298,7 @@
PROP_RECURSE,
g_param_spec_boolean ("recurse",
"recurse",
- "Whether or not to process URLs further",
+ "Whether or not to process URIs further",
TRUE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
@@ -401,7 +401,7 @@
/* param specs */
totem_pl_parser_pspec_pool = g_param_spec_pool_new (FALSE);
pspec = g_param_spec_string ("url", "url",
- "URL to be added", NULL,
+ "URI to be added", NULL,
G_PARAM_READABLE & G_PARAM_WRITABLE);
g_param_spec_pool_insert (totem_pl_parser_pspec_pool, pspec, TOTEM_TYPE_PL_PARSER);
pspec = g_param_spec_string ("title", "title",
@@ -421,7 +421,7 @@
G_PARAM_READABLE & G_PARAM_WRITABLE);
g_param_spec_pool_insert (totem_pl_parser_pspec_pool, pspec, TOTEM_TYPE_PL_PARSER);
pspec = g_param_spec_string ("base", "base",
- "Base URL of the item to be added", NULL,
+ "Base URI of the item to be added", NULL,
G_PARAM_READABLE & G_PARAM_WRITABLE);
g_param_spec_pool_insert (totem_pl_parser_pspec_pool, pspec, TOTEM_TYPE_PL_PARSER);
pspec = g_param_spec_string ("volume", "volume",
@@ -453,7 +453,7 @@
G_PARAM_READABLE & G_PARAM_WRITABLE);
g_param_spec_pool_insert (totem_pl_parser_pspec_pool, pspec, TOTEM_TYPE_PL_PARSER);
pspec = g_param_spec_string ("moreinfo", "moreinfo",
- "URL to get more information for item to be added", NULL,
+ "URI to get more information for item to be added", NULL,
G_PARAM_READABLE & G_PARAM_WRITABLE);
g_param_spec_pool_insert (totem_pl_parser_pspec_pool, pspec, TOTEM_TYPE_PL_PARSER);
pspec = g_param_spec_string ("screensize", "screensize",
@@ -505,7 +505,7 @@
G_PARAM_READABLE & G_PARAM_WRITABLE);
g_param_spec_pool_insert (totem_pl_parser_pspec_pool, pspec, TOTEM_TYPE_PL_PARSER);
pspec = g_param_spec_string ("download-url", "download-url",
- "String representing the location of a download URL", NULL,
+ "String representing the location of a download URI", NULL,
G_PARAM_READABLE & G_PARAM_WRITABLE);
g_param_spec_pool_insert (totem_pl_parser_pspec_pool, pspec, TOTEM_TYPE_PL_PARSER);
pspec = g_param_spec_string ("id", "id",
@@ -667,11 +667,11 @@
g_error_free (error);
return g_strdup (DIR_MIME_TYPE);
}
- DEBUG(file, g_print ("URL '%s' couldn't be opened in _get_mime_type_with_data: '%s'\n", uri, error->message));
+ DEBUG(file, g_print ("URI '%s' couldn't be opened in _get_mime_type_with_data: '%s'\n", uri, error->message));
g_error_free (error);
return NULL;
}
- DEBUG(file, g_print ("URL '%s' was opened successfully in _get_mime_type_with_data\n", uri));
+ DEBUG(file, g_print ("URI '%s' was opened successfully in _get_mime_type_with_data\n", uri));
/* Read the whole thing, up to MIME_READ_CHUNK_SIZE */
buffer = g_malloc (MIME_READ_CHUNK_SIZE);
@@ -686,7 +686,7 @@
/* Empty file */
if (bytes_read == 0) {
g_free (buffer);
- DEBUG(file, g_print ("URL '%s' is empty in _get_mime_type_with_data\n", uri));
+ DEBUG(file, g_print ("URI '%s' is empty in _get_mime_type_with_data\n", uri));
return g_strdup (EMPTY_FILE_TYPE);
}
@@ -699,22 +699,22 @@
}
/**
- * totem_pl_parser_base_url:
- * @url: a URI
+ * totem_pl_parser_base_uri:
+ * @uri: a URI
*
- * Returns the parent URI of @url.
+ * Returns the parent URI of @uri.
*
- * Return value: a newly-allocated string containing @url's parent URI, or %NULL
+ * Return value: a newly-allocated string containing @uri's parent URI, or %NULL
**/
char *
-totem_pl_parser_base_url (GFile *file)
+totem_pl_parser_base_uri (GFile *uri)
{
GFile *parent;
char *ret;
- parent = g_file_get_parent (file);
+ parent = g_file_get_parent (uri);
ret = g_file_get_uri (parent);
- g_object_unref (file);
+ g_object_unref (uri);
return ret;
}
@@ -816,20 +816,20 @@
for (i = 1; i <= num_entries; i++)
{
GtkTreeIter iter;
- char *url, *title;
+ char *uri, *title;
GFile *file;
gboolean custom_title;
if (gtk_tree_model_iter_nth_child (model, &iter, NULL, i - 1) == FALSE)
return i - ignored;
- func (model, &iter, &url, &title, &custom_title, user_data);
- file = g_file_new_for_uri (url);
+ func (model, &iter, &uri, &title, &custom_title, user_data);
+ file = g_file_new_for_uri (uri);
if (totem_pl_parser_scheme_is_ignored (parser, file) != FALSE)
ignored++;
g_object_unref (file);
- g_free (url);
+ g_free (uri);
g_free (title);
}
@@ -1096,16 +1096,16 @@
}
static void
-totem_pl_parser_add_url_valist (TotemPlParser *parser,
+totem_pl_parser_add_uri_valist (TotemPlParser *parser,
const gchar *first_property_name,
va_list var_args)
{
const char *name;
- char *title, *url;
+ char *title, *uri;
GHashTable *metadata;
gboolean is_playlist;
- title = url = NULL;
+ title = uri = NULL;
is_playlist = FALSE;
g_object_ref (G_OBJECT (parser));
@@ -1137,28 +1137,28 @@
break;
}
- if (strcmp (name, TOTEM_PL_PARSER_FIELD_URL) == 0) {
- if (url == NULL)
- url = g_value_dup_string (&value);
+ if (strcmp (name, TOTEM_PL_PARSER_FIELD_URI) == 0) {
+ if (uri == NULL)
+ uri = g_value_dup_string (&value);
} else if (strcmp (name, TOTEM_PL_PARSER_FIELD_FILE) == 0) {
GFile *file;
file = g_value_get_object (&value);
- url = g_file_get_uri (file);
+ uri = g_file_get_uri (file);
g_value_unset (&value);
name = va_arg (var_args, char*);
continue;
} else if (strcmp (name, TOTEM_PL_PARSER_FIELD_BASE_FILE) == 0) {
GFile *file;
- char *base_url;
+ char *base_uri;
file = g_value_get_object (&value);
- base_url = g_file_get_uri (file);
+ base_uri = g_file_get_uri (file);
g_hash_table_insert (metadata,
g_strdup (TOTEM_PL_PARSER_FIELD_BASE),
- base_url);
+ base_uri);
g_value_unset (&value);
name = va_arg (var_args, char*);
@@ -1206,58 +1206,58 @@
//FIXME fix this! 396710
}
- if (g_hash_table_size (metadata) > 0 || url != NULL) {
+ if (g_hash_table_size (metadata) > 0 || uri != NULL) {
if (is_playlist == FALSE) {
g_signal_emit (G_OBJECT (parser),
totem_pl_parser_table_signals[ENTRY_PARSED],
- 0, url, metadata);
+ 0, uri, metadata);
} else {
g_signal_emit (G_OBJECT (parser),
totem_pl_parser_table_signals[PLAYLIST_STARTED],
- 0, url, metadata);
+ 0, uri, metadata);
}
}
g_hash_table_unref (metadata);
- g_free (url);
+ g_free (uri);
g_object_unref (G_OBJECT (parser));
}
/**
- * totem_pl_parser_add_url:
+ * totem_pl_parser_add_uri:
* @parser: a #TotemPlParser
* @first_property_name: the first property name
* @Varargs: value for the first property, followed optionally by more
* name/value pairs, followed by %NULL
*
- * Adds a URL to the playlist with the properties given in @first_property_name
+ * Adds a URI to the playlist with the properties given in @first_property_name
* and @Varargs.
**/
void
-totem_pl_parser_add_url (TotemPlParser *parser,
+totem_pl_parser_add_uri (TotemPlParser *parser,
const char *first_property_name,
...)
{
va_list var_args;
va_start (var_args, first_property_name);
- totem_pl_parser_add_url_valist (parser, first_property_name, var_args);
+ totem_pl_parser_add_uri_valist (parser, first_property_name, var_args);
va_end (var_args);
}
/**
- * totem_pl_parser_add_one_url:
+ * totem_pl_parser_add_one_uri:
* @parser: a #TotemPlParser
- * @url: the entry's URL
+ * @uri: the entry's URI
* @title: the entry's title
*
- * Adds a single URL entry with only URL and title strings to the playlist.
+ * Adds a single URI entry with only URI and title strings to the playlist.
**/
void
-totem_pl_parser_add_one_url (TotemPlParser *parser, const char *url, const char *title)
+totem_pl_parser_add_one_uri (TotemPlParser *parser, const char *uri, const char *title)
{
- totem_pl_parser_add_url (parser,
- TOTEM_PL_PARSER_FIELD_URL, url,
+ totem_pl_parser_add_uri (parser,
+ TOTEM_PL_PARSER_FIELD_URI, uri,
TOTEM_PL_PARSER_FIELD_TITLE, title,
NULL);
}
@@ -1265,7 +1265,7 @@
void
totem_pl_parser_add_one_file (TotemPlParser *parser, GFile *file, const char *title)
{
- totem_pl_parser_add_url (parser,
+ totem_pl_parser_add_uri (parser,
TOTEM_PL_PARSER_FIELD_FILE, file,
TOTEM_PL_PARSER_FIELD_TITLE, title,
NULL);
@@ -1282,15 +1282,15 @@
/**
* totem_pl_parser_scheme_is_ignored:
* @parser: a #TotemPlParser
- * @url: a URL
+ * @uri: a URI
*
- * Checks to see if @url's scheme is in the @parser's list of
+ * Checks to see if @uri's scheme is in the @parser's list of
* schemes to ignore.
*
- * Return value: %TRUE if @url's scheme is ignored
+ * Return value: %TRUE if @uri's scheme is ignored
**/
gboolean
-totem_pl_parser_scheme_is_ignored (TotemPlParser *parser, GFile *file)
+totem_pl_parser_scheme_is_ignored (TotemPlParser *parser, GFile *uri)
{
GList *l;
@@ -1299,7 +1299,7 @@
for (l = parser->priv->ignore_schemes; l != NULL; l = l->next) {
const char *scheme = l->data;
- if (g_file_has_uri_scheme (file, scheme) != FALSE)
+ if (g_file_has_uri_scheme (uri, scheme) != FALSE)
return TRUE;
}
@@ -1328,28 +1328,28 @@
/**
* totem_pl_parser_ignore:
* @parser: a #TotemPlParser
- * @url: a URL
+ * @uri: a URI
*
- * Checks if the URL should be ignored. URLs are <emphasis>not</emphasis> ignored if:
+ * Checks if the URI should be ignored. URIs are <emphasis>not</emphasis> ignored if:
* <itemizedlist>
* <listitem><para>they have an unknown mimetype,</para></listitem>
* <listitem><para>they have a special mimetype,</para></listitem>
* <listitem><para>they have a mimetype which could be a video or a playlist.</para></listitem>
* </itemizedlist>
*
- * URLs are automatically ignored if their scheme is ignored as per totem_pl_parser_scheme_is_ignored(),
+ * URIs are automatically ignored if their scheme is ignored as per totem_pl_parser_scheme_is_ignored(),
* and are ignored if all the other tests are inconclusive.
*
- * Return value: %TRUE if @url is to be ignored
+ * Return value: %TRUE if @uri is to be ignored
**/
gboolean
-totem_pl_parser_ignore (TotemPlParser *parser, const char *url)
+totem_pl_parser_ignore (TotemPlParser *parser, const char *uri)
{
char *mimetype;
GFile *file;
guint i;
- file = g_file_new_for_path (url);
+ file = g_file_new_for_path (uri);
if (totem_pl_parser_scheme_is_ignored (parser, file) != FALSE) {
g_object_unref (file);
return TRUE;
@@ -1357,7 +1357,7 @@
g_object_unref (file);
//FIXME wrong for win32
- mimetype = g_content_type_guess (url, NULL, 0, NULL);
+ mimetype = g_content_type_guess (uri, NULL, 0, NULL);
if (mimetype == NULL || strcmp (mimetype, UNKNOWN_TYPE) == 0) {
g_free (mimetype);
return FALSE;
@@ -1445,7 +1445,7 @@
|| g_file_has_uri_scheme (file, "rtsp") != FALSE
|| g_file_has_uri_scheme (file, "icy") != FALSE
|| g_file_has_uri_scheme (file, "pnm") != FALSE) {
- DEBUG(file, g_print ("URL '%s' is MMS, RTSP, PNM or ICY, not a playlist\n", uri));
+ DEBUG(file, g_print ("URI '%s' is MMS, RTSP, PNM or ICY, not a playlist\n", uri));
return TOTEM_PL_PARSER_RESULT_UNHANDLED;
}
@@ -1455,16 +1455,16 @@
if (g_file_has_uri_scheme (file, "itpc") != FALSE
|| g_file_has_uri_scheme (file, "feed") != FALSE
|| g_file_has_uri_scheme (file, "zcast") != FALSE) {
- DEBUG(file, g_print ("URL '%s' is getting special cased for ITPC/FEED/ZCAST parsing\n", uri));
+ DEBUG(file, g_print ("URI '%s' is getting special cased for ITPC/FEED/ZCAST parsing\n", uri));
return totem_pl_parser_add_itpc (parser, file, base_file, NULL);
}
if (g_file_has_uri_scheme (file, "zune") != FALSE) {
- DEBUG(file, g_print ("URL '%s' is getting special cased for ZUNE parsing\n", uri));
+ DEBUG(file, g_print ("URI '%s' is getting special cased for ZUNE parsing\n", uri));
return totem_pl_parser_add_zune (parser, file, base_file, NULL);
}
/* Try itms Podcast references, see itunes.py in PenguinTV */
if (totem_pl_parser_is_itms_feed (file) != FALSE) {
- DEBUG(file, g_print ("URL '%s' is getting special cased for ITMS parsing\n", uri));
+ DEBUG(file, g_print ("URI '%s' is getting special cased for ITMS parsing\n", uri));
return totem_pl_parser_add_itms (parser, file, NULL, NULL);
}
@@ -1540,9 +1540,9 @@
for (i = 0; i < G_N_ELEMENTS(special_types); i++) {
if (strcmp (special_types[i].mimetype, mimetype) == 0) {
- DEBUG(file, g_print ("URL '%s' is special type '%s'\n", uri, mimetype));
+ DEBUG(file, g_print ("URI '%s' is special type '%s'\n", uri, mimetype));
if (parser->priv->disable_unsafe != FALSE && special_types[i].unsafe != FALSE) {
- DEBUG(file, g_print ("URL '%s' is unsafe so was ignored\n", uri));
+ DEBUG(file, g_print ("URI '%s' is unsafe so was ignored\n", uri));
g_free (mimetype);
g_free (data);
return TOTEM_PL_PARSER_RESULT_IGNORED;
@@ -1565,7 +1565,7 @@
for (i = 0; i < G_N_ELEMENTS(dual_types) && found == FALSE; i++) {
if (strcmp (dual_types[i].mimetype, mimetype) == 0) {
- DEBUG(file, g_print ("URL '%s' is dual type '%s'\n", uri, mimetype));
+ DEBUG(file, g_print ("URI '%s' is dual type '%s'\n", uri, mimetype));
if (data == NULL) {
g_free (mimetype);
mimetype = my_g_file_info_get_mime_type_with_data (file, &data, parser);
@@ -1618,29 +1618,29 @@
/**
* totem_pl_parser_parse_with_base:
* @parser: a #TotemPlParser
- * @url: the URL of the playlist to parse
+ * @uri: the URI of the playlist to parse
* @base: the base path for relative filenames
- * @fallback: %TRUE if the parser should add the playlist URL to the
+ * @fallback: %TRUE if the parser should add the playlist URI to the
* end of the playlist on parse failure
*
- * Parses a playlist given by the absolute URL @url, using
+ * Parses a playlist given by the absolute URI @uri, using
* @base to resolve relative paths where appropriate.
*
* Return value: a #TotemPlParserResult
**/
TotemPlParserResult
-totem_pl_parser_parse_with_base (TotemPlParser *parser, const char *url,
+totem_pl_parser_parse_with_base (TotemPlParser *parser, const char *uri,
const char *base, gboolean fallback)
{
GFile *file, *base_file;
TotemPlParserResult retval;
g_return_val_if_fail (TOTEM_IS_PL_PARSER (parser), TOTEM_PL_PARSER_RESULT_UNHANDLED);
- g_return_val_if_fail (url != NULL, TOTEM_PL_PARSER_RESULT_UNHANDLED);
- g_return_val_if_fail (strstr (url, "://") != NULL,
+ g_return_val_if_fail (uri != NULL, TOTEM_PL_PARSER_RESULT_UNHANDLED);
+ g_return_val_if_fail (strstr (uri, "://") != NULL,
TOTEM_PL_PARSER_RESULT_ERROR);
- file = g_file_new_for_uri (url);
+ file = g_file_new_for_uri (uri);
base_file = NULL;
if (totem_pl_parser_scheme_is_ignored (parser, file) != FALSE) {
@@ -1664,19 +1664,19 @@
/**
* totem_pl_parser_parse:
* @parser: a #TotemPlParser
- * @url: the URL of the playlist to parse
- * @fallback: %TRUE if the parser should add the playlist URL to the
+ * @uri: the URI of the playlist to parse
+ * @fallback: %TRUE if the parser should add the playlist URI to the
* end of the playlist on parse failure
*
- * Parses a playlist given by the absolute URL @url.
+ * Parses a playlist given by the absolute URI @uri.
*
* Return value: a #TotemPlParserResult
**/
TotemPlParserResult
-totem_pl_parser_parse (TotemPlParser *parser, const char *url,
+totem_pl_parser_parse (TotemPlParser *parser, const char *uri,
gboolean fallback)
{
- return totem_pl_parser_parse_with_base (parser, url, NULL, fallback);
+ return totem_pl_parser_parse_with_base (parser, uri, NULL, fallback);
}
/**
@@ -1685,7 +1685,7 @@
* @scheme: the scheme to ignore
*
* Adds a scheme to the list of schemes to ignore, so that
- * any URL using that scheme is ignored during playlist parsing.
+ * any URI using that scheme is ignored during playlist parsing.
**/
void
totem_pl_parser_add_ignored_scheme (TotemPlParser *parser,
@@ -1708,7 +1708,7 @@
* @mimetype: the mimetype to ignore
*
* Adds a mimetype to the list of mimetypes to ignore, so that
- * any URL of that mimetype is ignored during playlist parsing.
+ * any URI of that mimetype is ignored during playlist parsing.
**/
void
totem_pl_parser_add_ignored_mimetype (TotemPlParser *parser,
Modified: trunk/plparse/totem-pl-parser.h
==============================================================================
--- trunk/plparse/totem-pl-parser.h (original)
+++ trunk/plparse/totem-pl-parser.h Fri Dec 5 23:04:48 2008
@@ -31,6 +31,12 @@
G_BEGIN_DECLS
+/* Compatibility defines */
+#define TOTEM_PL_PARSER_FIELD_URL TOTEM_PL_PARSER_FIELD_URI
+#define TOTEM_PL_PARSER_FIELD_IMAGE_URL TOTEM_PL_PARSER_FIELD_IMAGE_URI
+#define TOTEM_PL_PARSER_FIELD_DOWNLOAD_URL TOTEM_PL_PARSER_FIELD_DOWNLOAD_URI
+/* End */
+
#define TOTEM_TYPE_PL_PARSER (totem_pl_parser_get_type ())
#define TOTEM_PL_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOTEM_TYPE_PL_PARSER, TotemPlParser))
#define TOTEM_PL_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOTEM_TYPE_PL_PARSER, TotemPlParserClass))
@@ -71,11 +77,11 @@
/* Known metadata fields */
/**
- * TOTEM_PL_PARSER_FIELD_URL:
+ * TOTEM_PL_PARSER_FIELD_URI:
*
- * Metadata field for an entry's URL.
+ * Metadata field for an entry's URI.
**/
-#define TOTEM_PL_PARSER_FIELD_URL "url"
+#define TOTEM_PL_PARSER_FIELD_URI "url"
/**
* TOTEM_PL_PARSER_FIELD_GENRE:
*
@@ -171,7 +177,7 @@
/**
* TOTEM_PL_PARSER_FIELD_MOREINFO:
*
- * Metadata field for an entry's "more info" URL.
+ * Metadata field for an entry's "more info" URI.
**/
#define TOTEM_PL_PARSER_FIELD_MOREINFO "moreinfo"
/**
@@ -211,18 +217,18 @@
**/
#define TOTEM_PL_PARSER_FIELD_CONTACT "contact"
/**
- * TOTEM_PL_PARSER_FIELD_IMAGE_URL:
+ * TOTEM_PL_PARSER_FIELD_IMAGE_URI:
*
- * Metadata field for an entry's thumbnail image URL.
+ * Metadata field for an entry's thumbnail image URI.
**/
-#define TOTEM_PL_PARSER_FIELD_IMAGE_URL "image-url"
+#define TOTEM_PL_PARSER_FIELD_IMAGE_URI "image-url"
/**
- * TOTEM_PL_PARSER_FIELD_DOWNLOAD_URL:
+ * TOTEM_PL_PARSER_FIELD_DOWNLOAD_URI:
*
- * Metadata field for an entry's download URL. Only used if an alternate download
+ * Metadata field for an entry's download URI. Only used if an alternate download
* location is available for the entry.
**/
-#define TOTEM_PL_PARSER_FIELD_DOWNLOAD_URL "download-url"
+#define TOTEM_PL_PARSER_FIELD_DOWNLOAD_URI "download-url"
/**
* TOTEM_PL_PARSER_FIELD_ID:
*
@@ -348,9 +354,9 @@
const char *mimetype);
TotemPlParserResult totem_pl_parser_parse (TotemPlParser *parser,
- const char *url, gboolean fallback);
+ const char *uri, gboolean fallback);
TotemPlParserResult totem_pl_parser_parse_with_base (TotemPlParser *parser,
- const char *url,
+ const char *uri,
const char *base,
gboolean fallback);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]