mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-02 15:55:39 +00:00
Sort the app list in alphabetical order
This commit is contained in:
parent
79435b60ff
commit
bd986bfb21
@ -42,6 +42,7 @@ NvComputer::NvComputer(QSettings& settings)
|
|||||||
this->appList.append(app);
|
this->appList.append(app);
|
||||||
}
|
}
|
||||||
settings.endArray();
|
settings.endArray();
|
||||||
|
sortAppList();
|
||||||
|
|
||||||
this->activeAddress = nullptr;
|
this->activeAddress = nullptr;
|
||||||
this->currentGameId = 0;
|
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)
|
NvComputer::NvComputer(QString address, QString serverInfo)
|
||||||
{
|
{
|
||||||
this->name = NvHTTP::getXmlString(serverInfo, "hostname");
|
this->name = NvHTTP::getXmlString(serverInfo, "hostname");
|
||||||
|
@ -13,6 +13,11 @@
|
|||||||
|
|
||||||
class NvComputer
|
class NvComputer
|
||||||
{
|
{
|
||||||
|
friend class PcMonitorThread;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void sortAppList();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit NvComputer(QString address, QString serverInfo);
|
explicit NvComputer(QString address, QString serverInfo);
|
||||||
|
|
||||||
@ -126,6 +131,7 @@ private:
|
|||||||
QWriteLocker lock(&m_Computer->lock);
|
QWriteLocker lock(&m_Computer->lock);
|
||||||
if (m_Computer->appList != appList) {
|
if (m_Computer->appList != appList) {
|
||||||
m_Computer->appList = appList;
|
m_Computer->appList = appList;
|
||||||
|
m_Computer->sortAppList();
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user