[haiku-development] Re: ShowImageSettings

  • From: Clemens <clemens.zeidler@xxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 28 Aug 2012 08:27:31 +1200

On Sat, 25 Aug 2012 00:47:51 +1200, Fredrik Modèen <fredrik@xxxxxxxxx> wrote:


Hi

I'm considering to use ShowImageSettings in Bluetooth.
http://cgit.haiku-os.org/haiku/tree/src/apps/showimage/ShowImageSettings.h
(if there are no class in BAPI for the same purpose)

That would involve copy it over there. Would it be better to make it part
of a kit, say support kit?

I don't think I know how to make the class good enough to make it public
(except perhaps renaming it to BSettings)

Compared to a BMessage this class is very limited, i.e. not all data types and no indices are supported. As Axel said, maybe it's better to add some more convenience method to BMessage directly.

I would also vote to just provide some helper methods to store a BMessage as an attribute or flatten it to a file, e.g.:

static BSomeFittingNamespace::SaveToAttribute(const BMessage* msg, const char* attribute, BNode* storage); static BSomeFittingNamespace::SaveToApplicationFile(const BMessage* msg, const char* attribute); static BSomeFittingNamespace::SaveToFile(const BMessage* msg, BDataIO* storage);

When it comes to locking maybe a BLockableMessage decorator for a BMessage would be more versatile?

Cheers,
        Clemens

Other related posts: