mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 23:47:23 -06:00
- BUGFIX: Fix encoding problem in file renaming
- BUGFIX: Delete uneeded files on torrent "soft" deletion
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.4.7
|
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.4.7
|
||||||
- BUGFIX: Display the priority column when the queueing system gets enabled
|
- BUGFIX: Display the priority column when the queueing system gets enabled
|
||||||
|
- BUGFIX: Fix encoding problem in file renaming
|
||||||
|
- BUGFIX: Delete uneeded files on torrent "soft" deletion
|
||||||
|
|
||||||
* Sun Oct 17 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.6
|
* Sun Oct 17 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.6
|
||||||
- BUGFIX: Fix "torrent seeding after creation" feature
|
- BUGFIX: Fix "torrent seeding after creation" feature
|
||||||
|
|||||||
@@ -756,7 +756,13 @@ void Bittorrent::deleteTorrent(QString hash, bool delete_local_files) {
|
|||||||
savePathsToRemove[hash] = save_dir.absolutePath();
|
savePathsToRemove[hash] = save_dir.absolutePath();
|
||||||
s->remove_torrent(h.get_torrent_handle(), session::delete_files);
|
s->remove_torrent(h.get_torrent_handle(), session::delete_files);
|
||||||
} else {
|
} else {
|
||||||
|
QStringList uneeded_files = h.uneeded_files_path();
|
||||||
s->remove_torrent(h.get_torrent_handle());
|
s->remove_torrent(h.get_torrent_handle());
|
||||||
|
// Remove unneeded files
|
||||||
|
foreach(const QString &uneeded_file, uneeded_files) {
|
||||||
|
qDebug("Removing uneeded file: %s", qPrintable(uneeded_file));
|
||||||
|
misc::safeRemove(uneeded_file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Remove it from torrent backup directory
|
// Remove it from torrent backup directory
|
||||||
QDir torrentBackup(misc::BTBackupLocation());
|
QDir torrentBackup(misc::BTBackupLocation());
|
||||||
|
|||||||
@@ -377,7 +377,7 @@ size_type QTorrentHandle::total_payload_upload() const {
|
|||||||
// to all files in a torrent
|
// to all files in a torrent
|
||||||
QStringList QTorrentHandle::files_path() const {
|
QStringList QTorrentHandle::files_path() const {
|
||||||
Q_ASSERT(h.is_valid());
|
Q_ASSERT(h.is_valid());
|
||||||
QDir saveDir(misc::toQString(h.save_path().string()));
|
QDir saveDir(save_path());
|
||||||
QStringList res;
|
QStringList res;
|
||||||
torrent_info::file_iterator fi = h.get_torrent_info().begin_files();
|
torrent_info::file_iterator fi = h.get_torrent_info().begin_files();
|
||||||
while(fi != h.get_torrent_info().end_files()) {
|
while(fi != h.get_torrent_info().end_files()) {
|
||||||
@@ -387,6 +387,22 @@ QStringList QTorrentHandle::files_path() const {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList QTorrentHandle::uneeded_files_path() const {
|
||||||
|
Q_ASSERT(h.is_valid());
|
||||||
|
QDir saveDir(save_path());
|
||||||
|
QStringList res;
|
||||||
|
std::vector<int> fp = h.file_priorities();
|
||||||
|
torrent_info::file_iterator fi = h.get_torrent_info().begin_files();
|
||||||
|
int i = 0;
|
||||||
|
while(fi != h.get_torrent_info().end_files()) {
|
||||||
|
if(fp[i] == 0)
|
||||||
|
res << QDir::cleanPath(saveDir.absoluteFilePath(misc::toQStringU(fi->path.string())));
|
||||||
|
fi++;
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
bool QTorrentHandle::has_missing_files() const {
|
bool QTorrentHandle::has_missing_files() const {
|
||||||
const QStringList paths = files_path();
|
const QStringList paths = files_path();
|
||||||
foreach(const QString &path, paths) {
|
foreach(const QString &path, paths) {
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ class QTorrentHandle {
|
|||||||
size_type all_time_download() const;
|
size_type all_time_download() const;
|
||||||
size_type total_done() const;
|
size_type total_done() const;
|
||||||
QStringList files_path() const;
|
QStringList files_path() const;
|
||||||
|
QStringList uneeded_files_path() const;
|
||||||
bool has_missing_files() const;
|
bool has_missing_files() const;
|
||||||
int num_uploads() const;
|
int num_uploads() const;
|
||||||
bool is_seed() const;
|
bool is_seed() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user