[Cache V2 1/1] all: Add identifier to GrlNet constructor
- From: "Juan A. Suarez Romero" <jasuarez igalia com>
- To: grilo-list gnome org
- Subject: [Cache V2 1/1] all: Add identifier to GrlNet constructor
- Date: Fri, 11 Mar 2011 11:07:47 +0100
The new GrlNet constructor requires a unique identifier to be used when cache is supported.
Let's use the SOURCE_ID as that unique identifier.
Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>
---
src/media/apple-trailers/grl-apple-trailers.c | 2 +-
src/media/flickr/gflickr.c | 3 ++-
src/media/jamendo/grl-jamendo.c | 2 +-
src/media/podcasts/grl-podcasts.c | 2 +-
src/media/youtube/grl-youtube.c | 2 +-
src/metadata/lastfm-albumart/grl-lastfm-albumart.c | 2 +-
6 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/media/apple-trailers/grl-apple-trailers.c b/src/media/apple-trailers/grl-apple-trailers.c
index b81748b..7293d02 100644
--- a/src/media/apple-trailers/grl-apple-trailers.c
+++ b/src/media/apple-trailers/grl-apple-trailers.c
@@ -531,7 +531,7 @@ read_url_async (GrlAppleTrailersSource *source,
gpointer user_data)
{
if (!source->priv->wc)
- source->priv->wc = grl_net_wc_new ();
+ source->priv->wc = grl_net_wc_new (SOURCE_ID);
source->priv->cancellable = g_cancellable_new ();
diff --git a/src/media/flickr/gflickr.c b/src/media/flickr/gflickr.c
index 695c7dc..43b3643 100644
--- a/src/media/flickr/gflickr.c
+++ b/src/media/flickr/gflickr.c
@@ -587,7 +587,8 @@ inline static GrlNetWc *
get_wc (GFlickr *f)
{
if (!f->priv->wc)
- f->priv->wc = grl_net_wc_new ();
+ f->priv->wc =
+ grl_net_wc_new (f->priv->auth_token? f->priv->auth_token: "grl-flickr");
return f->priv->wc;
}
diff --git a/src/media/jamendo/grl-jamendo.c b/src/media/jamendo/grl-jamendo.c
index f6ba5c6..e3fbd5f 100644
--- a/src/media/jamendo/grl-jamendo.c
+++ b/src/media/jamendo/grl-jamendo.c
@@ -768,7 +768,7 @@ read_url_async (GrlJamendoSource *source,
gpointer user_data)
{
if (!source->priv->wc)
- source->priv->wc = g_object_new (GRL_TYPE_NET_WC, "throttling", 1, NULL);
+ source->priv->wc = grl_net_wc_new (SOURCE_ID);
source->priv->cancellable = g_cancellable_new ();
diff --git a/src/media/podcasts/grl-podcasts.c b/src/media/podcasts/grl-podcasts.c
index 759a36d..ebbb949 100644
--- a/src/media/podcasts/grl-podcasts.c
+++ b/src/media/podcasts/grl-podcasts.c
@@ -444,7 +444,7 @@ read_url_async (GrlPodcastsSource *source,
if (source->priv->wc)
g_object_unref (source->priv->wc);
- source->priv->wc = grl_net_wc_new ();
+ source->priv->wc = grl_net_wc_new (SOURCE_ID);
grl_net_wc_request_async (source->priv->wc, url, NULL, read_done_cb, arc);
}
diff --git a/src/media/youtube/grl-youtube.c b/src/media/youtube/grl-youtube.c
index 1bc88a7..2deaf4c 100644
--- a/src/media/youtube/grl-youtube.c
+++ b/src/media/youtube/grl-youtube.c
@@ -442,7 +442,7 @@ inline static GrlNetWc *
get_wc ()
{
if (ytsrc && !ytsrc->priv->wc)
- ytsrc->priv->wc = grl_net_wc_new ();
+ ytsrc->priv->wc = grl_net_wc_new (SOURCE_ID);
return ytsrc->priv->wc;
}
diff --git a/src/metadata/lastfm-albumart/grl-lastfm-albumart.c b/src/metadata/lastfm-albumart/grl-lastfm-albumart.c
index cbb6f77..e5b4d0b 100644
--- a/src/metadata/lastfm-albumart/grl-lastfm-albumart.c
+++ b/src/metadata/lastfm-albumart/grl-lastfm-albumart.c
@@ -265,7 +265,7 @@ static void
read_url_async (const gchar *url, gpointer user_data)
{
if (!wc)
- wc = grl_net_wc_new ();
+ wc = grl_net_wc_new (SOURCE_ID);
GRL_DEBUG ("Opening '%s'", url);
grl_net_wc_request_async (wc, url, NULL, read_done_cb, user_data);
--
1.7.4
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]