* No need to create a BPath object for the leaf name in CreateAppMetaMimeThread.
* The preferred application is now written with the case preserved. This fixes bug #635. * Minor cleanup. * BApplication::_InitData() now also corrects a pre-registered application signature if the case is different. Note, however, that the application watching mechanism doesn't seem to work correctly with this, maybe sending out those should be postponed until the registration is completed? git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17836 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -330,8 +330,8 @@ BApplication::_InitData(const char *signature, bool initGUI, status_t *_error)
|
|||||||
fMsgPort = appInfo.port;
|
fMsgPort = appInfo.port;
|
||||||
} else
|
} else
|
||||||
appInfo.port = fMsgPort;
|
appInfo.port = fMsgPort;
|
||||||
// check the signature and correct it, if necessary
|
// check the signature and correct it, if necessary, also the case
|
||||||
if (strcasecmp(appInfo.signature, fAppName))
|
if (strcmp(appInfo.signature, fAppName))
|
||||||
BRoster::Private().SetSignature(team, fAppName);
|
BRoster::Private().SetSignature(team, fAppName);
|
||||||
// complete the registration
|
// complete the registration
|
||||||
fInitError = BRoster::Private().CompleteRegistration(team, thread,
|
fInitError = BRoster::Private().CompleteRegistration(team, thread,
|
||||||
|
|||||||
@@ -54,11 +54,6 @@ CreateAppMetaMimeThread::DoMimeUpdate(const entry_ref* ref, bool* _entryIsDir)
|
|||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
BPath path;
|
|
||||||
status = path.SetTo(ref);
|
|
||||||
if (status < B_OK)
|
|
||||||
return status;
|
|
||||||
|
|
||||||
// Read the app sig (which consequently keeps us from updating
|
// Read the app sig (which consequently keeps us from updating
|
||||||
// non-applications, since we get an error if the file has no
|
// non-applications, since we get an error if the file has no
|
||||||
// app sig)
|
// app sig)
|
||||||
@@ -77,29 +72,29 @@ CreateAppMetaMimeThread::DoMimeUpdate(const entry_ref* ref, bool* _entryIsDir)
|
|||||||
if (!mime.IsInstalled())
|
if (!mime.IsInstalled())
|
||||||
mime.Install();
|
mime.Install();
|
||||||
|
|
||||||
signature.ToLower();
|
BString path = "/";
|
||||||
// Signatures and MIME types are case insensitive
|
path.Append(signature);
|
||||||
|
path.ToLower();
|
||||||
|
// Signatures and MIME types are case insensitive, but we want to
|
||||||
|
// preserve the case wherever possible
|
||||||
|
path.Prepend(kDatabaseDir.c_str());
|
||||||
|
|
||||||
char metaMimePath[B_PATH_NAME_LENGTH];
|
status = typeNode.SetTo(path.String());
|
||||||
sprintf(metaMimePath, "%s/%s", kDatabaseDir.c_str(), signature.String());
|
|
||||||
|
|
||||||
status = typeNode.SetTo(metaMimePath);
|
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
// Preferred App
|
// Preferred App
|
||||||
attr_info info;
|
attr_info info;
|
||||||
if (status == B_OK && (fForce || typeNode.GetAttrInfo(kPreferredAppAttr, &info) != B_OK)) {
|
if (status == B_OK && (fForce || typeNode.GetAttrInfo(kPreferredAppAttr, &info) != B_OK))
|
||||||
status = mime.SetPreferredApp(signature.String());
|
status = mime.SetPreferredApp(signature.String());
|
||||||
}
|
|
||||||
// Short Description (name of the application)
|
// Short Description (name of the application)
|
||||||
if (status == B_OK && (fForce || typeNode.GetAttrInfo(kShortDescriptionAttr, &info) != B_OK)) {
|
if (status == B_OK && (fForce || typeNode.GetAttrInfo(kShortDescriptionAttr, &info) != B_OK))
|
||||||
status = mime.SetShortDescription(path.Leaf());
|
status = mime.SetShortDescription(ref->name);
|
||||||
}
|
|
||||||
// App Hint
|
// App Hint
|
||||||
if (status == B_OK && (fForce || typeNode.GetAttrInfo(kAppHintAttr, &info) != B_OK)) {
|
if (status == B_OK && (fForce || typeNode.GetAttrInfo(kAppHintAttr, &info) != B_OK))
|
||||||
status = mime.SetAppHint(ref);
|
status = mime.SetAppHint(ref);
|
||||||
}
|
|
||||||
|
|
||||||
// Mini Icon
|
// Mini Icon
|
||||||
BBitmap miniIcon(BRect(0, 0, 15, 15), B_BITMAP_NO_SERVER_LINK, B_CMAP8);
|
BBitmap miniIcon(BRect(0, 0, 15, 15), B_BITMAP_NO_SERVER_LINK, B_CMAP8);
|
||||||
|
|||||||
Reference in New Issue
Block a user