diff --git a/gnome/src/accountlist.c b/gnome/src/accountlist.c index dce63a60f4e563197465add4d5bac161eabaf488..a7aca4b4ca8a5180b90f2884dbb9af893293df7b 100644 --- a/gnome/src/accountlist.c +++ b/gnome/src/accountlist.c @@ -75,8 +75,7 @@ static gint get_state_struct(gconstpointer a, gconstpointer b) void account_list_init() { - if (accountQueue) - account_list_free(); + account_list_free(); accountQueue = g_queue_new(); } @@ -200,9 +199,11 @@ void account_list_free_elm(gpointer elm, gpointer data UNUSED) void account_list_free() { - g_queue_foreach(accountQueue, account_list_free_elm, NULL); - g_queue_free(accountQueue); - accountQueue = NULL; + if (accountQueue) { + g_queue_foreach(accountQueue, account_list_free_elm, NULL); + g_queue_free(accountQueue); + accountQueue = NULL; + } } void diff --git a/gnome/src/actions.c b/gnome/src/actions.c index 147b16bf7e53b67e18969ca7b8bcd327c1232d26..eaa8407bd6769f56d6c879cc927d759126bf8a16 100644 --- a/gnome/src/actions.c +++ b/gnome/src/actions.c @@ -57,7 +57,6 @@ #include "actions.h" #include "dbus/dbus.h" #include "logger.h" -#include "config/accountlistconfigdialog.h" #include "contacts/calltab.h" #include "contacts/searchbar.h" #include "contacts/addrbookfactory.h" @@ -122,13 +121,12 @@ static gboolean is_direct_call(callable_obj_t * c) void status_bar_display_account() { - gchar* msg; - statusbar_pop_message(__MSG_ACCOUNT_DEFAULT); account_t *acc = account_list_get_current(); status_tray_icon_online(acc != NULL); + gchar* msg; if (acc) { msg = g_markup_printf_escaped("%s %s (%s)" , _("Using account"), @@ -253,7 +251,6 @@ void sflphone_fill_account_list(void) // Set the current account message number current_account_set_message_number(current_account_get_message_number()); - account_store_fill(); } gboolean sflphone_init(GError **error) diff --git a/gnome/src/actions.h b/gnome/src/actions.h index 2131ebd9376acd0e9996e316100b44da8fdae284..4c3899836a2eab2e4140838b0a0344db18677391 100644 --- a/gnome/src/actions.h +++ b/gnome/src/actions.h @@ -172,7 +172,8 @@ void sflphone_fill_ip2ip_profile(void); GHashTable *sflphone_get_ip2ip_properties(void); /** - * Initialize the accounts data structure + * Get a list of accounts from the daemon and load them into account_t + * structures. */ void sflphone_fill_account_list(); diff --git a/gnome/src/config/accountlistconfigdialog.c b/gnome/src/config/accountlistconfigdialog.c index 8b42d2d7791c972a598c2d7d49e30b9674baa0d6..9547dd569321d52dbdf6d632b56104137615ae34 100644 --- a/gnome/src/config/accountlistconfigdialog.c +++ b/gnome/src/config/accountlistconfigdialog.c @@ -44,7 +44,6 @@ static const int CONTEXT_ID_REGISTRATION = 0; -static GtkWidget *add_button; static GtkWidget *edit_button; static GtkWidget *delete_button; static GtkWidget *move_down_button; @@ -516,7 +515,7 @@ create_account_list() g_signal_connect(G_OBJECT(move_down_button), "clicked", G_CALLBACK(move_down_cb), tree_view); - add_button = gtk_button_new_from_stock(GTK_STOCK_ADD); + GtkWidget *add_button = gtk_button_new_from_stock(GTK_STOCK_ADD); g_signal_connect_swapped(G_OBJECT(add_button), "clicked", G_CALLBACK(add_account_cb), NULL); gtk_box_pack_start(GTK_BOX(button_box), add_button, FALSE, FALSE, 0); diff --git a/gnome/src/main.c b/gnome/src/main.c index 8590e276f6f648721bd0e316c65d7e34fd9c1a84..c6dc14ab2ea85938be3a701f0ff43a51790027a9 100644 --- a/gnome/src/main.c +++ b/gnome/src/main.c @@ -112,7 +112,6 @@ main(int argc, char *argv[]) set_minimized(TRUE); } - status_bar_display_account(); sflphone_fill_history();