-on_account_changed (ModestAccountMgr *account_mgr,
- const gchar* account, const gchar* key,
- gboolean server_account, ModestAccountView *self)
-{
- /* Never update the view in response to gconf changes.
- * Always do it explicitly instead.
- * This is because we have no way to avoid 10 updates when changing
- * 10 items, and this blocks the UI.
- *
- * But this block/unblock API might be useful on platforms where the
- * notification does not happen so long after the key was set.
- * (We have no way to know when the last key was set, to do a final update)..
- */
- return;
-
- ModestAccountViewPrivate* priv = MODEST_ACCOUNT_VIEW_GET_PRIVATE(self);
-
- if (!priv->block_conf_updates)
- update_account_view (account_mgr, self);
+on_account_busy_changed(ModestAccountMgr *account_mgr,
+ const gchar *account_name,
+ gboolean busy,
+ ModestAccountView *self)
+{
+ GtkListStore *model = GTK_LIST_STORE(gtk_tree_view_get_model (GTK_TREE_VIEW(self)));
+ GtkTreeIter iter;
+ g_message(__FUNCTION__);
+ if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter))
+ return;
+ do
+ {
+ gchar* cur_name;
+ gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, MODEST_ACCOUNT_VIEW_NAME_COLUMN,
+ &cur_name, -1);
+ if (g_str_equal(cur_name, account_name))
+ {
+ ModestAccountData* account_data =
+ modest_account_mgr_get_account_data (account_mgr, account_name);
+ if (!account_data)
+ return;
+ gchar* last_updated_string = get_last_updated_string(account_mgr, account_data);
+ gtk_list_store_set(model, &iter,
+ MODEST_ACCOUNT_VIEW_LAST_UPDATED_COLUMN, last_updated_string,
+ -1);
+ g_free (last_updated_string);
+ modest_account_mgr_free_account_data (account_mgr, account_data);
+ return;
+ }
+ }
+ while (gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter));