mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-11-10 13:44:17 +00:00
Sort the host list
This commit is contained in:
parent
94d821a4a9
commit
d165bf7498
1 changed files with 6 additions and 1 deletions
|
@ -450,7 +450,12 @@ QVector<NvComputer*> ComputerManager::getComputers()
|
|||
{
|
||||
QReadLocker lock(&m_Lock);
|
||||
|
||||
return QVector<NvComputer*>::fromList(m_KnownHosts.values());
|
||||
// Return a sorted host list
|
||||
auto hosts = QVector<NvComputer*>::fromList(m_KnownHosts.values());
|
||||
std::stable_sort(hosts.begin(), hosts.end(), [](const NvComputer* host1, const NvComputer* host2) {
|
||||
return host1->name.toLower() < host2->name.toLower();
|
||||
});
|
||||
return hosts;
|
||||
}
|
||||
|
||||
class DeferredHostDeletionTask : public QRunnable
|
||||
|
|
Loading…
Reference in a new issue