MenuItem::Archive uses BArchivable::Archive

inverted the enable state when initing the BMenu


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18071 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2006-07-08 12:56:18 +00:00
parent d4d2597fef
commit 9fcdf0e92c
3 changed files with 5 additions and 13 deletions
+3 -1
View File
@@ -1161,7 +1161,9 @@ BMenu::InitData(BMessage *data)
if (data != NULL) {
data->FindInt32("_layout", (int32 *)&fLayout);
data->FindBool("_rsize_to_fit", &fResizeToFit);
data->FindBool("_disable", &fEnabled);
bool disabled;
if (data->FindBool("_disable", &disabled) == B_OK)
fEnabled = !disabled;
data->FindBool("_radio", &fRadioMode);
bool disableTrigger = false;
+2 -7
View File
@@ -179,16 +179,11 @@ BMenuItem::Instantiate(BMessage *data)
}
extern const char* B_CLASS_FIELD;
status_t
BMenuItem::Archive(BMessage *data, bool deep) const
{
status_t ret = B_OK;
if (!data->HasString(B_CLASS_FIELD))
ret = data->AddString(B_CLASS_FIELD, "BMenuItem");
status_t ret = BArchivable::Archive(data, deep);
if (ret == B_OK && fLabel)
ret = data->AddString("_label", Label());
-5
View File
@@ -33,14 +33,9 @@ BSeparatorItem::~BSeparatorItem()
}
extern const char* B_CLASS_FIELD;
status_t
BSeparatorItem::Archive(BMessage* archive, bool deep) const
{
if (!archive->HasString(B_CLASS_FIELD))
archive->AddString(B_CLASS_FIELD, "BMenuItem");
return BMenuItem::Archive(archive, deep);
}