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);
result.insert(result.end(), r.begin(), r.end());
}
sort(result.begin(), result.end(), Format::formatSorter);
cached = result;
valid = true;
return cached;

View File

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

View File

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