summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2014-09-02 18:14:32 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2014-09-02 21:35:40 +0200
commit1d71e83ac3ff7baaee43e0e66daaeeecb4ba96b4 (patch)
tree95e2178c175a6084560286fe71aee2c44ee0d74f
parentfe1a864e4a6739ad07d890cd47f8cf180a3d1cdf (diff)
downloadlibrest-1d71e83ac3ff7baaee43e0e66daaeeecb4ba96b4.tar.gz
lastfm: Fix function setting regression
Since commit c66b6d, RestProxyCall::url is regenerated after calling the RestProxyCall::prepare virtual method. This breaks the lastfm code as it needs to reset RestProxyCall::url in order to remove the function from it. It used to do that by directly accessing RestProxyCall private data. Since c66b6d, this can be solved using only public methods as if the function is reset on the RestProxyCall in ::prepare, ::url will be regenerated to reflect that after ::prepare and ::serialize_params have been called. https://bugzilla.gnome.org/show_bug.cgi?id=708359
-rw-r--r--rest-extras/lastfm-proxy-call.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/rest-extras/lastfm-proxy-call.c b/rest-extras/lastfm-proxy-call.c
index 5e04038..f4bba60 100644
--- a/rest-extras/lastfm-proxy-call.c
+++ b/rest-extras/lastfm-proxy-call.c
@@ -44,14 +44,15 @@ _prepare (RestProxyCall *call, GError **error)
priv = LASTFM_PROXY_GET_PRIVATE (proxy);
call_priv = call->priv;
- /* First reset the URL because Lastfm puts the function in the parameters */
- call_priv->url = g_strdup (_rest_proxy_get_bound_url (REST_PROXY (proxy)));
rest_proxy_call_add_params (call,
"method", call_priv->function,
"api_key", priv->api_key,
NULL);
+ /* Reset function because Lastfm puts the function in the parameters */
+ rest_proxy_call_set_function (call, NULL);
+
if (priv->session_key)
rest_proxy_call_add_param (call, "sk", priv->session_key);