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,19 +141,25 @@ sflphone_hung_up( call_t * c)
void
sflphone_fill_account_list(gboolean toolbarInitialized)
{
gchar** array;
gchar** accountID;
unsigned int i;
account_list_clear ( );
gchar ** array = (gchar **)dbus_account_list();
gchar ** accountID;
for (accountID = array; *accountID; accountID++)
{
account_t * a = g_new0(account_t,1);
a->accountID = g_strdup(*accountID);
account_list_add(a);
}
g_strfreev (array);
array = (gchar **)dbus_account_list();
if(array)
{
for (accountID = array; *accountID; accountID++)
{
account_t * a = g_new0(account_t,1);
a->accountID = g_strdup(*accountID);
account_list_add(a);
}
g_strfreev (array);
}
unsigned int i;
for( i = 0; i < account_list_get_size(); i++)
{
account_t * a = account_list_get_nth (i);
......
......@@ -418,55 +418,45 @@ dbus_place_call (const call_t * c)
}
gchar **
dbus_account_list()
gchar** dbus_account_list()
{
g_print("Before");
GError *error = NULL;
char ** array;
org_sflphone_SFLphone_ConfigurationManager_get_account_list (
configurationManagerProxy,
&array,
&error);
g_print("After");
if (error)
{
g_printerr ("Failed to call get_account_list() on ConfigurationManager: %s\n",
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called get_account_list() on ConfigurationManager\n");
GError *error = NULL;
char ** array;
}
return array;
if(!org_sflphone_SFLphone_ConfigurationManager_get_account_list ( configurationManagerProxy, &array, &error))
{
if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION)
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);
return NULL;
}
else{
g_print ("DBus called get_account_list() on ConfigurationManager\n");
return array;
}
}
GHashTable *
dbus_account_details(gchar * accountID)
{
GError *error = NULL;
GHashTable * details;
org_sflphone_SFLphone_ConfigurationManager_get_account_details (
configurationManagerProxy,
accountID,
&details,
&error);
if (error)
{
g_printerr ("Failed to call get_account_details() on ConfigurationManager: %s\n",
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called get_account_details() on ConfigurationManager\n");
}
return details;
GHashTable* dbus_account_details(gchar * accountID)
{
GError *error = NULL;
GHashTable * details;
if(!org_sflphone_SFLphone_ConfigurationManager_get_account_details( configurationManagerProxy, accountID, &details, &error))
{
if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION)
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);
return NULL;
}
else{
g_print ("DBus called get_account_details() on ConfigurationManager\n");
return details;
}
}
void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment