Sort the app list in alphabetical order
This commit is contained in:
parent
79435b60ff
commit
bd986bfb21
2 changed files with 14 additions and 0 deletions
|
|
@ -42,6 +42,7 @@ NvComputer::NvComputer(QSettings& settings)
|
|||
this->appList.append(app);
|
||||
}
|
||||
settings.endArray();
|
||||
sortAppList();
|
||||
|
||||
this->activeAddress = nullptr;
|
||||
this->currentGameId = 0;
|
||||
|
|
@ -79,6 +80,13 @@ NvComputer::serialize(QSettings& settings)
|
|||
}
|
||||
}
|
||||
|
||||
void NvComputer::sortAppList()
|
||||
{
|
||||
std::stable_sort(appList.begin(), appList.end(), [](const NvApp& app1, const NvApp& app2) {
|
||||
return app1.name.toLower() < app2.name.toLower();
|
||||
});
|
||||
}
|
||||
|
||||
NvComputer::NvComputer(QString address, QString serverInfo)
|
||||
{
|
||||
this->name = NvHTTP::getXmlString(serverInfo, "hostname");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue