[Commits] [SCM] claws branch, master, updated. 3.13.2-190-g4306c9e

ticho at claws-mail.org ticho at claws-mail.org
Thu Jul 21 12:04:24 CEST 2016


The branch, master has been updated
       via  4306c9eaa2f13d2fe56938f66b40e5a187242821 (commit)
       via  574ec56dde36a21826023838bfab9ec20dd77255 (commit)
      from  3ed994a5e61da4972594c68def857cb58039bd99 (commit)

Summary of changes:
 src/folderview.c               |   12 ++++++++++++
 src/folderview.h               |    3 +++
 src/main.c                     |   22 ++++++++--------------
 src/plugins/rssyl/rssyl_feed.c |    4 ++--
 4 files changed, 25 insertions(+), 16 deletions(-)


- Log -----------------------------------------------------------------
commit 4306c9eaa2f13d2fe56938f66b40e5a187242821
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Thu Jul 21 12:02:30 2016 +0200

    Use folderview_freeze/thaw() functions outside of folderview.c.
    
    These are modeled after summary_freeze/thaw().

diff --git a/src/folderview.c b/src/folderview.c
index 4ddd386..055ca5b 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -3172,3 +3172,15 @@ void folderview_unregister_popup(FolderViewPopup *fpopup)
 	}	
 	g_hash_table_remove(folderview_popups, fpopup->klass);
 }
+
+void folderview_freeze(FolderView *folderview)
+{
+	if (folderview)
+		gtk_cmclist_freeze(GTK_CMCLIST(folderview->ctree));
+}
+
+void folderview_thaw(FolderView *folderview)
+{
+	if (folderview)
+		gtk_cmclist_thaw(GTK_CMCLIST(folderview->ctree));
+}
diff --git a/src/folderview.h b/src/folderview.h
index d4bb5f5..a53c051 100644
--- a/src/folderview.h
+++ b/src/folderview.h
@@ -148,4 +148,7 @@ void folderview_finish_dnd		(const gchar 		*data,
 					 FolderItem 		*item);
 void folderview_close_opened		(FolderView 		*folderview);
 
+void folderview_freeze(FolderView *folderview);
+void folderview_thaw(FolderView *folderview);
+
 #endif /* __FOLDERVIEW_H__ */
diff --git a/src/main.c b/src/main.c
index 497cd30..15b479f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1300,7 +1300,7 @@ int main(int argc, char *argv[])
 	manage_window_focus_in(mainwin->window, NULL, NULL);
 	folderview = mainwin->folderview;
 
-	gtk_cmclist_freeze(GTK_CMCLIST(mainwin->folderview->ctree));
+	folderview_freeze(mainwin->folderview);
 	folder_item_update_freeze();
 
 	passwd_store_read_config();
@@ -1517,7 +1517,7 @@ int main(int argc, char *argv[])
 #endif
 
 	folder_item_update_thaw();
-	gtk_cmclist_thaw(GTK_CMCLIST(mainwin->folderview->ctree));
+	folderview_thaw(mainwin->folderview);
 	main_window_cursor_normal(mainwin);
 
 	if (!cmd.target && prefs_common.goto_last_folder_on_startup &&
diff --git a/src/plugins/rssyl/rssyl_feed.c b/src/plugins/rssyl/rssyl_feed.c
index 302ddc0..dc3fbd4 100644
--- a/src/plugins/rssyl/rssyl_feed.c
+++ b/src/plugins/rssyl/rssyl_feed.c
@@ -63,7 +63,7 @@ FolderItem *rssyl_feed_subscribe_new(FolderItem *parent, const gchar *url,
 
 	myurl = g_strchomp(myurl);
 
-	gtk_cmclist_freeze(GTK_CMCLIST(mainwindow_get_mainwindow()->folderview->ctree));
+	folderview_freeze(mainwindow_get_mainwindow()->folderview);
 	folder_item_update_freeze();
 
 	/* Create a feed folder with generic name. */
@@ -92,7 +92,7 @@ FolderItem *rssyl_feed_subscribe_new(FolderItem *parent, const gchar *url,
 	}
 
 	folder_item_update_thaw();
-	gtk_cmclist_thaw(GTK_CMCLIST(mainwindow_get_mainwindow()->folderview->ctree));
+	folderview_thaw(mainwindow_get_mainwindow()->folderview);
 
 	if( success )
 		log_print(LOG_PROTOCOL, RSSYL_LOG_SUBSCRIBED, ritem->official_title,

commit 574ec56dde36a21826023838bfab9ec20dd77255
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Thu Jul 21 11:54:36 2016 +0200

    Make exit_claws() use folderview API and not reach inside _FolderView struct.

diff --git a/src/main.c b/src/main.c
index 4c39b50..497cd30 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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 */

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list