From 35ab40ee3e0a39c4a9958a165f27baa339635ea9 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 30 Aug 2002 20:03:06 +0000 Subject: [PATCH] Database::SetSupportedTypes() now installs the not yet installed supported types. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@941 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/storage/mime/Database.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/kits/storage/mime/Database.cpp b/src/kits/storage/mime/Database.cpp index b691afcad1..73854669c3 100644 --- a/src/kits/storage/mime/Database.cpp +++ b/src/kits/storage/mime/Database.cpp @@ -375,6 +375,17 @@ Database::SetSupportedTypes(const char *type, const BMessage *types, bool fullSy DBG(OUT("Database::SetSupportedTypes()\n")); bool didCreate = false; status_t err = (type && types) ? B_OK : B_BAD_VALUE; + // Install the types + if (!err) { + const char *supportedType; + for (int32 i = 0; + err == B_OK + && types->FindString("types", i, &supportedType) == B_OK; + i++) { + if (!is_installed(supportedType)) + err = Install(supportedType); + } + } // Write the attr if (!err) err = write_mime_attr_message(type, kSupportedTypesAttr, types, &didCreate); @@ -604,6 +615,7 @@ Database::DeletePreferredApp(const char *type, app_verb verb = B_OPEN) */ if (!err) err = SendMonitorUpdate(B_PREFERRED_APP_CHANGED, type, B_META_MIME_DELETED); + return err; } status_t