diff --git a/src/Mimetypes.cpp b/src/Mimetypes.cpp index 863f16a..0a2a029 100644 --- a/src/Mimetypes.cpp +++ b/src/Mimetypes.cpp @@ -1,4 +1,5 @@ // borrowed significantly from mailserver. thanks! <3 +#include #include #include #include @@ -9,26 +10,19 @@ feedMimeType ( ) { BMessage info; BMimeType mime( "text/x-feed-entry" ); + mime.GetAttrInfo( &info ); - if ( mime.InitCheck() != B_OK ) { - return false; - } + mime.SetShortDescription( "Feed Entry" ); + mime.SetLongDescription( "Atom/RSS Feed Entry" ); - if ( !mime.IsInstalled() ) { - mime.Delete(); - mime.Install(); + addAttribute( info, "FEED:name", "Name" ); + addAttribute( info, "FEED:description", "Description" ); + addAttribute( info, "META:url", "URL" ); + addAttribute( info, "FEED:source", "Source" ); + addAttribute( info, "FEED:when", "When", B_TIME_TYPE, 150 ); - addAttribute( info, "FEED:name", "Name" ); - addAttribute( info, "FEED:description", "Description" ); - addAttribute( info, "META:url", "URL" ); - addAttribute( info, "FEED:source", "Source" ); - addAttribute( info, "FEED:when", "When", B_TIME_TYPE, true, false, 150 ); + mime.SetAttrInfo( &info ); - mime.SetAttrInfo(&info); - - mime.SetShortDescription("Feed Entry"); - mime.SetLongDescription("RSS/Atom Feed Entry"); - } return true; } @@ -36,13 +30,14 @@ feedMimeType ( ) static void addAttribute -( BMessage& msg, const char* name, const char* publicName, int32 type, bool viewable, bool editable, - int32 width) +( BMessage& msg, const char* name, const char* publicName, int32 type, int32 width ) { msg.AddString( "attr:name", name ); msg.AddString( "attr:public_name", publicName ); msg.AddInt32( "attr:type", type ); - msg.AddBool( "attr:viewable", viewable ); - msg.AddBool( "attr:editable", editable ); msg.AddInt32( "attr:width", width ); + msg.AddInt32( "attr:alignment", B_ALIGN_LEFT ); + msg.AddBool( "attr:extra", false ); + msg.AddBool( "attr:viewable", true ); + msg.AddBool( "attr:editable", false ); } diff --git a/src/Mimetypes.h b/src/Mimetypes.h index 2501e3c..953e399 100644 --- a/src/Mimetypes.h +++ b/src/Mimetypes.h @@ -7,8 +7,7 @@ bool feedMimeType ( ); static void addAttribute -( BMessage&, const char*, const char*, int32 type = B_STRING_TYPE, bool viewable = true, - bool editable = false, int32 width = 200); +( BMessage&, const char*, const char*, int32 type = B_STRING_TYPE, int32 width = 200); #endif