Changed GetAllTranslators to generate the list of Translators in the same order they were read in (instead of the reverse). This should cause the list of Translators in the DataTranslations pref and in Save As submenus to be in the same order as when using Be's version of the Translation Kit. Also changed the Translation Kit version string calculations to match those for the Translators. So, for R5, the version string becomes "Translation Kit v5.0.0" instead of "Translation Kit v12.8.0", which is what Be's version does, but doesn't appear right because it doesn't match the calculations the Translators use.. Note that the version number is still the same, only how it appears in the string is different.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6007 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
b6aabb5c95
commit
61ac0c3523
@ -329,9 +329,9 @@ BTranslatorRoster::Version(int32 *outCurVersion, int32 *outMinVersion,
|
||||
static char vDate[] = __DATE__;
|
||||
if (!vString[0]) {
|
||||
sprintf(vString, "Translation Kit v%d.%d.%d %s\n",
|
||||
B_TRANSLATION_CURRENT_VERSION/100,
|
||||
(B_TRANSLATION_CURRENT_VERSION/10)%10,
|
||||
B_TRANSLATION_CURRENT_VERSION%10,
|
||||
static_cast<int>(B_TRANSLATION_CURRENT_VERSION >> 8),
|
||||
static_cast<int>((B_TRANSLATION_CURRENT_VERSION >> 4) & 0xf),
|
||||
static_cast<int>(B_TRANSLATION_CURRENT_VERSION & 0xf),
|
||||
vDate);
|
||||
}
|
||||
*outCurVersion = B_TRANSLATION_CURRENT_VERSION;
|
||||
@ -807,14 +807,16 @@ BTranslatorRoster::GetAllTranslators(
|
||||
*outCount = 0;
|
||||
|
||||
if (fSem > 0 && acquire_sem(fSem) == B_OK) {
|
||||
// count handlers
|
||||
// count translators
|
||||
translator_node *pTranNode = NULL;
|
||||
for (pTranNode = fpTranslators; pTranNode; pTranNode = pTranNode->next)
|
||||
(*outCount)++;
|
||||
// because translators are stored in the list backwards,
|
||||
// populate the outList backwards to produce the original order
|
||||
*outList = new translator_id[*outCount];
|
||||
*outCount = 0;
|
||||
int32 i = (*outCount) - 1;
|
||||
for (pTranNode = fpTranslators; pTranNode; pTranNode = pTranNode->next)
|
||||
(*outList)[(*outCount)++] = pTranNode->id;
|
||||
(*outList)[i--] = pTranNode->id;
|
||||
|
||||
result = B_NO_ERROR;
|
||||
release_sem(fSem);
|
||||
|
Loading…
Reference in New Issue
Block a user