Added summary_get_selection_count() function.
authorAndrej Kacian <ticho@claws-mail.org>
Thu, 16 Mar 2017 17:37:30 +0000 (18:37 +0100)
committerAndrej Kacian <ticho@claws-mail.org>
Thu, 16 Mar 2017 17:37:30 +0000 (18:37 +0100)
src/summaryview.c
src/summaryview.h

index 77ad51a..b563297 100644 (file)
@@ -7085,6 +7085,19 @@ GSList *summary_get_selection(SummaryView *summaryview)
        return g_slist_reverse(msginfo_list);
 }
 
+/*
+ * \brief get number of messages currently selected in SummaryView
+ *
+ * \param summaryview
+ *
+ * \return number of messages currently selected
+ */
+guint summary_get_selection_count(SummaryView *summaryview)
+{
+       cm_return_val_if_fail(summaryview != NULL, 0);
+       return g_list_length(GTK_CMCLIST(summaryview->ctree)->selection);
+}
+
 static void summary_sort_by_column_click(SummaryView *summaryview,
                                         FolderSortKey sort_key)
 {
index 2d192e5..1174bf9 100644 (file)
@@ -267,6 +267,7 @@ void summary_move_to                  (SummaryView          *summaryview);
 void summary_copy_selected_to    (SummaryView          *summaryview,
                                   FolderItem           *to_folder);
 GSList *summary_get_selection    (SummaryView          *summaryview);
+guint summary_get_selection_count (SummaryView         *summaryview);
 void summary_copy_to             (SummaryView          *summaryview);
 void summary_save_as             (SummaryView          *summaryview);
 void summary_print               (SummaryView          *summaryview);