mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 20:19:57 +00:00
Sort EnumDelegate values by name
This commit is contained in:
parent
aa5ddd6b28
commit
e9cc697b60
1 changed files with 12 additions and 1 deletions
|
@ -175,5 +175,16 @@ CSVWorld::CommandDelegate *CSVWorld::EnumDelegateFactory::makeDelegate (
|
||||||
|
|
||||||
void CSVWorld::EnumDelegateFactory::add (int value, const QString& name)
|
void CSVWorld::EnumDelegateFactory::add (int value, const QString& name)
|
||||||
{
|
{
|
||||||
mValues.push_back (std::make_pair (value, name));
|
auto pair = std::make_pair (value, name);
|
||||||
|
|
||||||
|
for (auto it=mValues.begin(); it!=mValues.end(); ++it)
|
||||||
|
{
|
||||||
|
if (it->second > name)
|
||||||
|
{
|
||||||
|
mValues.insert(it, pair);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mValues.push_back(std::make_pair (value, name));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue