From ce0ddbe5177f88c0352b5eef82ae2404c2cff767 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sat, 13 Mar 2010 13:40:26 +0000 Subject: [PATCH] Qt 4.6 fix --- src/bittorrent.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index 0716e06ad..4ebb133c2 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -1556,15 +1556,17 @@ void Bittorrent::addConsoleMessage(QString msg, QString) { if(file_size > 0 && (fp[i]/(double)file_size) < 1.) { const QString &name = misc::toQString(h.get_torrent_info().file_at(i).path.string()); if(!name.endsWith(".!qB")) { - qDebug("Renaming %s to %s", qPrintable(name), qPrintable(name+".!qB")); - h.rename_file(i, name + ".!qB"); + const QString &new_name = name+".!qB"; + qDebug("Renaming %s to %s", qPrintable(name), qPrintable(new_name)); + h.rename_file(i, new_name); } } } else { QString name = misc::toQString(h.get_torrent_info().file_at(i).path.string()); if(name.endsWith(".!qB")) { + const QString old_name = name; name.chop(4); - qDebug("Renaming %s to %s", qPrintable(name+".!qB"), qPrintable(name)); + qDebug("Renaming %s to %s", qPrintable(old_name), qPrintable(name)); h.rename_file(i, name); } }