diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2010-12-14 09:12:33 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2010-12-14 09:12:33 +0000 |
commit | f985d12decd4b43be0961afc38697970468f9042 (patch) | |
tree | 130be403d41bfb80054a9729ce349228fb84197f | |
parent | 4864d951f52cf49cad59c0e8721d290345d275c6 (diff) |
disconnect all current sessions of remote folders when going offline.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2754 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | libsylph/folder.c | 20 | ||||
-rw-r--r-- | libsylph/folder.h | 2 | ||||
-rw-r--r-- | libsylph/libsylph-0.def | 1 | ||||
-rw-r--r-- | src/mainwindow.c | 1 |
5 files changed, 30 insertions, 0 deletions
@@ -1,5 +1,11 @@ 2010-12-14 + * libsylph/folder.[ch] + src/mainwindow.c: disconnect all current sessions of remote folders + when going offline. + +2010-12-14 + * src/summaryview.c: reverted the behavior when 'Always open messages in summary when selected' is off (don't display a message when opening a folder). diff --git a/libsylph/folder.c b/libsylph/folder.c index 74ab3df7..97c13237 100644 --- a/libsylph/folder.c +++ b/libsylph/folder.c @@ -162,6 +162,26 @@ void folder_remote_folder_destroy(RemoteFolder *rfolder) session_destroy(rfolder->session); } +gint folder_remote_folder_destroy_all_sessions(void) +{ + GList *list; + Folder *folder; + RemoteFolder *rfolder; + + for (list = folder_list; list != NULL; list = list->next) { + folder = FOLDER(list->data); + if (FOLDER_IS_REMOTE(folder)) { + rfolder = REMOTE_FOLDER(folder); + if (rfolder->session) { + session_destroy(rfolder->session); + rfolder->session = NULL; + } + } + } + + return 0; +} + gint folder_scan_tree(Folder *folder) { g_return_val_if_fail(folder != NULL, -1); diff --git a/libsylph/folder.h b/libsylph/folder.h index c3822c39..81f90f0a 100644 --- a/libsylph/folder.h +++ b/libsylph/folder.h @@ -333,6 +333,8 @@ void folder_destroy (Folder *folder); void folder_local_folder_destroy (LocalFolder *lfolder); void folder_remote_folder_destroy(RemoteFolder *rfolder); +gint folder_remote_folder_destroy_all_sessions (void); + gint folder_scan_tree (Folder *folder); gint folder_create_tree (Folder *folder); diff --git a/libsylph/libsylph-0.def b/libsylph/libsylph-0.def index 287e5306..8f7223b8 100644 --- a/libsylph/libsylph-0.def +++ b/libsylph/libsylph-0.def @@ -692,3 +692,4 @@ EXPORTS socks_connect @ 690
socks4_connect @ 691
socks5_connect @ 692
+ folder_remote_folder_destroy_all_sessions @ 693
diff --git a/src/mainwindow.c b/src/mainwindow.c index c71b3ac2..2eb2e6b0 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -3089,6 +3089,7 @@ static void online_switch_clicked(GtkWidget *widget, gpointer data) gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), TRUE); inc_autocheck_timer_remove(); + folder_remote_folder_destroy_all_sessions(); } else { prefs_common.online_mode = TRUE; gtk_widget_hide(mainwin->offline_pixmap); |