Skip to content
Snippets Groups Projects
Commit f84457c1 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

try something to fix the 'DBus bug'

parent 6acf9783
No related branches found
No related tags found
No related merge requests found
...@@ -141,10 +141,16 @@ sflphone_hung_up( call_t * c) ...@@ -141,10 +141,16 @@ sflphone_hung_up( call_t * c)
void void
sflphone_fill_account_list(gboolean toolbarInitialized) sflphone_fill_account_list(gboolean toolbarInitialized)
{ {
account_list_clear ( );
gchar ** array = (gchar **)dbus_account_list(); gchar** array;
gchar** accountID; gchar** accountID;
unsigned int i;
account_list_clear ( );
array = (gchar **)dbus_account_list();
if(array)
{
for (accountID = array; *accountID; accountID++) for (accountID = array; *accountID; accountID++)
{ {
account_t * a = g_new0(account_t,1); account_t * a = g_new0(account_t,1);
...@@ -152,8 +158,8 @@ sflphone_fill_account_list(gboolean toolbarInitialized) ...@@ -152,8 +158,8 @@ sflphone_fill_account_list(gboolean toolbarInitialized)
account_list_add(a); account_list_add(a);
} }
g_strfreev (array); g_strfreev (array);
}
unsigned int i;
for( i = 0; i < account_list_get_size(); i++) for( i = 0; i < account_list_get_size(); i++)
{ {
account_t * a = account_list_get_nth (i); account_t * a = account_list_get_nth (i);
......
...@@ -418,56 +418,46 @@ dbus_place_call (const call_t * c) ...@@ -418,56 +418,46 @@ dbus_place_call (const call_t * c)
} }
gchar ** gchar** dbus_account_list()
dbus_account_list()
{ {
g_print("Before");
GError *error = NULL; GError *error = NULL;
char ** array; char ** array;
org_sflphone_SFLphone_ConfigurationManager_get_account_list (
configurationManagerProxy,
&array,
&error);
g_print("After"); if(!org_sflphone_SFLphone_ConfigurationManager_get_account_list ( configurationManagerProxy, &array, &error))
if (error)
{ {
g_printerr ("Failed to call get_account_list() on ConfigurationManager: %s\n", if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION)
error->message); g_printerr ("Caught remote method (get_account_list) exception %s: %s\n", dbus_g_error_get_name(error), error->message);
else
g_printerr("Error while calling get_account_list: %s\n", error->message);
g_error_free (error); g_error_free (error);
return NULL;
} }
else else{
{
g_print ("DBus called get_account_list() on ConfigurationManager\n"); g_print ("DBus called get_account_list() on ConfigurationManager\n");
}
return array; return array;
} }
}
GHashTable * GHashTable* dbus_account_details(gchar * accountID)
dbus_account_details(gchar * accountID)
{ {
GError *error = NULL; GError *error = NULL;
GHashTable * details; GHashTable * details;
org_sflphone_SFLphone_ConfigurationManager_get_account_details (
configurationManagerProxy, if(!org_sflphone_SFLphone_ConfigurationManager_get_account_details( configurationManagerProxy, accountID, &details, &error))
accountID,
&details,
&error);
if (error)
{ {
g_printerr ("Failed to call get_account_details() on ConfigurationManager: %s\n", if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION)
error->message); g_printerr ("Caught remote method (get_account_details) exception %s: %s\n", dbus_g_error_get_name(error), error->message);
else
g_printerr("Error while calling get_account_details: %s\n", error->message);
g_error_free (error); g_error_free (error);
return NULL;
} }
else else{
{
g_print ("DBus called get_account_details() on ConfigurationManager\n"); g_print ("DBus called get_account_details() on ConfigurationManager\n");
}
return details; return details;
} }
}
void void
dbus_send_register ( gchar* accountID , const guint expire) dbus_send_register ( gchar* accountID , const guint expire)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment