From 7f20062d97ca0837a0b33ed34cf6e96c66965bc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Mon, 29 May 2006 23:04:25 +0000 Subject: [PATCH] BAppFileInfo::SetSupportedTypes now works even when there is no signature A consequence is the FileType tracker addon (which hasn't a signature) has now its attributes set on Linux builds git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17642 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/build/libbe/storage/AppFileInfo.cpp | 5 ++++- src/kits/storage/AppFileInfo.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/build/libbe/storage/AppFileInfo.cpp b/src/build/libbe/storage/AppFileInfo.cpp index 67c9416535..85ac66e82d 100644 --- a/src/build/libbe/storage/AppFileInfo.cpp +++ b/src/build/libbe/storage/AppFileInfo.cpp @@ -445,7 +445,8 @@ BAppFileInfo::SetSupportedTypes(const BMessage *types, bool syncAll) BMimeType mimeType; if (error == B_OK) error = GetMetaMime(&mimeType); - if (error == B_OK) { + if (error == B_OK || error == B_ENTRY_NOT_FOUND) { + error = B_OK; if (types) { // check param -- supported types must be valid const char *type; @@ -1031,6 +1032,8 @@ BAppFileInfo::GetMetaMime(BMimeType *meta) const status_t error = GetSignature(signature); if (error == B_OK) error = meta->SetTo(signature); + else if (error == B_BAD_VALUE) + error = B_ENTRY_NOT_FOUND; if (error == B_OK && !meta->IsValid()) error = B_BAD_VALUE; return error; diff --git a/src/kits/storage/AppFileInfo.cpp b/src/kits/storage/AppFileInfo.cpp index 6964881e0d..e48ebe497a 100644 --- a/src/kits/storage/AppFileInfo.cpp +++ b/src/kits/storage/AppFileInfo.cpp @@ -458,7 +458,8 @@ BAppFileInfo::SetSupportedTypes(const BMessage *types, bool syncAll) BMimeType mimeType; if (error == B_OK) error = GetMetaMime(&mimeType); - if (error == B_OK) { + if (error == B_OK || error == B_ENTRY_NOT_FOUND) { + error = B_OK; if (types) { // check param -- supported types must be valid const char *type; @@ -1044,6 +1045,8 @@ BAppFileInfo::GetMetaMime(BMimeType *meta) const status_t error = GetSignature(signature); if (error == B_OK) error = meta->SetTo(signature); + else if (error == B_BAD_VALUE) + error = B_ENTRY_NOT_FOUND; if (error == B_OK && !meta->IsValid()) error = B_BAD_VALUE; return error;