-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;
+ gboolean found = FALSE;
+
+ 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)) {
+ ModestAccountSettings* settings =
+ modest_account_mgr_load_account_settings (account_mgr, account_name);
+ if (!settings) {
+ g_free (cur_name);
+ return;
+ }
+ const gchar* last_updated_string = get_last_updated_string(self, account_mgr, settings);
+#ifdef MODEST_TOOLKIT_HILDON2
+ gchar *last_updated_hildon2;
+
+ last_updated_hildon2 = g_strconcat (_("mcen_ti_lastupdated"), "\n",
+ last_updated_string,
+ NULL);
+#endif
+ gtk_list_store_set(model, &iter,
+#ifdef MODEST_TOOLKIT_HILDON2
+ MODEST_ACCOUNT_VIEW_LAST_UPDATED_COLUMN, last_updated_hildon2,
+#else
+ MODEST_ACCOUNT_VIEW_LAST_UPDATED_COLUMN, last_updated_string,
+#endif
+ -1);
+
+#ifdef MODEST_TOOLKIT_HILDON2
+ g_free (last_updated_hildon2);
+#endif
+ g_object_unref (settings);
+ found = TRUE;
+ }
+ g_free (cur_name);
+
+ } while (!found && gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter));