Ticket #10071: 0001-MIME-DB-Force-setting-BEOS-TYPE-and-META-TYPE-for-su.patch

File 0001-MIME-DB-Force-setting-BEOS-TYPE-and-META-TYPE-for-su.patch, 1.1 KB (added by jessicah, 5 years ago)
  • src/kits/storage/mime/DatabaseLocation.cpp

    From 71bf3ee8d932dc487922c1971c8160a30a7394b7 Mon Sep 17 00:00:00 2001
    From: Jessica Hamilton <jessica.l.hamilton@gmail.com>
    Date: Mon, 26 May 2014 07:44:29 +1200
    Subject: [PATCH] MIME DB: Force setting BEOS:TYPE and META:TYPE for supertypes
    
    ---
     src/kits/storage/mime/DatabaseLocation.cpp | 6 +++++-
     1 file changed, 5 insertions(+), 1 deletion(-)
    
    diff --git a/src/kits/storage/mime/DatabaseLocation.cpp b/src/kits/storage/mime/DatabaseLocation.cpp
    index ec31c1c..91f3809 100644
    a b DatabaseLocation::_CreateTypeNode(const char* type, BNode& _node) const  
    836836    BDirectory superTypeDirectory;
    837837    if (BEntry(&parent, superTypeName).Exists())
    838838        error = superTypeDirectory.SetTo(&parent, superTypeName);
    839     else
     839    else {
    840840        error = parent.CreateDirectory(superTypeName, &superTypeDirectory);
     841        superTypeDirectory.WriteAttr(kFileTypeAttr, kFileTypeType, 0, kMetaMimeType, strlen(kMetaMimeType));
     842        superTypeDirectory.WriteAttr(kTypeAttr, kTypeType, 0, superTypeName.String(), superTypeName.Length());
     843
     844    }
    841845    if (error != B_OK)
    842846        return error;
    843847