mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-04-04 14:56:19 +00:00
Only reserialize hosts if a serializable attribute changed
This commit is contained in:
@@ -94,7 +94,7 @@ void NvComputer::serialize(QSettings& settings, bool serializeApps) const
|
||||
settings.setValue(SER_NVIDIASOFTWARE, isNvidiaServerSoftware);
|
||||
|
||||
// Avoid deleting an existing applist if we couldn't get one
|
||||
if (!appList.isEmpty()) {
|
||||
if (!appList.isEmpty() && serializeApps) {
|
||||
settings.remove(SER_APPLIST);
|
||||
settings.beginWriteArray(SER_APPLIST);
|
||||
for (int i = 0; i < appList.count(); i++) {
|
||||
@@ -105,6 +105,21 @@ void NvComputer::serialize(QSettings& settings, bool serializeApps) const
|
||||
}
|
||||
}
|
||||
|
||||
bool NvComputer::isEqualSerialized(const NvComputer &that) const
|
||||
{
|
||||
return this->name == that.name &&
|
||||
this->hasCustomName == that.hasCustomName &&
|
||||
this->uuid == that.uuid &&
|
||||
this->macAddress == that.macAddress &&
|
||||
this->localAddress == that.localAddress &&
|
||||
this->remoteAddress == that.remoteAddress &&
|
||||
this->ipv6Address == that.ipv6Address &&
|
||||
this->manualAddress == that.manualAddress &&
|
||||
this->serverCert == that.serverCert &&
|
||||
this->isNvidiaServerSoftware == that.isNvidiaServerSoftware &&
|
||||
this->appList == that.appList;
|
||||
}
|
||||
|
||||
void NvComputer::sortAppList()
|
||||
{
|
||||
std::stable_sort(appList.begin(), appList.end(), [](const NvApp& app1, const NvApp& app2) {
|
||||
|
||||
Reference in New Issue
Block a user