Save hosts on a separate thread

QSettings on macOS Ventura performs horribly when saving a lot of values
(like several hosts or a host with a large app list). This change considerably
improves UI performance by moving the long operation off the main thread.
This commit is contained in:
Cameron Gutman
2022-10-25 00:00:36 -05:00
parent cb04925c6e
commit cebd3bf751
2 changed files with 39 additions and 12 deletions
+2
View File
@@ -167,6 +167,7 @@ class ComputerManager : public QObject
friend class DeferredHostDeletionTask;
friend class PendingAddTask;
friend class PendingPairingTask;
friend class DeferredHostSaveTask;
public:
explicit ComputerManager(QObject *parent = nullptr);
@@ -228,4 +229,5 @@ private:
QMdnsEngine::Cache m_MdnsCache;
QVector<MdnsPendingComputer*> m_PendingResolution;
CompatFetcher m_CompatFetcher;
QAtomicInteger<bool> m_HostsListDirty;
};