mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-30 19:40:18 -07:00
- Remember paused torrents on startup
This commit is contained in:
parent
6369401150
commit
71e3061c18
4 changed files with 20 additions and 8 deletions
|
@ -315,16 +315,26 @@ void QTorrentHandle::set_upload_limit(int limit) {
|
|||
h.set_upload_limit(limit);
|
||||
}
|
||||
|
||||
void QTorrentHandle::pause() {
|
||||
void QTorrentHandle::pause(bool create_file) {
|
||||
Q_ASSERT(h.is_valid());
|
||||
h.auto_managed(false);
|
||||
h.pause();
|
||||
// Create .paused file if necessary
|
||||
if(create_file && !QFile::exists(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash()+".paused")) {
|
||||
QFile paused_file(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash()+".paused");
|
||||
paused_file.open(QIODevice::WriteOnly | QIODevice::Text);
|
||||
paused_file.close();
|
||||
}
|
||||
}
|
||||
|
||||
void QTorrentHandle::resume() {
|
||||
Q_ASSERT(h.is_valid());
|
||||
h.auto_managed(true);
|
||||
h.resume();
|
||||
// Delete .paused file if necessary
|
||||
if(QFile::exists(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash()+".paused")) {
|
||||
QFile::remove(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash()+".paused");
|
||||
}
|
||||
}
|
||||
|
||||
void QTorrentHandle::remove_url_seed(QString seed) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue