|
|
@ -81,6 +81,9 @@ bittorrent::~bittorrent() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void bittorrent::preAllocateAllFiles(bool b) { |
|
|
|
void bittorrent::preAllocateAllFiles(bool b) { |
|
|
|
|
|
|
|
bool change = (preAllocateAll != b); |
|
|
|
|
|
|
|
if(change) { |
|
|
|
|
|
|
|
qDebug("PreAllocateAll changed, reloading all torrents!"); |
|
|
|
preAllocateAll = b; |
|
|
|
preAllocateAll = b; |
|
|
|
// Reload All Torrents
|
|
|
|
// Reload All Torrents
|
|
|
|
std::vector<torrent_handle> handles = s->get_torrents(); |
|
|
|
std::vector<torrent_handle> handles = s->get_torrents(); |
|
|
@ -94,6 +97,7 @@ void bittorrent::preAllocateAllFiles(bool b) { |
|
|
|
pauseAndReloadTorrent(h, b); |
|
|
|
pauseAndReloadTorrent(h, b); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void bittorrent::deleteBigRatios() { |
|
|
|
void bittorrent::deleteBigRatios() { |
|
|
|
if(max_ratio == -1) return; |
|
|
|
if(max_ratio == -1) return; |
|
|
@ -1226,11 +1230,13 @@ void bittorrent::reloadTorrent(const QTorrentHandle &h, bool full_alloc) { |
|
|
|
++timeout; |
|
|
|
++timeout; |
|
|
|
} |
|
|
|
} |
|
|
|
QTorrentHandle new_h; |
|
|
|
QTorrentHandle new_h; |
|
|
|
if(full_alloc) |
|
|
|
if(full_alloc) { |
|
|
|
new_h = s->add_torrent(t, saveDir, resumeData, storage_mode_allocate); |
|
|
|
new_h = s->add_torrent(t, saveDir, resumeData, storage_mode_allocate); |
|
|
|
else |
|
|
|
|
|
|
|
new_h = s->add_torrent(t, saveDir, resumeData, storage_mode_sparse); |
|
|
|
|
|
|
|
qDebug("Using full allocation mode"); |
|
|
|
qDebug("Using full allocation mode"); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
new_h = s->add_torrent(t, saveDir, resumeData, storage_mode_sparse); |
|
|
|
|
|
|
|
qDebug("Using sparse mode"); |
|
|
|
|
|
|
|
} |
|
|
|
// Connections limit per torrent
|
|
|
|
// Connections limit per torrent
|
|
|
|
new_h.set_max_connections(maxConnecsPerTorrent); |
|
|
|
new_h.set_max_connections(maxConnecsPerTorrent); |
|
|
|
// Uploads limit per torrent
|
|
|
|
// Uploads limit per torrent
|
|
|
|