No longer let translators overwrite the ioExtension message when they aren't
the chosen one. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20577 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
ce694927b7
commit
580d7b0441
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2006, Haiku, Inc. All Rights Reserved.
|
||||
* Copyright 2002-2007, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
|
@ -659,6 +659,7 @@ BTranslatorRoster::Private::Identify(BPositionIO* source,
|
|||
_RescanChanged();
|
||||
|
||||
TranslatorMap::const_iterator iterator = fTranslators.begin();
|
||||
BMessage baseExtension(*ioExtension);
|
||||
float bestWeight = 0.0f;
|
||||
|
||||
while (iterator != fTranslators.end()) {
|
||||
|
@ -673,10 +674,12 @@ BTranslatorRoster::Private::Identify(BPositionIO* source,
|
|||
const translation_format* format = _CheckHints(formats, formatsCount, hintType,
|
||||
hintMIME);
|
||||
|
||||
BMessage extension(baseExtension);
|
||||
translator_info info;
|
||||
if (translator.Identify(source, format, ioExtension, &info, wantType) == B_OK) {
|
||||
if (translator.Identify(source, format, &extension, &info, wantType) == B_OK) {
|
||||
float weight = info.quality * info.capability;
|
||||
if (weight > bestWeight) {
|
||||
*ioExtension = extension;
|
||||
bestWeight = weight;
|
||||
|
||||
info.translator = iterator->first;
|
||||
|
|
Loading…
Reference in New Issue