Browse Source

httpconnection: Make sure torrent file is written in binary mode

adaptive-webui-19844
Christophe Dumez 13 years ago
parent
commit
9115a2ddc2
  1. 2
      src/webui/httpconnection.cpp

2
src/webui/httpconnection.cpp

@ -402,6 +402,8 @@ void HttpConnection::respondCommand(const QString& command) {
// it fails to load on Windows. // it fails to load on Windows.
QTemporaryFile *tmpfile = new QTemporaryFile (QDir::temp().absoluteFilePath("qBT-XXXXXX.torrent")); QTemporaryFile *tmpfile = new QTemporaryFile (QDir::temp().absoluteFilePath("qBT-XXXXXX.torrent"));
if (tmpfile->open()) { if (tmpfile->open()) {
// Make sure we are writing in binary mode
tmpfile->setTextModeEnabled(false);
tmpfile->write(m_parser.torrent()); tmpfile->write(m_parser.torrent());
tmpfile->close(); tmpfile->close();
emit torrentReadyToBeDownloaded(tmpfile->fileName(), false, QString(), false); emit torrentReadyToBeDownloaded(tmpfile->fileName(), false, QString(), false);

Loading…
Cancel
Save