0.9.10claws50
authorChristoph Hohmann <reboot@gmx.ch>
Thu, 22 Apr 2004 11:13:10 +0000 (11:13 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Thu, 22 Apr 2004 11:13:10 +0000 (11:13 +0000)
* src/folderutils.[ch]
        add folderutils_mark_all_read()

* src/folderview.c
        readd "mark all read" from popup menu, now works
        in all folders and not only the opened folder

ChangeLog.claws
configure.ac
src/folderutils.c
src/folderutils.h
src/folderview.c
src/summaryview.c

index b4e01c2..b40d153 100644 (file)
@@ -1,3 +1,12 @@
+2004-04-22 [christoph] 0.9.10claws50
+
+       * src/folderutils.[ch]
+               add folderutils_mark_all_read()
+
+       * src/folderview.c
+               readd "mark all read" from popup menu, now works
+               in all folders and not only the opened folder
+
 2004-04-21 [christoph] 0.9.10claws49
 
        * src/Makefile.am
index 2de64ab..dcc4ea0 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=10
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=49
+EXTRA_VERSION=50
 
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
index abc6549..0396372 100644 (file)
@@ -101,3 +101,26 @@ gint folderutils_delete_duplicates(FolderItem *item,
 
        return dups;    
 }
+
+void folderutils_mark_all_read(FolderItem *item)
+{
+       MsgInfoList *msglist, *cur;
+
+       g_return_if_fail(item != NULL);
+
+       msglist = folder_item_get_msg_list(item);
+       if (msglist == NULL)
+               return;
+
+       folder_item_update_freeze();
+       for (cur = msglist; cur != NULL; cur = g_slist_next(cur)) {
+               MsgInfo *msginfo = cur->data;
+
+               if (msginfo->flags.perm_flags & (MSG_NEW | MSG_UNREAD))
+                       procmsg_msginfo_unset_flags(msginfo, MSG_NEW | MSG_UNREAD, 0);
+               procmsg_msginfo_free(msginfo);
+       }
+       folder_item_update_thaw();
+
+       g_slist_free(msglist);
+}
index 82235e6..7fdb1e8 100644 (file)
@@ -29,5 +29,6 @@ typedef enum {
 
 gint folderutils_delete_duplicates(FolderItem *item,
                                   DeleteDuplicatesMode mode);
+void folderutils_mark_all_read   (FolderItem *item);
 
 #endif /* FOLDERUTILS_H */
index f1a1c12..1eb461d 100644 (file)
@@ -61,6 +61,7 @@
 #include "inc.h"
 #include "statusbar.h"
 #include "hooks.h"
+#include "folderutils.h"
 
 typedef enum
 {
@@ -553,10 +554,13 @@ void folderview_select(FolderView *folderview, FolderItem *item)
 static void mark_all_read_cb(FolderView *folderview, guint action,
                              GtkWidget *widget)
 {
-/* TODO: claws can do this in all folders not just the opened folder
-       if (folderview->selected)
-               summary_mark_all_read(folderview->summaryview);
-*/
+       FolderItem *item;
+
+       item = folderview_get_selected(folderview);
+       if (item == NULL)
+               return;
+
+       folderutils_mark_all_read(item);
 }
 
 static void folderview_select_node(FolderView *folderview, GtkCTreeNode *node)
index 01b49fa..397f797 100644 (file)
@@ -2960,8 +2960,8 @@ void summary_mark_all_read(SummaryView *summaryview)
        for (node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list); node != NULL;
             node = gtkut_ctree_node_next(ctree, node))
                summary_mark_row_as_read(summaryview, node);
-       gtk_clist_thaw(clist);
        folder_item_update_thaw();
+       gtk_clist_thaw(clist);
 
        summary_status_show(summaryview);
 }