[Pkg-telepathy-commits] [telepathy-mission-control-6] 90/280: Rename default account-store backend from default to keyfile

Simon McVittie smcv at debian.org
Thu Mar 27 20:07:09 UTC 2014


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian
in repository telepathy-mission-control-6.

commit 2fc29053c44c046e6204bd7885d78b9deaf85693
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Tue Oct 29 11:57:55 2013 +0000

    Rename default account-store backend from default to keyfile
    
    If we're going to change the default, leaving it called 'default'
    makes little sense!
    
    Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54875
    Reviewed-by: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
---
 tests/Makefile.am                                        |  4 ++--
 .../{account-store-default.c => account-store-keyfile.c} | 14 +++++++-------
 .../{account-store-default.h => account-store-keyfile.h} | 16 ++++++++--------
 tests/account-store.c                                    | 14 +++++++-------
 tests/twisted/account-storage/default-keyring-storage.py |  5 ++---
 5 files changed, 26 insertions(+), 27 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index c6166fb..d349d7d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -37,8 +37,8 @@ tease_the_minotaur_LDADD = $(top_builddir)/src/libmcd-convenience.la
 account_store_LDADD = $(GLIB_LIBS)
 account_store_SOURCES = \
 	account-store.c \
-	account-store-default.c \
-	account-store-default.h
+	account-store-keyfile.c \
+	account-store-keyfile.h
 
 if ENABLE_LIBACCOUNTS_SSO
 account_store_SOURCES += account-store-libaccounts.c account-store-libaccounts.h
diff --git a/tests/account-store-default.c b/tests/account-store-keyfile.c
similarity index 90%
rename from tests/account-store-default.c
rename to tests/account-store-keyfile.c
index 7f4c8c3..efa96b0 100644
--- a/tests/account-store-default.c
+++ b/tests/account-store-keyfile.c
@@ -1,5 +1,5 @@
 /*
- * MC account storage backend inspector, default backend
+ * MC account storage inspector: MC 5.0-compatible single keyfile backend
  *
  * Copyright © 2010 Nokia Corporation
  * Copyright © 2010 Collabora Ltd.
@@ -23,7 +23,7 @@
 #include <glib.h>
 #include <string.h>
 
-#include "account-store-default.h"
+#include "account-store-keyfile.h"
 
 static const gchar *default_config (void)
 {
@@ -76,14 +76,14 @@ static gboolean commit_changes (void)
 }
 
 gchar *
-default_get (const gchar *account,
+keyfile_get (const gchar *account,
     const gchar *key)
 {
   return g_key_file_get_string (default_keyfile (), account, key, NULL);
 }
 
 gboolean
-default_set (const gchar *account,
+keyfile_set (const gchar *account,
     const gchar *key,
     const gchar *value)
 {
@@ -100,7 +100,7 @@ default_set (const gchar *account,
 }
 
 gboolean
-default_delete (const gchar *account)
+keyfile_delete (const gchar *account)
 {
   GKeyFile *keyfile = default_keyfile ();
 
@@ -110,13 +110,13 @@ default_delete (const gchar *account)
 }
 
 gboolean
-default_exists (const gchar *account)
+keyfile_exists (const gchar *account)
 {
   return g_key_file_has_group (default_keyfile (), account);
 }
 
 GStrv
-default_list (void)
+keyfile_list (void)
 {
   return g_key_file_get_groups (default_keyfile (), NULL);
 }
diff --git a/tests/account-store-default.h b/tests/account-store-keyfile.h
similarity index 73%
rename from tests/account-store-default.h
rename to tests/account-store-keyfile.h
index 739f95c..a6ce217 100644
--- a/tests/account-store-default.h
+++ b/tests/account-store-keyfile.h
@@ -1,5 +1,5 @@
 /*
- * MC account storage backend inspector, default backend
+ * MC account storage inspector: MC 5.0-compatible single keyfile backend
  *
  * Copyright © 2010 Nokia Corporation
  * Copyright © 2010 Collabora Ltd.
@@ -19,23 +19,23 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef _ACCOUNT_STORE_DEFAULT_H_
-#define _ACCOUNT_STORE_DEFAULT_H_
+#ifndef _ACCOUNT_STORE_KEYFILE_H_
+#define _ACCOUNT_STORE_KEYFILE_H_
 
 #include <glib.h>
 #include <glib-object.h>
 
-gchar * default_get (const gchar *account,
+gchar * keyfile_get (const gchar *account,
     const gchar *key);
 
-gboolean default_set (const gchar *account,
+gboolean keyfile_set (const gchar *account,
     const gchar *key,
     const gchar *value);
 
-gboolean default_delete (const gchar *account);
+gboolean keyfile_delete (const gchar *account);
 
-gboolean default_exists (const gchar *account);
+gboolean keyfile_exists (const gchar *account);
 
-GStrv default_list (void);
+GStrv keyfile_list (void);
 
 #endif
diff --git a/tests/account-store.c b/tests/account-store.c
index 4482ea5..15e43ea 100644
--- a/tests/account-store.c
+++ b/tests/account-store.c
@@ -27,7 +27,7 @@
 #include <glib.h>
 #include <glib-object.h>
 
-#include "account-store-default.h"
+#include "account-store-keyfile.h"
 
 #define DOCSTRING_A \
   "%s OP BACKEND ACCOUNT [KEY [VALUE]]\n\n"        \
@@ -63,12 +63,12 @@ typedef enum {
 } Operation;
 
 const Backend backends[] = {
-  { "default",
-    default_get,
-    default_set,
-    default_delete,
-    default_exists,
-    default_list },
+  { "keyfile",
+    keyfile_get,
+    keyfile_set,
+    keyfile_delete,
+    keyfile_exists,
+    keyfile_list },
 
 #if ENABLE_LIBACCOUNTS_SSO
   { "libaccounts",
diff --git a/tests/twisted/account-storage/default-keyring-storage.py b/tests/twisted/account-storage/default-keyring-storage.py
index a785718..74f3bd3 100644
--- a/tests/twisted/account-storage/default-keyring-storage.py
+++ b/tests/twisted/account-storage/default-keyring-storage.py
@@ -109,8 +109,7 @@ def test(q, bus, mc):
     assert kf[group]['Icon'] == 'im-jabber', kf
     assert kf[group]['Nickname'] == 'Joe Bloggs', kf
 
-    # This works wherever the password is stored
-    pwd = account_store('get', 'default', 'param-password')
+    pwd = account_store('get', 'keyfile', 'param-password')
     assert pwd == params['password'], pwd
 
     # We no longer use gnome-keyring, so the password is stored as clear-text.
@@ -192,7 +191,7 @@ AutomaticPresence=2;available;;
     assert os.path.exists(low_prio_key_file_name)
     kf = keyfile_read(new_key_file_name)
     assert 'param-password' not in kf[group]
-    pwd = account_store('get', 'default', 'param-password')
+    pwd = account_store('get', 'keyfile', 'param-password')
     assertEquals(None, pwd)
 
     # Write out an account configuration in the old keyfile, to test

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/telepathy-mission-control-6.git



More information about the Pkg-telepathy-commits mailing list