telepathy-glib: future-account: new account properties should be fully-qualified

Jonny Lamb jonny at kemper.freedesktop.org
Thu May 10 07:41:19 PDT 2012


Module: telepathy-glib
Branch: master
Commit: 1f9a0ee2f6835bd10aa068e6d7d7593aa9d70e93
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=1f9a0ee2f6835bd10aa068e6d7d7593aa9d70e93

Author: Jonny Lamb <jonny.lamb at collabora.co.uk>
Date:   Fri Apr 27 10:40:19 2012 +0100

future-account: new account properties should be fully-qualified

Oops!

Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>

---

 telepathy-glib/future-account.c |   40 +++++++++++++++++++++++---------------
 tests/dbus/future-account.c     |   27 +++++++++++++++++--------
 2 files changed, 42 insertions(+), 25 deletions(-)

diff --git a/telepathy-glib/future-account.c b/telepathy-glib/future-account.c
index 28eb862..c12af23 100644
--- a/telepathy-glib/future-account.c
+++ b/telepathy-glib/future-account.c
@@ -23,6 +23,7 @@
 #include "telepathy-glib/future-account.h"
 
 #include <telepathy-glib/gtypes.h>
+#include <telepathy-glib/interfaces.h>
 #include <telepathy-glib/util.h>
 #include <telepathy-glib/simple-client-factory.h>
 
@@ -207,37 +208,41 @@ tp_future_account_get_property (GObject *object,
       break;
     case PROP_ICON_NAME:
       g_value_set_string (value,
-          tp_asv_get_string (self->priv->properties, "Icon"));
+          tp_asv_get_string (self->priv->properties,
+              TP_PROP_ACCOUNT_ICON));
       break;
     case PROP_NICKNAME:
       g_value_set_string (value,
-          tp_asv_get_string (self->priv->properties, "Nickname"));
+          tp_asv_get_string (self->priv->properties,
+              TP_PROP_ACCOUNT_NICKNAME));
       break;
     case PROP_REQUESTED_PRESENCE_TYPE:
-      GET_PRESENCE_VALUE ("RequestedPresence", 0, uint, 0);
+      GET_PRESENCE_VALUE (TP_PROP_ACCOUNT_REQUESTED_PRESENCE, 0, uint, 0);
       break;
     case PROP_REQUESTED_STATUS:
-      GET_PRESENCE_VALUE ("RequestedPresence", 1, string, "");
+      GET_PRESENCE_VALUE (TP_PROP_ACCOUNT_REQUESTED_PRESENCE, 1, string, "");
       break;
     case PROP_REQUESTED_STATUS_MESSAGE:
-      GET_PRESENCE_VALUE ("RequestedPresence", 2, string, "");
+      GET_PRESENCE_VALUE (TP_PROP_ACCOUNT_REQUESTED_PRESENCE, 2, string, "");
       break;
     case PROP_AUTOMATIC_PRESENCE_TYPE:
-      GET_PRESENCE_VALUE ("AutomaticPresence", 0, uint, 0);
+      GET_PRESENCE_VALUE (TP_PROP_ACCOUNT_AUTOMATIC_PRESENCE, 0, uint, 0);
       break;
     case PROP_AUTOMATIC_STATUS:
-      GET_PRESENCE_VALUE ("AutomaticPresence", 1, string, "");
+      GET_PRESENCE_VALUE (TP_PROP_ACCOUNT_AUTOMATIC_PRESENCE, 1, string, "");
       break;
     case PROP_AUTOMATIC_STATUS_MESSAGE:
