mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
- Found a way not to use FullAllocationMode list in order to save memory in cpu
This commit is contained in:
parent
db6180b737
commit
27e76962d1
5 changed files with 16 additions and 24 deletions
|
@ -186,12 +186,8 @@ void bittorrent::deleteTorrent(QString hash, bool permanent) {
|
|||
trackersErrors.remove(hash);
|
||||
// Remove it from ratio table
|
||||
ratioData.remove(hash);
|
||||
int index = fullAllocationModeList.indexOf(hash);
|
||||
if(index != -1) {
|
||||
fullAllocationModeList.removeAt(index);
|
||||
}
|
||||
// Remove it from pausedTorrents list
|
||||
index = pausedTorrents.indexOf(hash);
|
||||
int index = pausedTorrents.indexOf(hash);
|
||||
if(index != -1) {
|
||||
pausedTorrents.removeAt(index);
|
||||
}
|
||||
|
@ -424,10 +420,6 @@ void bittorrent::addTorrent(QString path, bool fromScanDir, QString from_url) {
|
|||
// Adding files to bittorrent session
|
||||
if(has_filtered_files(hash)) {
|
||||
h = s->add_torrent(t, fs::path(savePath.toUtf8().data()), resume_data, false, true);
|
||||
int index = fullAllocationModeList.indexOf(hash);
|
||||
if(index == -1) {
|
||||
fullAllocationModeList << hash;
|
||||
}
|
||||
qDebug(" -> Full allocation mode");
|
||||
}else{
|
||||
h = s->add_torrent(t, fs::path(savePath.toUtf8().data()), resume_data, true, true);
|
||||
|
@ -1109,10 +1101,6 @@ void bittorrent::reloadTorrent(const QTorrentHandle &h) {
|
|||
QString fileName = h.name();
|
||||
QString hash = h.hash();
|
||||
torrent_info t = h.get_torrent_info();
|
||||
int index = fullAllocationModeList.indexOf(hash);
|
||||
if(index == -1) {
|
||||
fullAllocationModeList << hash;
|
||||
}
|
||||
qDebug("Reloading torrent: %s", fileName.toUtf8().data());
|
||||
entry resumeData;
|
||||
// Checking if torrentBackup Dir exists
|
||||
|
@ -1169,12 +1157,6 @@ session_status bittorrent::getSessionStatus() const{
|
|||
return s->status();
|
||||
}
|
||||
|
||||
bool bittorrent::inFullAllocationMode(QString hash) const{
|
||||
if(fullAllocationModeList.indexOf(hash) != -1)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
QString bittorrent::getSavePath(QString hash) {
|
||||
QFile savepath_file(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".savepath");
|
||||
QByteArray line;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue