Make changes to adapt into new signon dbus api
authorTomi Suviola <tomi.suviola@nokia.com>
Thu, 16 Sep 2010 07:46:56 +0000 (10:46 +0300)
committerTomi Suviola <tomi.suviola@nokia.com>
Thu, 16 Sep 2010 07:46:56 +0000 (10:46 +0300)
libsignon-glib/signon-identity.c
libsignon-glib/signon-identity.h
tests/check_signon.c
tests/tests.xml

index 62cfc637b36b003738b7623232cd141872ce8365..4dff9d4de5a95910cab5b944cbf9e567ac371042 100644 (file)
@@ -95,6 +95,7 @@ struct _SignonIdentityInfo
     gchar **realms;
     gchar **access_control_list;
     gint type;
+    gint ref_count;
 };
 
 #define SIGNON_IDENTITY_PRIV(obj) (SIGNON_IDENTITY(obj)->priv)
@@ -116,6 +117,7 @@ typedef struct _IdentityStoreCredentialsData
     gchar **realms;
     gchar **access_control_list;
     gint type;
+    gint ref_count;
     gpointer cb_data;
 } IdentityStoreCredentialsData;
 
@@ -694,6 +696,7 @@ void signon_identity_store_credentials_with_info(SignonIdentity *self,
                                                 (const gchar* const *)info->realms,
                                                 (const gchar* const *)info->access_control_list,
                                                 info->type,
+                                                info->ref_count,
                                                 cb,
                                                 user_data);
 }
@@ -733,6 +736,7 @@ void signon_identity_store_credentials_with_args(SignonIdentity *self,
                                                  const gchar* const *realms,
                                                  const gchar* const *access_control_list,
                                                  SignonIdentityType type,
+                                                 gint ref_count,
                                                  SignonIdentityStoreCredentialsCb cb,
                                                  gpointer user_data)
 {
@@ -760,6 +764,7 @@ void signon_identity_store_credentials_with_args(SignonIdentity *self,
     operation_data->realms = g_strdupv((gchar **)realms);
     operation_data->access_control_list = g_strdupv((gchar **)access_control_list);
     operation_data->type = (gint)type;
+    operation_data->ref_count = ref_count;
     operation_data->cb_data = cb_data;
 
     identity_check_remote_registration (self);
@@ -813,6 +818,7 @@ identity_store_credentials_ready_cb (gpointer object, const GError *error, gpoin
                     (const char **)operation_data->realms,
                     (const char **)operation_data->access_control_list,
                     operation_data->type,
+                    operation_data->ref_count,
                     identity_store_credentials_reply,
                     cb_data);
     }
@@ -1120,6 +1126,12 @@ identity_ptrarray_to_identity_info (const GPtrArray *identity_array)
     signon_identity_info_set_identity_type (info, g_value_get_int (value));
     g_value_unset (value);
 
+    /* get the ref_count (gint) */
+    value = g_ptr_array_index (identity_array, 8);
+    g_assert (G_VALUE_HOLDS_INT(value));
+    signon_identity_info_set_identity_ref_count (info, g_value_get_int (value));
+    g_value_unset (value);
+
     return info;
 }
 
@@ -1577,6 +1589,8 @@ SignonIdentityInfo *signon_identity_info_copy (const SignonIdentityInfo *other)
 
     signon_identity_info_set_identity_type (info, signon_identity_info_get_identity_type (other));
 
+    signon_identity_info_set_identity_ref_count (info, signon_identity_info_get_identity_ref_count (other));
+
     return info;
 }
 
@@ -1628,6 +1642,12 @@ SignonIdentityType signon_identity_info_get_identity_type (const SignonIdentityI
     return (SignonIdentityType)info->type;
 }
 
+gint signon_identity_info_get_identity_ref_count (const SignonIdentityInfo *info)
+{
+    g_return_val_if_fail (info != NULL, -1);
+    return (SignonIdentityType)info->ref_count;
+}
+
 void signon_identity_info_set_username (SignonIdentityInfo *info, const gchar *username)
 {
     g_return_if_fail (info != NULL);
@@ -1701,6 +1721,12 @@ void signon_identity_info_set_identity_type (SignonIdentityInfo *info, SignonIde
     info->type = (gint)type;
 }
 
+void signon_identity_info_set_identity_ref_count (SignonIdentityInfo *info, gint ref_count)
+{
+    g_return_if_fail (info != NULL);
+    info->ref_count = ref_count;
+}
+
 static const gchar *identity_info_get_secret (const SignonIdentityInfo *info)
 {
     g_return_val_if_fail (info != NULL, NULL);
index 44e8b39193081072fc2c64364bb73030a051e433..b166613cbe23395bd77a17f8bb48d4a778cf7ffd 100644 (file)
@@ -113,6 +113,7 @@ void signon_identity_store_credentials_with_args(SignonIdentity *self,
                                                  const gchar* const *realms,
                                                  const gchar* const *access_control_list,
                                                  SignonIdentityType type,
+                                                 gint ref_count,
                                                  SignonIdentityStoreCredentialsCb cb,
                                                  gpointer user_data);
 
@@ -170,6 +171,8 @@ const gchar* const *signon_identity_info_get_access_control_list (const SignonId
 
 SignonIdentityType signon_identity_info_get_identity_type (const SignonIdentityInfo *info);
 
+gint signon_identity_info_get_identity_ref_count (const SignonIdentityInfo *info);
+
 void signon_identity_info_set_username (SignonIdentityInfo *info, const gchar *username);
 
 void signon_identity_info_set_secret (SignonIdentityInfo *info, const gchar *secret, gboolean store_secret);
@@ -186,6 +189,8 @@ void signon_identity_info_set_access_control_list (SignonIdentityInfo *info, con
 
 void signon_identity_info_set_identity_type (SignonIdentityInfo *info, SignonIdentityType type);
 
+void signon_identity_info_set_identity_ref_count (SignonIdentityInfo *info, gint ref_count);
+
 G_END_DECLS
 
 #endif /* _SIGNON_IDENTITY_H_ */
index 7f581741fe0e5e3a4e6439af3a2ddca1968c4f3f..98f310e203f949c08ae727a93f9b05d856599a3f 100644 (file)
@@ -544,6 +544,7 @@ new_identity()
                                                              NULL,
                                                              NULL,
                                                              0,
+                                                             1,
                                                              &id,
                                                              &error);
 
@@ -663,6 +664,7 @@ START_TEST(test_store_credentials_identity)
                                                  NULL,
                                                  NULL,
                                                  0,
+                                                 1,
                                                  store_credentials_identity_cb,
                                                  &last_id);
     g_hash_table_destroy (methods);
@@ -721,6 +723,7 @@ START_TEST(test_verify_secret_identity)
                                                  NULL,
                                                  NULL,
                                                  0,
+                                                 1,
                                                  store_credentials_identity_cb,
                                                  NULL);
     main_loop = g_main_loop_new (NULL, FALSE);
@@ -793,6 +796,7 @@ START_TEST(test_remove_identity)
                                                  NULL,
                                                  NULL,
                                                  0,
+                                                 1,
                                                  store_credentials_identity_cb,
                                                  NULL);
     g_hash_table_destroy (methods);
@@ -930,6 +934,7 @@ START_TEST(test_info_identity)
                                                  NULL,
                                                  NULL,
                                                  0,
+                                                 1,
                                                  store_credentials_identity_cb,
                                                  NULL);
     g_hash_table_destroy (methods);
index 2cfb5861cc3b20150cfdbc3baebc33e041bc2d5d..489f3bb6ec1043160f4b9341ffe570585f4d3578 100644 (file)
@@ -1,7 +1,7 @@
  <testdefinition version="0.1">
      <suite name="libsignon-glib1-tests" domain="Accounts and SSO">
          <set description="libsignon-glib1-tests:signon-glib-tests" name="/usr/bin/signon-glib-test.sh">
-              <case description="libsignon-glib-tests:signon-glib-test.sh" name="signon-glib-test.sh" type="Functional" level="Feature">
+              <case description="libsignon-glib-tests:signon-glib-test.sh" name="signon-glib-test.sh" type="Functional" level="Feature" timeout="800">
                  <step>/usr/bin/signon-glib-test.sh</step>
               </case>
               <environments><scratchbox>true</scratchbox>