mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-27 11:49:01 +03:00
Fix deprecation warnings
This commit is contained in:
parent
c1aec8671a
commit
355e776852
1 changed files with 5 additions and 3 deletions
|
@ -325,12 +325,12 @@ QStringList QTorrentHandle::uneeded_files_path() const {
|
||||||
QDir saveDir(save_path());
|
QDir saveDir(save_path());
|
||||||
QStringList res;
|
QStringList res;
|
||||||
std::vector<int> fp = torrent_handle::file_priorities();
|
std::vector<int> fp = torrent_handle::file_priorities();
|
||||||
vector<float> progress;
|
vector<size_type> progress;
|
||||||
torrent_handle::file_progress(progress);
|
torrent_handle::file_progress(progress);
|
||||||
torrent_info::file_iterator fi = torrent_handle::get_torrent_info().begin_files();
|
torrent_info::file_iterator fi = torrent_handle::get_torrent_info().begin_files();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while(fi != torrent_handle::get_torrent_info().end_files()) {
|
while(fi != torrent_handle::get_torrent_info().end_files()) {
|
||||||
if(fp[i] == 0 && progress[i] < 1.)
|
if(fp[i] == 0 && progress[i] < filesize_at(i))
|
||||||
res << QDir::cleanPath(saveDir.absoluteFilePath(filepath(*fi)));
|
res << QDir::cleanPath(saveDir.absoluteFilePath(filepath(*fi)));
|
||||||
fi++;
|
fi++;
|
||||||
++i;
|
++i;
|
||||||
|
@ -506,10 +506,12 @@ void QTorrentHandle::prioritize_files(const vector<int> &files) const {
|
||||||
if((int)files.size() != torrent_handle::get_torrent_info().num_files()) return;
|
if((int)files.size() != torrent_handle::get_torrent_info().num_files()) return;
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
bool was_seed = is_seed();
|
bool was_seed = is_seed();
|
||||||
|
vector<size_type> progress;
|
||||||
|
torrent_handle::file_progress(progress);
|
||||||
torrent_handle::prioritize_files(files);
|
torrent_handle::prioritize_files(files);
|
||||||
for(uint i=0; i<files.size(); ++i) {
|
for(uint i=0; i<files.size(); ++i) {
|
||||||
// Move unwanted files to a .unwanted subfolder
|
// Move unwanted files to a .unwanted subfolder
|
||||||
if(files[i] == 0) {
|
if(files[i] == 0 && progress[i] < filesize_at(i)) {
|
||||||
QString old_path = filepath_at(i);
|
QString old_path = filepath_at(i);
|
||||||
QString old_name = filename_at(i);
|
QString old_name = filename_at(i);
|
||||||
QString parent_path = misc::branchPath(old_path);
|
QString parent_path = misc::branchPath(old_path);
|
||||||
|
|
Loading…
Reference in a new issue