-/* /\* We signal key changes in batches, every X seconds: *\/ */
-/* static gboolean */
-/* on_timeout_notify_changes (gpointer data) */
-/* { */
-/* ModestAccountMgr *self = MODEST_ACCOUNT_MGR (data); */
-/* ModestAccountMgrPrivate *priv = MODEST_ACCOUNT_MGR_GET_PRIVATE (self); */
+/* is the account already in the queue? */
+static gboolean
+in_change_queue (GSList *change_queue, const gchar *account)
+{
+ GSList *cursor = change_queue;
+ while (cursor) {
+ const gchar *acc = cursor->data;
+ if (acc && strcmp (acc, account) == 0)
+ return TRUE;
+ cursor = g_slist_next (cursor);
+ }
+ return FALSE;
+}
+
+static GSList*
+add_to_change_queue (GSList *change_queue, const gchar *account_name)
+{
+ g_return_val_if_fail (account_name, change_queue);
+ return g_slist_prepend (change_queue, g_strdup (account_name));
+}
+
+
+/* we don't need to track specific accounts, as in our UI case
+ * it's impossible to change two accounts within .5 seconds.
+ * still, we might want to allow that later, and then this func
+ * will come in handy */
+#if 0
+static GSList*
+remove_from_queue (GSList *change_queue, const gchar *account)
+{
+ GSList *cursor = change_queue;
+ while (cursor) {
+ const gchar *acc = cursor->data;
+ if (acc && strcmp (acc, account) == 0) {
+ g_free (acc);
+ return g_slist_delete_link (change_queue, cursor);
+ }
+ cursor = g_slist_next (cursor);
+ }
+ return change_queue;
+}
+#endif
+
+static gboolean
+on_timeout_notify_changes (gpointer data)
+{
+ ModestAccountMgr *self = MODEST_ACCOUNT_MGR (data);
+ ModestAccountMgrPrivate *priv = MODEST_ACCOUNT_MGR_GET_PRIVATE (self);