2007-04-03 [paul] 2.8.1cvs84
authorPaul Mangan <paul@claws-mail.org>
Tue, 3 Apr 2007 07:08:26 +0000 (07:08 +0000)
committerPaul Mangan <paul@claws-mail.org>
Tue, 3 Apr 2007 07:08:26 +0000 (07:08 +0000)
* src/filtering.c
* src/folder.c
* src/folder.h
* src/prefs_common.c
* src/prefs_common.h
* src/prefs_other.c
Fix sync being done too late
Thanks to Colin

ChangeLog
PATCHSETS
configure.ac
src/filtering.c
src/folder.c
src/folder.h
src/prefs_common.c
src/prefs_common.h
src/prefs_other.c

index 996db1a0cd3790c29dfdbda4f15d15a8d4533605..9bc4af388836425fcf15c3dc6e3f392cf30f8e2a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2007-04-03 [paul]      2.8.1cvs84
+
+       * src/filtering.c
+       * src/folder.c
+       * src/folder.h
+       * src/prefs_common.c
+       * src/prefs_common.h
+       * src/prefs_other.c
+               Fix sync being done too late
+               Thanks to Colin
+
 2007-04-02 [colin]     2.8.1cvs83
 
        * src/summaryview.c
index a548ed386bc514ef3a3ea072d34154492ba9e3c2..78a0efb098020c3ae3b6f1647803a8185e9dfb11 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.16 -r 1.1.2.17 src/image_viewer.c;  cvs diff -u -r 1.94.2.130 -r 1.94.2.131 src/messageview.c;  ) > 2.8.1cvs81.patchset
 ( cvs diff -u -r 1.1.2.22 -r 1.1.2.23 src/plugins/bogofilter/bogofilter_gtk.c;  ) > 2.8.1cvs82.patchset
 ( cvs diff -u -r 1.395.2.294 -r 1.395.2.295 src/summaryview.c;  cvs diff -u -r 1.1.2.28 -r 1.1.2.29 src/plugins/bogofilter/bogofilter.c;  cvs diff -u -r 1.18.2.50 -r 1.18.2.51 src/plugins/spamassassin/spamassassin.c;  ) > 2.8.1cvs83.patchset
+( cvs diff -u -r 1.60.2.30 -r 1.60.2.31 src/filtering.c;  cvs diff -u -r 1.213.2.138 -r 1.213.2.139 src/folder.c;  cvs diff -u -r 1.87.2.39 -r 1.87.2.40 src/folder.h;  cvs diff -u -r 1.204.2.129 -r 1.204.2.130 src/prefs_common.c;  cvs diff -u -r 1.103.2.79 -r 1.103.2.80 src/prefs_common.h;  cvs diff -u -r 1.1.2.22 -r 1.1.2.23 src/prefs_other.c;  ) > 2.8.1cvs84.patchset
index 4daf2e72b7617fbe9102b9e1b0b3af9b7b10f59b..61a0063774d391f5ab09f8090b0bf7aa3cb71026 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=83
+EXTRA_VERSION=84
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index c75d43d17c356d11f849a622700456fa931cfcc8..5dc72a7a4dc5744cee16147f011ca3408ad87e98 100644 (file)
@@ -239,6 +239,8 @@ void filtering_move_and_copy_msgs(GSList *msgs)
                                                batch);
                        }
                        /* we don't reference the msginfos, because caller will do */
+                       if (prefs_common.real_time_sync)
+                               folder_item_synchronise(last_item);
                        g_slist_free(batch);
                        batch = NULL;
                }
index 0b5278ec7bd454951b71f58383e9b3575acfcd36..47d87d8cc14ed04c8f6af07a7755da6df6a32a81 100644 (file)
@@ -100,7 +100,6 @@ static GHashTable *folder_persist_prefs_new (Folder *folder);
 static void folder_persist_prefs_free          (GHashTable *pptable);
 static void folder_item_restore_persist_prefs  (FolderItem *item, GHashTable *pptable);
 
-
 void folder_system_init(void)
 {
        folder_register_class(mh_get_class());
@@ -2054,7 +2053,12 @@ gint folder_item_scan_full(FolderItem *item, gboolean filtering)
                                }
                                g_slist_free(unfiltered);
                        }
-               } 
+                       if (prefs_common.real_time_sync)
+                               folder_item_synchronise(item);
+               } else {
+                       if (prefs_common.real_time_sync)
+                               folder_item_synchronise(item);
+               }
 
                g_slist_free(newmsg_list);
 
@@ -3974,12 +3978,22 @@ void folder_item_update_thaw(void)
        }
 }
 
+void folder_item_synchronise(FolderItem *item)
+{
+       if (!item)
+               return;
+       if (item->prefs->offlinesync && item->folder->klass->synchronise) {
+               statusbar_print_all(_("Synchronising %s for offline use...\n"), item->path ? item->path : "(null)");
+               item->folder->klass->synchronise(item);
+               statusbar_pop_all();
+       }
+}
+
 static void folder_item_synchronise_func(FolderItem *item, gpointer data)
 {
        Folder *folder = (Folder *)data;
        if (folder == NULL || item->folder == folder) {
-               if(item->prefs->offlinesync && item->folder->klass->synchronise)
-                       item->folder->klass->synchronise(item);
+               folder_item_synchronise(item);
        }
 }
 
index 1b2f8ae7be3797bdac72eaa836b1be5fb55bb97d..773fe02f3fedec8d10b727a9c4e10024e8c27eee 100644 (file)
@@ -852,5 +852,5 @@ void folder_item_change_type                (FolderItem *item,
 gboolean folder_get_sort_type          (Folder         *folder,
                                         FolderSortKey  *sort_key,
                                         FolderSortType *sort_type);
-
+void folder_item_synchronise           (FolderItem *item);
 #endif /* __FOLDER_H__ */
index 0f3f618975aea69a53dd411ee3d68bbd70debed2..414b47a007c1ea38a69bc93b8a0ef4ed91926c17 100644 (file)
@@ -979,7 +979,13 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"unsafe_ssl_certs", "FALSE", &prefs_common.unsafe_ssl_certs, P_BOOL,
         NULL, NULL, NULL},
-
+#ifndef MAEMO
+       {"real_time_sync", "FALSE", &prefs_common.real_time_sync, P_BOOL,
+        NULL, NULL, NULL},
+#else
+       {"real_time_sync", "TRUE", &prefs_common.real_time_sync, P_BOOL,
+        NULL, NULL, NULL},
+#endif
        {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
 };
 
index a78615e48072bf4787983e7476b0031f19bb20f0..88756174e122285444bb77486468fb116f509684 100644 (file)
@@ -434,6 +434,7 @@ struct _PrefsCommon
        gint never_send_retrcpt;
        gint hide_quotes;
        gboolean unsafe_ssl_certs;
+       gboolean real_time_sync;
 };
 
 extern PrefsCommon prefs_common;
index 2c65f4d5ac138b081b69344865536baf13a122e4..af55dacb0b8c85f3ee27e85710b34cc94e130d09 100644 (file)
@@ -56,6 +56,7 @@ typedef struct _OtherPage
        GtkWidget *spinbtn_iotimeout;
        GtkWidget *checkbtn_gtk_can_change_accels;
        GtkWidget *checkbtn_askonfilter;
+       GtkWidget *checkbtn_real_time_sync;
 } OtherPage;
 
 static struct KeybindDialog {
@@ -504,7 +505,7 @@ static void prefs_other_create_widget(PrefsPage *_page, GtkWindow *window,
        GtkWidget *vbox2;
        GtkWidget *checkbtn_askonclean;
        GtkWidget *checkbtn_askonfilter;
-
+       GtkWidget *checkbtn_real_time_sync;
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
        gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
@@ -584,6 +585,8 @@ static void prefs_other_create_widget(PrefsPage *_page, GtkWindow *window,
        PACK_CHECK_BUTTON (vbox2, checkbtn_askonfilter,
                           _("Ask about account specific filtering rules when "
                             "filtering manually"));
+       PACK_CHECK_BUTTON (vbox2, checkbtn_real_time_sync,
+                          _("Synchronise offline folders as soon as possible"));
 
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_addaddrbyclick), 
                prefs_common.add_address_by_click);
@@ -603,6 +606,8 @@ static void prefs_other_create_widget(PrefsPage *_page, GtkWindow *window,
 
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_askonfilter), 
                prefs_common.ask_apply_per_account_filtering_rules);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_real_time_sync), 
+               prefs_common.real_time_sync);
 
        prefs_other->checkbtn_addaddrbyclick = checkbtn_addaddrbyclick;
        prefs_other->checkbtn_confonexit = checkbtn_confonexit;
@@ -612,6 +617,7 @@ static void prefs_other_create_widget(PrefsPage *_page, GtkWindow *window,
        prefs_other->spinbtn_iotimeout = spinbtn_iotimeout;
        prefs_other->checkbtn_gtk_can_change_accels = checkbtn_gtk_can_change_accels;
        prefs_other->checkbtn_askonfilter = checkbtn_askonfilter;
+       prefs_other->checkbtn_real_time_sync = checkbtn_real_time_sync;
 
        prefs_other->page.widget = vbox1;
 }
@@ -640,6 +646,9 @@ static void prefs_other_save(PrefsPage *_page)
        prefs_common.ask_apply_per_account_filtering_rules = 
                gtk_toggle_button_get_active(
                        GTK_TOGGLE_BUTTON(page->checkbtn_askonfilter)); 
+       prefs_common.real_time_sync = 
+               gtk_toggle_button_get_active(
+                       GTK_TOGGLE_BUTTON(page->checkbtn_real_time_sync)); 
 
        gtk_can_change_accels = gtk_toggle_button_get_active(
                GTK_TOGGLE_BUTTON(page->checkbtn_gtk_can_change_accels));