From 23db715ed814bfc7ff9b38c4b6a6875b64dbd83b Mon Sep 17 00:00:00 2001 From: Jaidyn Ann Date: Sun, 15 Nov 2020 12:26:50 -0600 Subject: [PATCH] Prevent reinstallation of already-defined mimetype --- src/Mimetypes.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Mimetypes.cpp b/src/Mimetypes.cpp index 0a2a029..576568a 100644 --- a/src/Mimetypes.cpp +++ b/src/Mimetypes.cpp @@ -1,4 +1,5 @@ // borrowed significantly from mailserver. thanks! <3 +#include #include #include #include @@ -10,6 +11,9 @@ feedMimeType ( ) { BMessage info; BMimeType mime( "text/x-feed-entry" ); + if ( mime.IsInstalled() ) return true; + + std::cout << "NOT INSTALLED"; mime.GetAttrInfo( &info ); mime.SetShortDescription( "Feed Entry" ); @@ -22,7 +26,6 @@ feedMimeType ( ) addAttribute( info, "FEED:when", "When", B_TIME_TYPE, 150 ); mime.SetAttrInfo( &info ); - return true; } @@ -39,5 +42,5 @@ addAttribute msg.AddInt32( "attr:alignment", B_ALIGN_LEFT ); msg.AddBool( "attr:extra", false ); msg.AddBool( "attr:viewable", true ); - msg.AddBool( "attr:editable", false ); + msg.AddBool( "attr:editable", true ); }