Since we're now caching this, we can sort it once, rather than

lots of times.
This commit is contained in:
Richard Heck 2016-10-19 17:28:51 -04:00
parent 0b67e103e9
commit 7fd1a14c1b
3 changed files with 3 additions and 3 deletions

View File

@ -2426,6 +2426,7 @@ vector<Format const *> const & BufferParams::exportableFormats(bool only_viewabl
theConverters().getReachable(*it, only_viewable, false, excludes); theConverters().getReachable(*it, only_viewable, false, excludes);
result.insert(result.end(), r.begin(), r.end()); result.insert(result.end(), r.begin(), r.end());
} }
sort(result.begin(), result.end(), Format::formatSorter);
cached = result; cached = result;
valid = true; valid = true;
return cached; return cached;

View File

@ -2561,8 +2561,8 @@ void GuiDocument::updateDefaultFormat()
outputModule->defaultFormatCO->clear(); outputModule->defaultFormatCO->clear();
outputModule->defaultFormatCO->addItem(qt_("Default"), outputModule->defaultFormatCO->addItem(qt_("Default"),
QVariant(QString("default"))); QVariant(QString("default")));
vector<Format const *> formats = param_copy.exportableFormats(true); vector<Format const *> const & formats =
sort(formats.begin(), formats.end(), Format::formatSorter); param_copy.exportableFormats(true);
for (Format const * f : formats) for (Format const * f : formats)
outputModule->defaultFormatCO->addItem outputModule->defaultFormatCO->addItem
(toqstr(translateIfPossible(f->prettyname())), (toqstr(translateIfPossible(f->prettyname())),

View File

@ -1051,7 +1051,6 @@ void MenuDefinition::expandFormats(MenuItem::Kind const kind, Buffer const * buf
LATTEST(false); LATTEST(false);
return; return;
} }
sort(formats.begin(), formats.end(), Format::formatSorter);
bool const view_update = (kind == MenuItem::ViewFormats bool const view_update = (kind == MenuItem::ViewFormats
|| kind == MenuItem::UpdateFormats); || kind == MenuItem::UpdateFormats);