Changeset 24618

Show
Ignore:
Timestamp:
03/28/08 02:45:16 (2 months ago)
Author:
bonefish
Message:
When failing to remove MIME DB attributes that don't exist, don't fail
anymore. This concerned mimeset for instance. The Haiku build under
Haiku now gets a little further.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • haiku/trunk/src/servers/registrar/mime/Database.cpp

    r23423 r24618  
    955955        if (status == B_OK) 
    956956                _SendMonitorUpdate(B_APP_HINT_CHANGED, type, B_META_MIME_DELETED); 
     957        else if (status == B_ENTRY_NOT_FOUND) 
     958                status = B_OK; 
    957959 
    958960        return status; 
     
    975977        if (status == B_OK) 
    976978                _SendMonitorUpdate(B_ATTR_INFO_CHANGED, type, B_META_MIME_DELETED); 
     979        else if (status == B_ENTRY_NOT_FOUND) 
     980                status = B_OK; 
    977981 
    978982        return status; 
     
    995999        if (status == B_OK) 
    9961000                _SendMonitorUpdate(B_SHORT_DESCRIPTION_CHANGED, type, B_META_MIME_DELETED); 
     1001        else if (status == B_ENTRY_NOT_FOUND) 
     1002                status = B_OK; 
    9971003 
    9981004        return status; 
     
    10151021        if (status == B_OK) 
    10161022                _SendMonitorUpdate(B_LONG_DESCRIPTION_CHANGED, type, B_META_MIME_DELETED); 
     1023        else if (status == B_ENTRY_NOT_FOUND) 
     1024                status = B_OK; 
    10171025 
    10181026        return status; 
     
    10351043        if (status == B_OK) 
    10361044                _SendMonitorUpdate(B_FILE_EXTENSIONS_CHANGED, type, B_META_MIME_DELETED); 
     1045        else if (status == B_ENTRY_NOT_FOUND) 
     1046                status = B_OK; 
    10371047 
    10381048        return status; 
     
    10571067        if (status == B_OK) 
    10581068                _SendMonitorUpdate(B_ICON_CHANGED, type, which, B_META_MIME_DELETED); 
     1069        else if (status == B_ENTRY_NOT_FOUND) 
     1070                status = B_OK; 
    10591071 
    10601072        return status; 
     
    10741086Database::DeleteIcon(const char *type) 
    10751087{ 
    1076         // TODO: exta notification for vector icon (uses B_LARGE_ICON now) 
     1088        // TODO: extra notification for vector icon (uses B_LARGE_ICON now) 
    10771089        status_t status = delete_attribute(type, kIconAttr); 
    1078         if (status == B_OK) 
     1090        if (status == B_OK) { 
    10791091                _SendMonitorUpdate(B_ICON_CHANGED, type, B_LARGE_ICON, 
    10801092                                                   B_META_MIME_DELETED); 
     1093        } else if (status == B_ENTRY_NOT_FOUND) 
     1094                status = B_OK; 
    10811095 
    10821096        return status; 
     
    11121126                _SendMonitorUpdate(B_ICON_FOR_TYPE_CHANGED, type, fileType, 
    11131127                        which == B_LARGE_ICON, B_META_MIME_DELETED); 
    1114         } 
     1128        } else if (status == B_ENTRY_NOT_FOUND) 
     1129                status = B_OK; 
    11151130 
    11161131        return status; 
     
    11461161                _SendMonitorUpdate(B_ICON_FOR_TYPE_CHANGED, type, fileType, 
    11471162                        true, B_META_MIME_DELETED); 
    1148         } 
     1163        } else if (status == B_ENTRY_NOT_FOUND) 
     1164                status = B_OK; 
    11491165 
    11501166        return status; 
     
    11821198        if (status == B_OK) 
    11831199                _SendMonitorUpdate(B_PREFERRED_APP_CHANGED, type, B_META_MIME_DELETED); 
     1200        else if (status == B_ENTRY_NOT_FOUND) 
     1201                status = B_OK; 
    11841202 
    11851203        return status; 
     
    12011219{ 
    12021220        status_t status = delete_attribute(type, kSnifferRuleAttr); 
    1203         if (status == B_OK) 
     1221        if (status == B_OK) { 
    12041222                status = fSnifferRules.DeleteSnifferRule(type); 
    1205         if (status == B_OK) 
    1206                 _SendMonitorUpdate(B_SNIFFER_RULE_CHANGED, type, B_META_MIME_DELETED); 
     1223                if (status == B_OK) { 
     1224                        _SendMonitorUpdate(B_SNIFFER_RULE_CHANGED, type, 
     1225                                B_META_MIME_DELETED); 
     1226                } 
     1227        } else if (status == B_ENTRY_NOT_FOUND) 
     1228                status = B_OK; 
    12071229 
    12081230        return status; 
     
    12341256        // stranded types *may* exist in the database due to previous 
    12351257        // calls to {Set,Delete}SupportedTypes() with fullSync == false. 
     1258        bool sendUpdate = true; 
    12361259        if (status == B_OK) 
    12371260                status = fSupportingApps.DeleteSupportedTypes(type, fullSync); 
    1238         else if (fullSync && status == B_ENTRY_NOT_FOUND) 
    1239                 fSupportingApps.DeleteSupportedTypes(type, fullSync); 
     1261        else if (status == B_ENTRY_NOT_FOUND) { 
     1262                status = B_OK; 
     1263                if (fullSync) 
     1264                        fSupportingApps.DeleteSupportedTypes(type, fullSync); 
     1265                else 
     1266                        sendUpdate = false; 
     1267        } 
    12401268 
    12411269        // Send a monitor notification 
    1242         if (status == B_OK
     1270        if (status == B_OK && sendUpdate
    12431271                _SendMonitorUpdate(B_SUPPORTED_TYPES_CHANGED, type, B_META_MIME_DELETED); 
    12441272