Make exit_claws() use folderview API and not reach inside _FolderView struct.
authorAndrej Kacian <ticho@claws-mail.org>
Thu, 21 Jul 2016 09:54:36 +0000 (11:54 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Thu, 21 Jul 2016 09:54:36 +0000 (11:54 +0200)
src/main.c

index 4c39b50..497cd30 100644 (file)
@@ -1614,6 +1614,7 @@ static void exit_claws(MainWindow *mainwin)
 {
        gchar *filename;
        gboolean have_connectivity;
+       FolderItem *item;
 
        sc_exiting = TRUE;
 
@@ -1626,18 +1627,11 @@ static void exit_claws(MainWindow *mainwin)
 #endif
 
        /* save prefs for opened folder */
-       if(mainwin->folderview->opened) {
-               FolderItem *item;
-
-               item = gtk_cmctree_node_get_row_data(
-                       GTK_CMCTREE(mainwin->folderview->ctree),
-                       mainwin->folderview->opened);
-               if (item) {
-                       summary_save_prefs_to_folderitem(
-                               mainwin->folderview->summaryview, item);
-                       prefs_common.last_opened_folder = 
-                               folder_item_get_identifier(item);
-               }
+       if((item = folderview_get_opened_item(mainwin->folderview)) != NULL) {
+               summary_save_prefs_to_folderitem(
+                       mainwin->summaryview, item);
+               prefs_common.last_opened_folder =
+                       folder_item_get_identifier(item);
        }
 
        /* save all state before exiting */