-      GET_PRESENCE_VALUE ("AutomaticPresence", 2, string, "");
+      GET_PRESENCE_VALUE (TP_PROP_ACCOUNT_AUTOMATIC_PRESENCE, 2, string, "");
       break;
     case PROP_ENABLED:
       g_value_set_boolean (value,
-          tp_asv_get_boolean (self->priv->properties, "Enabled", NULL));
+          tp_asv_get_boolean (self->priv->properties,
+              TP_PROP_ACCOUNT_ENABLED, NULL));
       break;
     case PROP_CONNECT_AUTOMATICALLY:
       g_value_set_boolean (value,
-          tp_asv_get_boolean (self->priv->properties, "ConnectAutomatically",
+          tp_asv_get_boolean (self->priv->properties,
+              TP_PROP_ACCOUNT_CONNECT_AUTOMATICALLY,
               NULL));
       break;
     default:
@@ -618,7 +623,7 @@ tp_future_account_set_icon_name (TpFutureAccount *self,
 
   priv = self->priv;
 
-  tp_asv_set_string (priv->properties, "Icon", icon);
+  tp_asv_set_string (priv->properties, TP_PROP_ACCOUNT_ICON, icon);
 }
 
 /**
@@ -640,7 +645,7 @@ tp_future_account_set_nickname (TpFutureAccount *self,
 
   priv = self->priv;
 
-  tp_asv_set_string (priv->properties, "Nickname", nickname);
+  tp_asv_set_string (priv->properties, TP_PROP_ACCOUNT_NICKNAME, nickname);
 }
 
 /**
@@ -679,7 +684,8 @@ tp_future_account_set_requested_presence (TpFutureAccount *self,
   g_value_set_string (arr->values + 1, status);
   g_value_set_string (arr->values + 2, message);
 
-  g_hash_table_insert (priv->properties, "RequestedPresence", value);
+  g_hash_table_insert (priv->properties,
+      TP_PROP_ACCOUNT_REQUESTED_PRESENCE, value);
 }
 
 /**
@@ -718,7 +724,8 @@ tp_future_account_set_automatic_presence (TpFutureAccount *self,
   g_value_set_string (arr->values + 1, status);
   g_value_set_string (arr->values + 2, message);
 
-  g_hash_table_insert (priv->properties, "AutomaticPresence", value);
+  g_hash_table_insert (priv->properties,
+      TP_PROP_ACCOUNT_AUTOMATIC_PRESENCE, value);
 }
 
 /**
@@ -740,7 +747,7 @@ tp_future_account_set_enabled (TpFutureAccount *self,
 
   priv = self->priv;
 
-  tp_asv_set_boolean (priv->properties, "Enabled", enabled);
+  tp_asv_set_boolean (priv->properties, TP_PROP_ACCOUNT_ENABLED, enabled);
 }
 
 /**
@@ -764,7 +771,8 @@ tp_future_account_set_connect_automatically (TpFutureAccount *self,
 
   priv = self->priv;
 
-  tp_asv_set_boolean (priv->properties, "ConnectAutomatically",
+  tp_asv_set_boolean (priv->properties,
+      TP_PROP_ACCOUNT_CONNECT_AUTOMATICALLY,
       connect_automatically);
 }
 
diff --git a/tests/dbus/future-account.c b/tests/dbus/future-account.c
index 159d5e1..839d5f3 100644
--- a/tests/dbus/future-account.c
+++ b/tests/dbus/future-account.c
@@ -10,6 +10,7 @@
 #include "config.h"
 
 #include <telepathy-glib/future-account.h>
+#include <telepathy-glib/interfaces.h>
 
 #include "tests/lib/simple-account.h"
 #include "tests/lib/simple-account-manager.h"
@@ -199,7 +200,8 @@ test_properties (Test *test,
       NULL);
 
   g_assert_cmpuint (g_hash_table_size (props), ==, 1);
-  g_assert_cmpstr (tp_asv_get_string (props, "Icon"), ==, "user32.dll");
+  g_assert_cmpstr (tp_asv_get_string (props, TP_PROP_ACCOUNT_ICON),
+      ==, "user32.dll");
   g_assert_cmpstr (icon_name, ==, "user32.dll");
 
   g_hash_table_unref (props);
@@ -214,8 +216,10 @@ test_properties (Test *test,
       NULL);
 
   g_assert_cmpuint (g_hash_table_size (props), ==, 2);
-  g_assert_cmpstr (tp_asv_get_string (props, "Icon"), ==, "user32.dll");
-  g_assert_cmpstr (tp_asv_get_string (props, "Nickname"), ==, "Walter Jr.");
+  g_assert_cmpstr (tp_asv_get_string (props, TP_PROP_ACCOUNT_ICON),
+      ==, "user32.dll");
+  g_assert_cmpstr (tp_asv_get_string (props, TP_PROP_ACCOUNT_NICKNAME),
+      ==, "Walter Jr.");
   g_assert_cmpstr (nickname, ==, "Walter Jr.");
 
   g_hash_table_unref (props);
@@ -315,17 +319,21 @@ test_create_succeed (Test *test,
   g_assert_cmpstr (tp_asv_get_string (test->am->create_parameters, "password"),
       ==, "holly");
   g_assert_cmpuint (g_hash_table_size (test->am->create_properties), ==, 6);
-  g_assert_cmpstr (tp_asv_get_string (test->am->create_properties, "Icon"),
+  g_assert_cmpstr (tp_asv_get_string (test->am->create_properties,
+          TP_PROP_ACCOUNT_ICON),
       ==, "gasmask");
-  g_assert_cmpstr (tp_asv_get_string (test->am->create_properties, "Nickname"),
+  g_assert_cmpstr (tp_asv_get_string (test->am->create_properties,
+          TP_PROP_ACCOUNT_NICKNAME),
       ==, "Heisenberg");
-  g_assert_cmpint (tp_asv_get_boolean (test->am->create_properties, "Enabled", NULL),
+  g_assert_cmpint (tp_asv_get_boolean (test->am->create_properties,
+          TP_PROP_ACCOUNT_ENABLED, NULL),
       ==, TRUE);
   g_assert_cmpint (tp_asv_get_boolean (test->am->create_properties,
-          "ConnectAutomatically", NULL),
+          TP_PROP_ACCOUNT_CONNECT_AUTOMATICALLY, NULL),
       ==, TRUE);
 
-  array = tp_asv_get_boxed (test->am->create_properties, "RequestedPresence",
+  array = tp_asv_get_boxed (test->am->create_properties,
+      TP_PROP_ACCOUNT_REQUESTED_PRESENCE,
       TP_STRUCT_TYPE_SIMPLE_PRESENCE);
   g_assert_cmpuint (g_value_get_uint (array->values), ==,
       TP_CONNECTION_PRESENCE_TYPE_AVAILABLE);
@@ -334,7 +342,8 @@ test_create_succeed (Test *test,
   g_assert_cmpstr (g_value_get_string (array->values + 2), ==,
       "Better call Saul!");
 
-  array = tp_asv_get_boxed (test->am->create_properties, "AutomaticPresence",
+  array = tp_asv_get_boxed (test->am->create_properties,
+      TP_PROP_ACCOUNT_AUTOMATIC_PRESENCE,
       TP_STRUCT_TYPE_SIMPLE_PRESENCE);
   g_assert_cmpuint (g_value_get_uint (array->values), ==,
       TP_CONNECTION_PRESENCE_TYPE_BUSY);



More information about the telepathy-commits mailing list