From e0f81db6578881e671dd5539cf7b4cb7ca5f526d Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Wed, 8 Oct 2014 17:45:20 +0200 Subject: [PATCH] re-add the _BMCItem_ class for binary compatibility. This was removed in hrev17147, because our implementation of BMenuItem does not uses it anymore. However, we must keep it in order to properly unarchive BMenuFields that were archived in BeOS. One application that was crashing because of this is VNCViewer. --- src/kits/interface/BMCPrivate.cpp | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/kits/interface/BMCPrivate.cpp b/src/kits/interface/BMCPrivate.cpp index 4e27aa5bd4..581c755271 100644 --- a/src/kits/interface/BMCPrivate.cpp +++ b/src/kits/interface/BMCPrivate.cpp @@ -25,6 +25,38 @@ static const float kPopUpIndicatorWidth = 13.0f; +#if __GNUC__ == 2 + + +// This is kept only for binary compatibility with BeOS R5. This class was +// used in their BMenuField implementation and we may come across some archived +// BMenuField that needs it. +class _BMCItem_: public BMenuItem { +public: + _BMCItem_(BMessage* data); + static BArchivable* Instantiate(BMessage *data); +}; + + +_BMCItem_::_BMCItem_(BMessage* data) + : BMenuItem(data) +{ + +} + + +/*static*/ BArchivable* +_BMCItem_::Instantiate(BMessage *data) { + if (validate_instantiation(data, "_BMCItem_")) + return new _BMCItem_(data); + + return NULL; +} + + +#endif + + // #pragma mark - _BMCFilter_