* Removed a TODO
authorSergio Villar Senin <svillar@igalia.com>
Mon, 11 Jun 2007 08:11:07 +0000 (08:11 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Mon, 11 Jun 2007 08:11:07 +0000 (08:11 +0000)
* Fixed the account manager new batch notification system, it was not working
* Do not reload the accounts if only the last-updated key has changed, it was working but it seems that somebody commented it

pmo-trunk-r2144

src/modest-account-mgr.c
src/modest-mail-operation.c
src/modest-marshal.list
src/modest-tny-account-store.c
src/widgets/modest-folder-view.c

index fee90c3..3dc0bc7 100644 (file)
@@ -69,6 +69,7 @@ on_timeout_notify_changes (gpointer data)
                        
                g_free (default_account);
                
+               g_slist_foreach (priv->changed_conf_keys, (GFunc) g_free, NULL);
                g_slist_free (priv->changed_conf_keys);
                priv->changed_conf_keys = NULL;
        }
@@ -92,7 +93,7 @@ on_key_change (ModestConf *conf, const gchar *key, ModestConfEvent event, gpoint
                /* Store the key for later notification in our timeout callback.
                 * Notifying for every key change would cause unnecessary work: */
                priv->changed_conf_keys = g_slist_append (NULL, 
-                       (gpointer)key);
+                       (gpointer) g_strdup (key));
        }
        
        gboolean is_account_key = FALSE;
@@ -129,7 +130,7 @@ on_key_change (ModestConf *conf, const gchar *key, ModestConfEvent event, gpoint
                /* Store the key for later notification in our timeout callback.
                 * Notifying for every key change would cause unnecessary work: */
                priv->changed_conf_keys = g_slist_append (NULL, 
-                       (gpointer)key);
+                       (gpointer) g_strdup (key));
        }
 
        g_free (account);
@@ -189,7 +190,7 @@ modest_account_mgr_class_init (ModestAccountMgrClass * klass)
                              G_SIGNAL_RUN_FIRST,
                              G_STRUCT_OFFSET(ModestAccountMgrClass,account_changed),
                              NULL, NULL,
-                             modest_marshal_VOID__STRING_STRING_BOOLEAN,
+                             modest_marshal_VOID__STRING_POINTER_BOOLEAN,
                              G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_BOOLEAN);
 }
 
index da4eb43..aa6de1c 100644 (file)
@@ -1015,9 +1015,7 @@ update_account_thread (gpointer thr_user_data)
        if (!priv->error) {
                priv->status = MODEST_MAIL_OPERATION_STATUS_SUCCESS;
 
-               /* Update the last updated key. TODO: this causes
-                  sometimes an error in dbus, in order to fix this we
-                  must call gconf from the main loop */
+               /* Update the last updated key */
                g_idle_add_full (G_PRIORITY_HIGH_IDLE, 
                                 set_last_updated_idle, 
                                 g_strdup (tny_account_get_id (TNY_ACCOUNT (info->account))),
index 6fcf0e2..5fe145e 100644 (file)
@@ -5,5 +5,5 @@ VOID:POINTER,BOOL
 VOID:STRING,INT
 VOID:STRING,INT,INT
 VOID:STRING,BOOL
-VOID:STRING,STRING,BOOL
+VOID:STRING,POINTER,BOOL
 VOID:POINTER,INT
index aba155a..6af53da 100644 (file)
@@ -352,11 +352,10 @@ on_account_changed (ModestAccountMgr *acc_mgr, const gchar *account,
 {
        ModestTnyAccountStore *self = MODEST_TNY_ACCOUNT_STORE(user_data);
        
-       #if 0
        /* Ignore the change if it's a change in the last_updated value */
-       if (g_str_has_suffix (key, MODEST_ACCOUNT_LAST_UPDATED))
+       if (g_slist_length ((GSList *)keys) == 1 &&
+           g_str_has_suffix ((const gchar *) keys->data, MODEST_ACCOUNT_LAST_UPDATED))
                return;
-       #endif
 
        /* FIXME: make this more finegrained; changes do not really affect _all_
         * accounts, and some do not affect tny accounts at all (such as 'last_update')
index 4d235b8..eab9f0f 100644 (file)
@@ -636,7 +636,7 @@ modest_folder_view_new (TnyFolderStoreQuery *query)
        priv->changed_signal = g_signal_connect (sel, "changed",
                                                 G_CALLBACK (on_selection_changed), self);
 
-       return GTK_WIDGET(self);
+       return GTK_WIDGET(self);
 }
 
 /* this feels dirty; any other way to expand all the root items? */