mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
- Better handing of .finished files (bittorrent class level instead of GUI level)
This commit is contained in:
parent
124fa3c8ed
commit
1bfc181cb2
3 changed files with 9 additions and 6 deletions
2
TODO
2
TODO
|
@ -75,7 +75,7 @@ LANGUAGES UPDATED:
|
||||||
- Korean *BETA5*
|
- Korean *BETA5*
|
||||||
|
|
||||||
beta5->beta6 changelog:
|
beta5->beta6 changelog:
|
||||||
- FEATURE: Split GUI class from download tab
|
- FEATURE: Split download tab from GUI class and cleaned up code
|
||||||
- BUGFIX: Made torrent deletion from hard-drive safer
|
- BUGFIX: Made torrent deletion from hard-drive safer
|
||||||
- BUGFIX: Fixed a bug when switching from finished to downloading list
|
- BUGFIX: Fixed a bug when switching from finished to downloading list
|
||||||
- BUGFIX: Showing checking progress for paused torrents too
|
- BUGFIX: Showing checking progress for paused torrents too
|
||||||
|
|
|
@ -107,10 +107,6 @@ void FinishedTorrents::addTorrent(QString hash){
|
||||||
finishedListModel->setData(finishedListModel->index(row, F_NAME), QVariant(QIcon(":/Icons/skin/seeding.png")), Qt::DecorationRole);
|
finishedListModel->setData(finishedListModel->index(row, F_NAME), QVariant(QIcon(":/Icons/skin/seeding.png")), Qt::DecorationRole);
|
||||||
setRowColor(row, "orange");
|
setRowColor(row, "orange");
|
||||||
}
|
}
|
||||||
// Create .finished file
|
|
||||||
QFile finished_file(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".finished");
|
|
||||||
finished_file.open(QIODevice::WriteOnly | QIODevice::Text);
|
|
||||||
finished_file.close();
|
|
||||||
// Update the number of finished torrents
|
// Update the number of finished torrents
|
||||||
++nbFinished;
|
++nbFinished;
|
||||||
emit finishedTorrentsNumberChanged(nbFinished);
|
emit finishedTorrentsNumberChanged(nbFinished);
|
||||||
|
@ -267,7 +263,6 @@ void FinishedTorrents::deleteTorrent(QString hash){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
finishedListModel->removeRow(row);
|
finishedListModel->removeRow(row);
|
||||||
QFile::remove(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".finished");
|
|
||||||
--nbFinished;
|
--nbFinished;
|
||||||
emit finishedTorrentsNumberChanged(nbFinished);
|
emit finishedTorrentsNumberChanged(nbFinished);
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,6 +232,9 @@ bool bittorrent::isFinished(QString hash) const {
|
||||||
|
|
||||||
// Remove the given hash from the list of finished torrents
|
// Remove the given hash from the list of finished torrents
|
||||||
void bittorrent::setUnfinishedTorrent(QString hash) {
|
void bittorrent::setUnfinishedTorrent(QString hash) {
|
||||||
|
if(QFile::exists(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".finished")){
|
||||||
|
QFile::remove(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".finished");
|
||||||
|
}
|
||||||
int index = finishedTorrents.indexOf(hash);
|
int index = finishedTorrents.indexOf(hash);
|
||||||
if(index != -1) {
|
if(index != -1) {
|
||||||
finishedTorrents.removeAt(index);
|
finishedTorrents.removeAt(index);
|
||||||
|
@ -243,6 +246,11 @@ void bittorrent::setUnfinishedTorrent(QString hash) {
|
||||||
|
|
||||||
// Add the given hash to the list of finished torrents
|
// Add the given hash to the list of finished torrents
|
||||||
void bittorrent::setFinishedTorrent(QString hash) {
|
void bittorrent::setFinishedTorrent(QString hash) {
|
||||||
|
if(!QFile::exists(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".finished")) {
|
||||||
|
QFile finished_file(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".finished");
|
||||||
|
finished_file.open(QIODevice::WriteOnly | QIODevice::Text);
|
||||||
|
finished_file.close();
|
||||||
|
}
|
||||||
if(!finishedTorrents.contains(hash)) {
|
if(!finishedTorrents.contains(hash)) {
|
||||||
finishedTorrents << hash;
|
finishedTorrents << hash;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue