mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 17:53:08 -07:00
- Check if priorities file exists before trying to read it to avoid a warning message
This commit is contained in:
parent
4e2ebe5a69
commit
35a9fab3b4
1 changed files with 5 additions and 1 deletions
|
@ -632,9 +632,13 @@ void bittorrent::loadFilesPriorities(QTorrentHandle &h) {
|
||||||
unsigned int nbFiles = h.num_files();
|
unsigned int nbFiles = h.num_files();
|
||||||
QString hash = h.hash();
|
QString hash = h.hash();
|
||||||
QFile pieces_file(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".priorities");
|
QFile pieces_file(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".priorities");
|
||||||
|
if(!pieces_file.exists()){
|
||||||
|
qDebug("Info: priorities file does not exist for %s", hash.toUtf8().data());
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Read saved file
|
// Read saved file
|
||||||
if(!pieces_file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
if(!pieces_file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||||
qDebug("* Error: Couldn't open priorities file");
|
qDebug("* Error: Couldn't open priorities file: %s");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QByteArray pieces_priorities = pieces_file.readAll();
|
QByteArray pieces_priorities = pieces_file.readAll();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue