Changeset 24618
- Timestamp:
- 03/28/08 02:45:16 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
haiku/trunk/src/servers/registrar/mime/Database.cpp
r23423 r24618 955 955 if (status == B_OK) 956 956 _SendMonitorUpdate(B_APP_HINT_CHANGED, type, B_META_MIME_DELETED); 957 else if (status == B_ENTRY_NOT_FOUND) 958 status = B_OK; 957 959 958 960 return status; … … 975 977 if (status == B_OK) 976 978 _SendMonitorUpdate(B_ATTR_INFO_CHANGED, type, B_META_MIME_DELETED); 979 else if (status == B_ENTRY_NOT_FOUND) 980 status = B_OK; 977 981 978 982 return status; … … 995 999 if (status == B_OK) 996 1000 _SendMonitorUpdate(B_SHORT_DESCRIPTION_CHANGED, type, B_META_MIME_DELETED); 1001 else if (status == B_ENTRY_NOT_FOUND) 1002 status = B_OK; 997 1003 998 1004 return status; … … 1015 1021 if (status == B_OK) 1016 1022 _SendMonitorUpdate(B_LONG_DESCRIPTION_CHANGED, type, B_META_MIME_DELETED); 1023 else if (status == B_ENTRY_NOT_FOUND) 1024 status = B_OK; 1017 1025 1018 1026 return status; … … 1035 1043 if (status == B_OK) 1036 1044 _SendMonitorUpdate(B_FILE_EXTENSIONS_CHANGED, type, B_META_MIME_DELETED); 1045 else if (status == B_ENTRY_NOT_FOUND) 1046 status = B_OK; 1037 1047 1038 1048 return status; … … 1057 1067 if (status == B_OK) 1058 1068 _SendMonitorUpdate(B_ICON_CHANGED, type, which, B_META_MIME_DELETED); 1069 else if (status == B_ENTRY_NOT_FOUND) 1070 status = B_OK; 1059 1071 1060 1072 return status; … … 1074 1086 Database::DeleteIcon(const char *type) 1075 1087 { 1076 // TODO: ext a notification for vector icon (uses B_LARGE_ICON now)1088 // TODO: extra notification for vector icon (uses B_LARGE_ICON now) 1077 1089 status_t status = delete_attribute(type, kIconAttr); 1078 if (status == B_OK) 1090 if (status == B_OK) { 1079 1091 _SendMonitorUpdate(B_ICON_CHANGED, type, B_LARGE_ICON, 1080 1092 B_META_MIME_DELETED); 1093 } else if (status == B_ENTRY_NOT_FOUND) 1094 status = B_OK; 1081 1095 1082 1096 return status; … … 1112 1126 _SendMonitorUpdate(B_ICON_FOR_TYPE_CHANGED, type, fileType, 1113 1127 which == B_LARGE_ICON, B_META_MIME_DELETED); 1114 } 1128 } else if (status == B_ENTRY_NOT_FOUND) 1129 status = B_OK; 1115 1130 1116 1131 return status; … … 1146 1161 _SendMonitorUpdate(B_ICON_FOR_TYPE_CHANGED, type, fileType, 1147 1162 true, B_META_MIME_DELETED); 1148 } 1163 } else if (status == B_ENTRY_NOT_FOUND) 1164 status = B_OK; 1149 1165 1150 1166 return status; … … 1182 1198 if (status == B_OK) 1183 1199 _SendMonitorUpdate(B_PREFERRED_APP_CHANGED, type, B_META_MIME_DELETED); 1200 else if (status == B_ENTRY_NOT_FOUND) 1201 status = B_OK; 1184 1202 1185 1203 return status; … … 1201 1219 { 1202 1220 status_t status = delete_attribute(type, kSnifferRuleAttr); 1203 if (status == B_OK) 1221 if (status == B_OK) { 1204 1222 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; 1207 1229 1208 1230 return status; … … 1234 1256 // stranded types *may* exist in the database due to previous 1235 1257 // calls to {Set,Delete}SupportedTypes() with fullSync == false. 1258 bool sendUpdate = true; 1236 1259 if (status == B_OK) 1237 1260 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 } 1240 1268 1241 1269 // Send a monitor notification 1242 if (status == B_OK )1270 if (status == B_OK && sendUpdate) 1243 1271 _SendMonitorUpdate(B_SUPPORTED_TYPES_CHANGED, type, B_META_MIME_DELETED); 1244 1272
