From 805b68a9262686c53b4aa2f28b3d0c4b6d7196f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 5 Feb 2007 14:43:37 +0000 Subject: [PATCH] Fixed the bug I introduced yesterday that all queried "Close and ..." items would set the status to "_status" instead of the actual status. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20073 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/bemail/Mail.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/apps/bemail/Mail.cpp b/src/apps/bemail/Mail.cpp index 5a696c7bb9..64b91704dd 100644 --- a/src/apps/bemail/Mail.cpp +++ b/src/apps/bemail/Mail.cpp @@ -203,6 +203,8 @@ add_query_menu_items(BMenu* menu, const char* attribute, uint32 what, if (file.ReadAttrString(attribute, &value) < B_OK) continue; + message->AddString("attribute", value.String()); + char name[256]; if (format != NULL) snprintf(name, sizeof(name), format, value.String()); @@ -2284,10 +2286,12 @@ TMailWindow::MessageReceived(BMessage *msg) case M_STATUS: { - BMenuItem *menu; - msg->FindPointer("source", (void **)&menu); + const char* attribute; + if (msg->FindString("attribute", &attribute) != B_OK) + break; + BMessage message(B_CLOSE_REQUESTED); - message.AddString("status", menu->Label()); + message.AddString("status", attribute); PostMessage(&message); break; }