From 35a9fab3b4e717b2d183398d30f74eff5aa9fc25 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 26 Aug 2007 17:48:38 +0000 Subject: [PATCH] - Check if priorities file exists before trying to read it to avoid a warning message --- src/bittorrent.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index 67e49ebc4..5ea70a9f7 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -632,9 +632,13 @@ void bittorrent::loadFilesPriorities(QTorrentHandle &h) { unsigned int nbFiles = h.num_files(); QString hash = h.hash(); 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 if(!pieces_file.open(QIODevice::ReadOnly | QIODevice::Text)) { - qDebug("* Error: Couldn't open priorities file"); + qDebug("* Error: Couldn't open priorities file: %s"); return; } QByteArray pieces_priorities = pieces_file.readAll();