[haiku-commits] r41063 - haiku/trunk/src/apps/mail

  • From: clemens.zeidler@xxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 21 Mar 2011 10:38:13 +0100 (CET)

Author: czeidler
Date: 2011-03-21 10:38:12 +0100 (Mon, 21 Mar 2011)
New Revision: 41063
Changeset: https://dev.haiku-os.org/changeset/41063
Ticket: https://dev.haiku-os.org/ticket/7382

Modified:
   haiku/trunk/src/apps/mail/MailWindow.cpp
Log:
Leave status when quit window using the control+shift+w shortcut. Fixes #7382.



Modified: haiku/trunk/src/apps/mail/MailWindow.cpp
===================================================================
--- haiku/trunk/src/apps/mail/MailWindow.cpp    2011-03-21 09:13:12 UTC (rev 
41062)
+++ haiku/trunk/src/apps/mail/MailWindow.cpp    2011-03-21 09:38:12 UTC (rev 
41063)
@@ -188,7 +188,6 @@
        BMenu* subMenu;
        BMenuItem* item;
        BMessage* msg;
-       attr_info info;
        BFile file(ref, B_READ_ONLY);
 
        if (ref) {
@@ -240,14 +239,13 @@
                menu->AddSeparatorItem();
 
                subMenu = new BMenu(B_TRANSLATE("Close and "));
-               if (file.GetAttrInfo(B_MAIL_ATTR_STATUS, &info) == B_NO_ERROR)
-                       file.ReadAttr(B_MAIL_ATTR_STATUS, B_STRING_TYPE, 0, 
str, info.size);
-               else
-                       str[0] = 0;
 
-               if (!strcmp(str, "New")) {
+               read_flags flag;
+               read_read_attr(file, flag);
+
+               if (flag == B_UNREAD) {
                        subMenu->AddItem(item = new 
BMenuItem(B_TRANSLATE("Leave as New"),
-                               new BMessage(B_QUIT_REQUESTED), 'W', 
B_SHIFT_KEY));
+                               new BMessage(kMsgQuitAndKeepAllStatus), 'W', 
B_SHIFT_KEY));
 #if 0
                        subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Set 
to Read"),
                                new BMessage(M_CLOSE_READ), 'W'));
@@ -260,7 +258,7 @@
                        subMenu->AddItem(item = new BMenuItem(status,
                                                        new 
BMessage(B_QUIT_REQUESTED), 'W'));
                        AddShortcut('W', B_COMMAND_KEY | B_SHIFT_KEY,
-                               new BMessage(B_QUIT_REQUESTED));
+                               new BMessage(kMsgQuitAndKeepAllStatus));
                }
 
                subMenu->AddItem(new BMenuItem(B_TRANSLATE("Move to trash"),


Other related posts:

  • » [haiku-commits] r41063 - haiku/trunk/src/apps/mail - clemens . zeidler