telepathy-mission-control: Consistently use the constants from mcd-account-config.h

Simon McVittie smcv at kemper.freedesktop.org
Wed Feb 13 06:18:21 PST 2013


Module: telepathy-mission-control
Branch: master
Commit: 6cce93320368fb34ab7e13b8eb1e4d6b33634006
URL:    http://cgit.freedesktop.org/telepathy/telepathy-mission-control/commit/?id=6cce93320368fb34ab7e13b8eb1e4d6b33634006

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Mon Sep 10 18:23:08 2012 +0100

Consistently use the constants from mcd-account-config.h

Signed-off-by: Simon McVittie <simon.mcvittie at collabora.co.uk>

---

 src/mcd-account-addressing.c |   10 +++++-----
 src/mcd-account.c            |   20 +++++++++++---------
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/src/mcd-account-addressing.c b/src/mcd-account-addressing.c
index 9d9e293..c7e81e2 100644
--- a/src/mcd-account-addressing.c
+++ b/src/mcd-account-addressing.c
@@ -32,8 +32,6 @@
 #include "mcd-account-priv.h"
 #include "_gen/interfaces.h"
 
-#define SCHEMES TP_IFACE_ACCOUNT_INTERFACE_ADDRESSING ".URISchemes"
-
 static void
 addressing_set_uri_scheme_association (TpSvcAccountInterfaceAddressing *iface,
     const gchar *uri_scheme,
@@ -49,7 +47,8 @@ addressing_set_uri_scheme_association (TpSvcAccountInterfaceAddressing *iface,
 
   g_value_init (&value, G_TYPE_STRV);
 
-  if (mcd_storage_get_attribute (storage, account, SCHEMES, &value, NULL))
+  if (mcd_storage_get_attribute (storage, account, MC_ACCOUNTS_KEY_URI_SCHEMES,
+                                 &value, NULL))
     {
       schemes = g_value_get_boxed (&value);
       old_association = tp_strv_contains ((const gchar * const *) schemes,
@@ -78,7 +77,7 @@ addressing_set_uri_scheme_association (TpSvcAccountInterfaceAddressing *iface,
         }
 
       g_ptr_array_add (new_schemes, NULL);
-      mcd_storage_set_strv (storage, account, SCHEMES,
+      mcd_storage_set_strv (storage, account, MC_ACCOUNTS_KEY_URI_SCHEMES,
           (const gchar * const *) new_schemes->pdata);
 
       g_ptr_array_unref (new_schemes);
@@ -100,7 +99,8 @@ addressing_get_uri_schemes (TpSvcDBusProperties *iface,
 
   g_value_init (value, G_TYPE_STRV);
 
-  if (!mcd_storage_get_attribute (storage, account, SCHEMES, value, NULL))
+  if (!mcd_storage_get_attribute (storage, account, MC_ACCOUNTS_KEY_URI_SCHEMES,
+                                  value, NULL))
     {
       g_value_set_boxed (value, NULL);
     }
diff --git a/src/mcd-account.c b/src/mcd-account.c
index d006c26..b388cfe 100644
--- a/src/mcd-account.c
+++ b/src/mcd-account.c
@@ -1065,8 +1065,8 @@ set_display_name (TpSvcDBusProperties *self, const gchar *name,
     McdAccountPrivate *priv = account->priv;
 
     DEBUG ("called for %s", priv->unique_name);
-    return (mcd_account_set_string_val (account, name, value, error)
-            != SET_RESULT_ERROR);
+    return (mcd_account_set_string_val (account,
+        MC_ACCOUNTS_KEY_DISPLAY_NAME, value, error) != SET_RESULT_ERROR);
 }
 
 static void
@@ -1074,7 +1074,7 @@ get_display_name (TpSvcDBusProperties *self, const gchar *name, GValue *value)
 {
     McdAccount *account = MCD_ACCOUNT (self);
 
-    mcd_account_get_string_val (account, name, value);
+    mcd_account_get_string_val (account, MC_ACCOUNTS_KEY_DISPLAY_NAME, value);
 }
 
 static gboolean
@@ -1085,8 +1085,8 @@ set_icon (TpSvcDBusProperties *self, const gchar *name, const GValue *value,
     McdAccountPrivate *priv = account->priv;
 
     DEBUG ("called for %s", priv->unique_name);
-    return (mcd_account_set_string_val (account, name, value, error)
-            != SET_RESULT_ERROR);
+    return (mcd_account_set_string_val (account,
+        MC_ACCOUNTS_KEY_ICON, value, error) != SET_RESULT_ERROR);
 }
 
 static void
@@ -1094,7 +1094,7 @@ get_icon (TpSvcDBusProperties *self, const gchar *name, GValue *value)
 {
     McdAccount *account = MCD_ACCOUNT (self);
 
-    mcd_account_get_string_val (account, name, value);
+    mcd_account_get_string_val (account, MC_ACCOUNTS_KEY_ICON, value);
 }
 
 static void
@@ -1238,7 +1238,8 @@ set_service (TpSvcDBusProperties *self, const gchar *name,
      * the appropriate error for us: don't duplicate that logic here */
     if (proceed)
     {
-        ret = mcd_account_set_string_val (account, name, value, error);
+        ret = mcd_account_set_string_val (account, MC_ACCOUNTS_KEY_SERVICE,
+                                          value, error);
     }
     else
     {
@@ -1257,7 +1258,7 @@ get_service (TpSvcDBusProperties *self, const gchar *name, GValue *value)
 {
     McdAccount *account = MCD_ACCOUNT (self);
 
-    mcd_account_get_string_val (account, name, value);
+    mcd_account_get_string_val (account, MC_ACCOUNTS_KEY_SERVICE, value);
 }
 
 static gboolean
@@ -1743,7 +1744,8 @@ get_normalized_name (TpSvcDBusProperties *self,
 {
     McdAccount *account = MCD_ACCOUNT (self);
 
-    mcd_account_get_string_val (account, name, value);
+    mcd_account_get_string_val (account, MC_ACCOUNTS_KEY_NORMALIZED_NAME,
+                                value);
 }
 
 static gboolean



More information about the telepathy-commits mailing list