mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-07 13:41:26 -07: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:
parent
0ea35c54a3
commit
e06b7f8f4d
7 changed files with 50 additions and 5 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue