[frogr] Store on disk the actual version of a specific account



commit b6b51ac33cb471903f8d48d1dd9d8265e71ac383
Author: Mario Sanchez Prada <msanchez igalia com>
Date:   Thu Apr 5 05:00:42 2012 +0200

    Store on disk the actual version of a specific account

 src/frogr-account.c |    7 +++++--
 src/frogr-config.c  |    5 +----
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/frogr-account.c b/src/frogr-account.c
index 8c73b11..247f6fe 100644
--- a/src/frogr-account.c
+++ b/src/frogr-account.c
@@ -22,6 +22,9 @@
 
 #include "frogr-account.h"
 
+/* Increase this when changing the xml schema for storing accounts */
+#define ACCOUNTS_FORMAT_VERSION "2"
+
 #define FROGR_ACCOUNT_GET_PRIVATE(object)               \
   (G_TYPE_INSTANCE_GET_PRIVATE ((object),               \
                                 FROGR_TYPE_ACCOUNT,     \
@@ -270,7 +273,7 @@ frogr_account_class_init (FrogrAccountClass *klass)
                                "version",
                                "Version of the format used to store"
                                "the details for an account",
-                               "",
+                               ACCOUNTS_FORMAT_VERSION,
                                G_PARAM_READWRITE);
   g_object_class_install_property (obj_class, PROP_VERSION, pspec);
 
@@ -392,7 +395,7 @@ frogr_account_get_token_secret (FrogrAccount *self)
 
 void
 frogr_account_set_token_secret (FrogrAccount *self,
-                                      const gchar *token_secret)
+                                const gchar *token_secret)
 {
   FrogrAccountPrivate *priv = NULL;
 
diff --git a/src/frogr-config.c b/src/frogr-config.c
index 341c44c..4503a2c 100644
--- a/src/frogr-config.c
+++ b/src/frogr-config.c
@@ -34,9 +34,6 @@
 #define ACCOUNTS_FILENAME "accounts.xml"
 #define SETTINGS_FILENAME "settings.xml"
 
-/* Increase this when changing the xml schema for storing accounts */
-#define ACCOUNTS_FORMAT_VERSION "2"
-
 /* Increase this when changing the xml schema for storing settings */
 #define SETTINGS_FORMAT_VERSION "1"
 
@@ -785,7 +782,7 @@ _save_account_xml (FrogrAccount *faccount, xmlNodePtr parent)
     const gchar *token = NULL;
 
     /* Accounts versioning */
-    xmlSetProp (node, (const xmlChar*) "version", (const xmlChar*) ACCOUNTS_FORMAT_VERSION);
+    xmlSetProp (node, (const xmlChar*) "version", (const xmlChar*) frogr_account_get_version (faccount));
 
     if ((token = frogr_account_get_token (faccount)))
       _xml_add_string_child (node, "token", token);



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