CreateAppMetaMimeThread: Use open_type()
... instead of constructing the MIME type file path manually.
This commit is contained in:
@@ -46,8 +46,6 @@ CreateAppMetaMimeThread::DoMimeUpdate(const entry_ref* ref, bool* _entryIsDir)
|
|||||||
if (ref == NULL)
|
if (ref == NULL)
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
BNode typeNode;
|
|
||||||
|
|
||||||
BFile file;
|
BFile file;
|
||||||
status_t status = file.SetTo(ref, B_READ_ONLY | O_NOTRAVERSE);
|
status_t status = file.SetTo(ref, B_READ_ONLY | O_NOTRAVERSE);
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
@@ -85,14 +83,8 @@ CreateAppMetaMimeThread::DoMimeUpdate(const entry_ref* ref, bool* _entryIsDir)
|
|||||||
if (!mime.IsInstalled())
|
if (!mime.IsInstalled())
|
||||||
mime.Install();
|
mime.Install();
|
||||||
|
|
||||||
BString path = "/";
|
BNode typeNode;
|
||||||
path.Append(signature);
|
status = open_type(signature, &typeNode);
|
||||||
path.ToLower();
|
|
||||||
// Signatures and MIME types are case insensitive, but we want to
|
|
||||||
// preserve the case wherever possible
|
|
||||||
path.Prepend(get_database_directory().c_str());
|
|
||||||
|
|
||||||
status = typeNode.SetTo(path.String());
|
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user