Add a thin layer around SettingsStorage class

This new layer would be handy for saving GUI widget states as they don't
need the value cached and they store/load rarely.
This commit is contained in:
Chocobo1
2020-12-28 23:32:59 +08:00
parent 60d65d8137
commit 0b0597be0c
12 changed files with 122 additions and 92 deletions

View File

@@ -78,21 +78,21 @@ private:
BitTorrent::TorrentCreatorThread *m_creatorThread;
// settings
CachedSettingValue<QSize> m_storeDialogSize;
CachedSettingValue<int> m_storePieceSize;
CachedSettingValue<bool> m_storePrivateTorrent;
CachedSettingValue<bool> m_storeStartSeeding;
CachedSettingValue<bool> m_storeIgnoreRatio;
SettingValue<QSize> m_storeDialogSize;
SettingValue<int> m_storePieceSize;
SettingValue<bool> m_storePrivateTorrent;
SettingValue<bool> m_storeStartSeeding;
SettingValue<bool> m_storeIgnoreRatio;
#if (LIBTORRENT_VERSION_NUM >= 20000)
CachedSettingValue<int> m_storeTorrentFormat;
SettingValue<int> m_storeTorrentFormat;
#else
CachedSettingValue<bool> m_storeOptimizeAlignment;
CachedSettingValue<int> m_paddedFileSizeLimit;
SettingValue<bool> m_storeOptimizeAlignment;
SettingValue<int> m_paddedFileSizeLimit;
#endif
CachedSettingValue<QString> m_storeLastAddPath;
CachedSettingValue<QString> m_storeTrackerList;
CachedSettingValue<QString> m_storeWebSeedList;
CachedSettingValue<QString> m_storeComments;
CachedSettingValue<QString> m_storeLastSavePath;
CachedSettingValue<QString> m_storeSource;
SettingValue<QString> m_storeLastAddPath;
SettingValue<QString> m_storeTrackerList;
SettingValue<QString> m_storeWebSeedList;
SettingValue<QString> m_storeComments;
SettingValue<QString> m_storeLastSavePath;
SettingValue<QString> m_storeSource;
};