Removed old debugging output.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10696 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
2ce1b3ecc2
commit
458a27c988
@ -427,7 +427,6 @@ BAppFileInfo::GetSupportedTypes(BMessage *types) const
|
|||||||
- \c B_NO_INIT: The object is not properly initialized.
|
- \c B_NO_INIT: The object is not properly initialized.
|
||||||
- other error codes
|
- other error codes
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
|
||||||
status_t
|
status_t
|
||||||
BAppFileInfo::SetSupportedTypes(const BMessage *types, bool syncAll)
|
BAppFileInfo::SetSupportedTypes(const BMessage *types, bool syncAll)
|
||||||
{
|
{
|
||||||
@ -435,23 +434,19 @@ BAppFileInfo::SetSupportedTypes(const BMessage *types, bool syncAll)
|
|||||||
status_t error = B_OK;
|
status_t error = B_OK;
|
||||||
if (error == B_OK && InitCheck() != B_OK)
|
if (error == B_OK && InitCheck() != B_OK)
|
||||||
error = B_NO_INIT;
|
error = B_NO_INIT;
|
||||||
printf("check\n");
|
|
||||||
BMimeType mimeType;
|
BMimeType mimeType;
|
||||||
if (error == B_OK)
|
if (error == B_OK)
|
||||||
error = GetMetaMime(&mimeType);
|
error = GetMetaMime(&mimeType);
|
||||||
printf("check\n");
|
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
if (types) {
|
if (types) {
|
||||||
// check param -- supported types must be valid
|
// check param -- supported types must be valid
|
||||||
const char *type;
|
const char *type;
|
||||||
printf("check1\n");
|
|
||||||
for (int32 i = 0;
|
for (int32 i = 0;
|
||||||
error == B_OK && types->FindString("types", i, &type) == B_OK;
|
error == B_OK && types->FindString("types", i, &type) == B_OK;
|
||||||
i++) {
|
i++) {
|
||||||
if (!BMimeType::IsValid(type))
|
if (!BMimeType::IsValid(type))
|
||||||
error = B_BAD_VALUE;
|
error = B_BAD_VALUE;
|
||||||
}
|
}
|
||||||
printf("check1\n");
|
|
||||||
// get flattened size
|
// get flattened size
|
||||||
ssize_t size = 0;
|
ssize_t size = 0;
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
@ -459,7 +454,6 @@ printf("check1\n");
|
|||||||
if (size < 0)
|
if (size < 0)
|
||||||
error = size;
|
error = size;
|
||||||
}
|
}
|
||||||
printf("check1\n");
|
|
||||||
// allocate a buffer for the flattened data
|
// allocate a buffer for the flattened data
|
||||||
char *buffer = NULL;
|
char *buffer = NULL;
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
@ -467,28 +461,23 @@ printf("check1\n");
|
|||||||
if (!buffer)
|
if (!buffer)
|
||||||
error = B_NO_MEMORY;
|
error = B_NO_MEMORY;
|
||||||
}
|
}
|
||||||
printf("check1\n");
|
|
||||||
// flatten the message
|
// flatten the message
|
||||||
if (error == B_OK)
|
if (error == B_OK)
|
||||||
error = types->Flatten(buffer, size);
|
error = types->Flatten(buffer, size);
|
||||||
printf("check1\n");
|
|
||||||
// write the data
|
// write the data
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
error = _WriteData(kSupportedTypesAttribute,
|
error = _WriteData(kSupportedTypesAttribute,
|
||||||
kSupportedTypesResourceID, B_MESSAGE_TYPE,
|
kSupportedTypesResourceID, B_MESSAGE_TYPE,
|
||||||
buffer, size);
|
buffer, size);
|
||||||
}
|
}
|
||||||
printf("check1\n");
|
|
||||||
// clean up
|
// clean up
|
||||||
if (buffer)
|
if (buffer)
|
||||||
delete[] buffer;
|
delete[] buffer;
|
||||||
} else
|
} else
|
||||||
error = _RemoveData(kSupportedTypesAttribute, B_MESSAGE_TYPE);
|
error = _RemoveData(kSupportedTypesAttribute, B_MESSAGE_TYPE);
|
||||||
printf("check\n");
|
|
||||||
// update the MIME database, if the app signature is installed
|
// update the MIME database, if the app signature is installed
|
||||||
if (error == B_OK && mimeType.IsInstalled())
|
if (error == B_OK && mimeType.IsInstalled())
|
||||||
error = mimeType.SetSupportedTypes(types, syncAll);
|
error = mimeType.SetSupportedTypes(types, syncAll);
|
||||||
printf("check\n");
|
|
||||||
}
|
}
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user