mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 14:38:04 -06:00
Enable customizing the save statistics time interval
This change extends the Advanced section of the Preferences menu with a new field, allowing changing the time statistics save interval. A zero value will prevent recurrent saving. This aims to provide the feature requested in issue #21285. PR #21291.
This commit is contained in:
@@ -364,6 +364,8 @@ void AppController::preferencesAction()
|
||||
data[u"current_interface_address"_s] = session->networkInterfaceAddress();
|
||||
// Save resume data interval
|
||||
data[u"save_resume_data_interval"_s] = session->saveResumeDataInterval();
|
||||
// Save statistics interval
|
||||
data[u"save_statistics_interval"_s] = static_cast<int>(session->saveStatisticsInterval().count());
|
||||
// .torrent file size limit
|
||||
data[u"torrent_file_size_limit"_s] = pref->getTorrentFileSizeLimit();
|
||||
// Recheck completed torrents
|
||||
@@ -969,6 +971,9 @@ void AppController::setPreferencesAction()
|
||||
// Save resume data interval
|
||||
if (hasKey(u"save_resume_data_interval"_s))
|
||||
session->setSaveResumeDataInterval(it.value().toInt());
|
||||
// Save statistics interval
|
||||
if (hasKey(u"save_statistics_interval"_s))
|
||||
session->setSaveStatisticsInterval(std::chrono::minutes(it.value().toInt()));
|
||||
// .torrent file size limit
|
||||
if (hasKey(u"torrent_file_size_limit"_s))
|
||||
pref->setTorrentFileSizeLimit(it.value().toLongLong());
|
||||
|
||||
Reference in New Issue
Block a user