2009-01-06 [colin] 3.7.0cvs15
[claws.git] / src / mainwindow.c
index 8ca4be2ff22c1ca0c1a03ce95c22bd61a03a0ff5..09d85068ecabaff59c4c1431fc6147c03693af69 100644 (file)
@@ -4191,7 +4191,7 @@ static void online_switch_clicked (GtkButton *btn, gpointer data)
        MainWindow *mainwin;
        gboolean have_connectivity;
 
        MainWindow *mainwin;
        gboolean have_connectivity;
 
-#ifdef HAVE_NETWORKMANAGER
+#ifdef HAVE_NETWORKMANAGER_SUPPORT
        have_connectivity = networkmanager_is_online(NULL); 
 #else
        have_connectivity = TRUE;
        have_connectivity = networkmanager_is_online(NULL); 
 #else
        have_connectivity = TRUE;
@@ -4217,7 +4217,8 @@ static void online_switch_clicked (GtkButton *btn, gpointer data)
                if(have_connectivity)
                        mainwindow_check_synchronise(mainwin, TRUE);
                prefs_common.work_offline = TRUE;
                if(have_connectivity)
                        mainwindow_check_synchronise(mainwin, TRUE);
                prefs_common.work_offline = TRUE;
-               imap_disconnect_all();
+               if(have_connectivity)
+                       imap_disconnect_all();
                hooks_invoke(OFFLINE_SWITCH_HOOKLIST, NULL);
        } else {
                /*go online */
                hooks_invoke(OFFLINE_SWITCH_HOOKLIST, NULL);
        } else {
                /*go online */