|
|
@ -125,6 +125,11 @@ void bittorrent::pauseTorrent(const QString& hash){ |
|
|
|
QFile paused_file(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.open(QIODevice::WriteOnly | QIODevice::Text); |
|
|
|
paused_file.close(); |
|
|
|
paused_file.close(); |
|
|
|
|
|
|
|
int index = torrentsToPauseAfterChecking.indexOf(hash); |
|
|
|
|
|
|
|
if(index != -1) { |
|
|
|
|
|
|
|
torrentsToPauseAfterChecking.removeAt(index); |
|
|
|
|
|
|
|
qDebug("A torrent was paused just after checking, good"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -240,10 +245,10 @@ void bittorrent::addTorrent(const QString& path, bool fromScanDir, const QString |
|
|
|
// Copy it to torrentBackup directory
|
|
|
|
// Copy it to torrentBackup directory
|
|
|
|
QFile::copy(file, newFile); |
|
|
|
QFile::copy(file, newFile); |
|
|
|
} |
|
|
|
} |
|
|
|
//qDebug("Copied to torrent backup directory");
|
|
|
|
|
|
|
|
// Pause torrent if it was paused last time
|
|
|
|
// Pause torrent if it was paused last time
|
|
|
|
if(QFile::exists(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".paused")){ |
|
|
|
if(QFile::exists(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".paused")){ |
|
|
|
h.pause(); |
|
|
|
torrentsToPauseAfterChecking << hash; |
|
|
|
|
|
|
|
qDebug("Adding a torrent to the torrentsToPauseAfterChecking list"); |
|
|
|
} |
|
|
|
} |
|
|
|
// Incremental download
|
|
|
|
// Incremental download
|
|
|
|
if(QFile::exists(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".incremental")){ |
|
|
|
if(QFile::exists(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".incremental")){ |
|
|
@ -296,6 +301,10 @@ void bittorrent::addTorrent(const QString& path, bool fromScanDir, const QString |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QStringList bittorrent::getTorrentsToPauseAfterChecking() const{ |
|
|
|
|
|
|
|
return torrentsToPauseAfterChecking; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Set the maximum number of opened connections
|
|
|
|
// Set the maximum number of opened connections
|
|
|
|
void bittorrent::setMaxConnections(int maxConnec){ |
|
|
|
void bittorrent::setMaxConnections(int maxConnec){ |
|
|
|
s->set_max_connections(maxConnec); |
|
|
|
s->set_max_connections(maxConnec); |
|
|
|