[PATCH 06/18] flickr: Swap token and secret parameters



As token is optional but secret mandatory, put optional parameters at the end.
---
 src/flickr/gflickr.c    |    8 +++++---
 src/flickr/grl-flickr.c |    2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/flickr/gflickr.c b/src/flickr/gflickr.c
index 6c59c7f..4ec06b1 100644
--- a/src/flickr/gflickr.c
+++ b/src/flickr/gflickr.c
@@ -60,8 +60,8 @@ typedef struct {
 
 struct _GFlickrPrivate {
   gchar *api_key;
-  gchar *auth_token;
   gchar *auth_secret;
+  gchar *auth_token;
   gint per_page;
 };
 
@@ -99,12 +99,14 @@ g_flickr_finalize (GObject *object)
 }
 
 GFlickr *
-g_flickr_new (const gchar *api_key, const gchar *auth_token, const gchar *auth_secret)
+g_flickr_new (const gchar *api_key, const gchar *auth_secret, const gchar *auth_token)
 {
+  g_return_val_if_fail (api_key && auth_secret);
+
   GFlickr *f = g_object_new (G_FLICKR_TYPE, NULL);
   f->priv->api_key = g_strdup (api_key);
-  f->priv->auth_token = g_strdup (auth_token);
   f->priv->auth_secret = g_strdup (auth_secret);
+  f->priv->auth_token = g_strdup (auth_token);
 
   return f;
 }
diff --git a/src/flickr/grl-flickr.c b/src/flickr/grl-flickr.c
index ab0a4c1..83fc3f1 100644
--- a/src/flickr/grl-flickr.c
+++ b/src/flickr/grl-flickr.c
@@ -128,7 +128,7 @@ grl_flickr_plugin_init (GrlPluginRegistry *registry,
   }
 
   GrlFlickrSource *source = grl_flickr_source_new ();
-  source->priv->flickr = g_flickr_new (flickr_key, flickr_token, flickr_secret);
+  source->priv->flickr = g_flickr_new (flickr_key, flickr_secret, flickr_token);
 
   grl_plugin_registry_register_source (registry,
                                        plugin,
-- 
1.7.0.4



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]