Actually sort the translator menu used in ShowImage.

There were two problems with the last commit:

* the list needed to be outside of the top-level loop.
* BList was just broken for sorting translation_format pointers.

I fixed this by moving the loop outside and converting the translation_formats
to translator_info, which has the translator_id, since that is needed to create
the menu item, and would otherwise be unavailable outside the loop.

I tried to get this working with BList, but the sorting was completely broken,
and converting to BObjectList made the code much, much better and worked great.
Screw BList and casting, hurray templated BObjectList.

Really fixes #6782.
This commit is contained in:
Ryan Leavengood
2012-08-07 00:41:41 -04:00
parent 0671704e3a
commit e77304562d
2 changed files with 47 additions and 25 deletions
+4 -2
View File
@@ -77,8 +77,10 @@ public:
BTranslatorRoster* roster = NULL);
private:
static int CompareTranslationFormatByName(const void* format1,
const void* format2);
static translator_info* _BuildTranslatorInfo(const translator_id id,
const translation_format* format);
static int _CompareTranslatorInfoByName(const translator_info* info1,
const translator_info* info2);
static color_space sBitmapSpace;
};