X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-account-view.c;h=4efea80c24bc970af39ed49c98943273f320fc71;hb=de3a049cc864aafde18e98d8b4b4d9277a92f938;hp=e236c694490a298a623d98e0003307af11146b53;hpb=b43518714ee9ac0b6fdd0ab7d08f2c1de67846f5;p=modest diff --git a/src/widgets/modest-account-view.c b/src/widgets/modest-account-view.c index e236c69..4efea80 100644 --- a/src/widgets/modest-account-view.c +++ b/src/widgets/modest-account-view.c @@ -29,7 +29,10 @@ #include #include "modest-account-view.h" -/* include other impl specific header files */ +#include +#include +#include +#include /* 'private'/'protected' functions */ static void modest_account_view_class_init (ModestAccountViewClass *klass); @@ -102,13 +105,6 @@ modest_account_view_class_init (ModestAccountViewClass *klass) gobject_class->finalize = modest_account_view_finalize; g_type_class_add_private (gobject_class, sizeof(ModestAccountViewPrivate)); - - /* signal definitions go here, e.g.: */ -/* signals[MY_SIGNAL_1] = */ -/* g_signal_new ("my_signal_1",....); */ -/* signals[MY_SIGNAL_2] = */ -/* g_signal_new ("my_signal_2",....); */ -/* etc. */ } static void @@ -157,32 +153,38 @@ update_account_view (ModestAccountMgr *account_mgr, ModestAccountView *view) while (cursor) { gchar *proto = NULL; - gchar *store, *account_name; + gchar *store, *account_name, *display_name; gboolean enabled; account_name = (gchar*)cursor->data; - store = modest_account_mgr_get_string (account_mgr, + display_name = modest_account_mgr_get_string (account_mgr, account_name, - MODEST_ACCOUNT_STORE_ACCOUNT, + MODEST_ACCOUNT_DISPLAY_NAME, FALSE, NULL); + /* don't display accounts without stores */ if (store) { - - proto = modest_account_mgr_get_string (account_mgr, - store, - MODEST_ACCOUNT_PROTO, - TRUE, NULL); - g_free(store); - } - - enabled = modest_account_mgr_account_get_enabled (account_mgr, account_name); - gtk_list_store_insert_with_values ( - model, NULL, 0, - ENABLED_COLUMN, enabled, - NAME_COLUMN, account_name, - PROTO_COLUMN, proto, - -1); + store = modest_account_mgr_get_string (account_mgr, + account_name, + MODEST_ACCOUNT_STORE_ACCOUNT, + FALSE, NULL); + if (store) { + proto = modest_account_mgr_get_string (account_mgr, + store, + MODEST_ACCOUNT_PROTO, + TRUE, NULL); + g_free(store); + } + enabled = modest_account_mgr_account_get_enabled (account_mgr, account_name); + gtk_list_store_insert_with_values ( + model, NULL, 0, + ENABLED_COLUMN, enabled, + NAME_COLUMN, display_name, + PROTO_COLUMN, proto, + -1); + } + g_free (display_name); g_free (account_name); g_free (proto); @@ -239,12 +241,10 @@ on_account_enable_toggled (GtkCellRendererToggle *cell_renderer, gchar *path, g_free (account_name); } - static void init_view (ModestAccountView *self) { ModestAccountViewPrivate *priv; - GtkTreeSelection *sel; GtkCellRenderer *renderer; GtkListStore *model; @@ -279,8 +279,6 @@ init_view (ModestAccountView *self) gtk_cell_renderer_text_new (), "text", PROTO_COLUMN, NULL)); - sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(self)); - priv->sig1 = g_signal_connect (G_OBJECT(priv->account_mgr), "account_removed", G_CALLBACK(on_account_removed), self);