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:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user