[Commits] [SCM] claws branch, master, updated. 3.13.0-26-g9c03ab8

ticho at claws-mail.org ticho at claws-mail.org
Wed Oct 21 22:22:23 CEST 2015


The branch, master has been updated
       via  9c03ab8c9edc6d50efc09d26bf2d271f61e7c91a (commit)
      from  5ec374526d3d77f9671c9e7b0b25a01e12ca7710 (commit)

Summary of changes:
 src/folderview.c                    |   12 ++++++++++--
 src/folderview.h                    |    1 +
 src/plugins/vcalendar/vcal_folder.c |    3 +--
 3 files changed, 12 insertions(+), 4 deletions(-)


- Log -----------------------------------------------------------------
commit 9c03ab8c9edc6d50efc09d26bf2d271f61e7c91a
Author: Andrej Kacian <andrej at kacian.sk>
Date:   Wed Oct 21 22:21:57 2015 +0200

    Add folderview_get_opened_item() function.

diff --git a/src/folderview.c b/src/folderview.c
index 1db8aa4..9014165 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -554,7 +554,7 @@ void folderview_set_column_order(FolderView *folderview)
 	if (folderview->selected)
 		sel_item = folderview_get_selected_item(folderview);
 	if (folderview->opened)
-		op_item = gtk_cmctree_node_get_row_data(GTK_CMCTREE(ctree), folderview->opened);
+		op_item = folderview_get_opened_item(folderview);
 
 	debug_print("recreating tree...\n");
 	gtk_widget_destroy(folderview->ctree);
@@ -771,7 +771,7 @@ void folderview_set(FolderView *folderview)
 	if (folderview->selected)
 		sel_item = folderview_get_selected_item(folderview);
 	if (folderview->opened)
-		op_item = gtk_cmctree_node_get_row_data(ctree, folderview->opened);
+		op_item = folderview_get_opened_item(folderview);
 
 	folderview->selected = NULL;
 	folderview->opened = NULL;
@@ -991,6 +991,14 @@ FolderItem *folderview_get_selected_item(FolderView *folderview)
 	return gtk_cmctree_node_get_row_data(ctree, folderview->selected);
 }
 
+FolderItem *folderview_get_opened_item(FolderView *folderview)
+{
+	GtkCMCTree *ctree = GTK_CMCTREE(folderview->ctree);
+
+	if (!folderview->opened) return NULL;
+	return gtk_cmctree_node_get_row_data(ctree, folderview->opened);
+}
+
 static void folderview_set_folders(FolderView *folderview)
 {
 	GList *list;
diff --git a/src/folderview.h b/src/folderview.h
index cc36427..d4bb5f5 100644
--- a/src/folderview.h
+++ b/src/folderview.h
@@ -118,6 +118,7 @@ void folderview_select_next_with_flag	(FolderView	*folderview,
 					 gboolean 	 force_open);
 
 FolderItem *folderview_get_selected_item(FolderView	*folderview);
+FolderItem *folderview_get_opened_item(FolderView	*folderview);
 
 void folderview_rescan_tree		(Folder		*folder,
 					 gboolean	 rebuild);
diff --git a/src/plugins/vcalendar/vcal_folder.c b/src/plugins/vcalendar/vcal_folder.c
index ec86574..266f486 100644
--- a/src/plugins/vcalendar/vcal_folder.c
+++ b/src/plugins/vcalendar/vcal_folder.c
@@ -2066,13 +2066,12 @@ static void set_view_cb(GtkAction *gaction, GtkRadioAction *current, gpointer da
 {
 	FolderView *folderview = (FolderView *)data;
 	gint action = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (current));
-	GtkCMCTree *ctree = GTK_CMCTREE(folderview->ctree);
 	FolderItem *item = NULL, *oitem = NULL;
 
 	if (!folderview->selected) return;
 	if (setting_sensitivity) return;
 
-	oitem = gtk_cmctree_node_get_row_data(ctree, folderview->opened);
+	oitem = folderview_get_opened_item(folderview);
 	item = folderview_get_selected_item(folderview);
 
 	if (!item)

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list