mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-09 00:52:30 -06:00
Fix torrent download on win32 (all seems functional now).
This commit is contained in:
4102
src/bittorrent.cpp
4102
src/bittorrent.cpp
File diff suppressed because it is too large
Load Diff
@@ -73,24 +73,27 @@ void downloadThread::processDlFinished(QNetworkReply* reply) {
|
|||||||
}
|
}
|
||||||
// Success
|
// Success
|
||||||
QString filePath;
|
QString filePath;
|
||||||
QTemporaryFile tmpfile;
|
QTemporaryFile *tmpfile = new QTemporaryFile;
|
||||||
tmpfile.setAutoRemove(false);
|
tmpfile->setAutoRemove(false);
|
||||||
if (tmpfile.open()) {
|
if (tmpfile->open()) {
|
||||||
filePath = tmpfile.fileName();
|
filePath = tmpfile->fileName();
|
||||||
qDebug("Temporary filename is: %s", qPrintable(filePath));
|
qDebug("Temporary filename is: %s", qPrintable(filePath));
|
||||||
if(reply->open(QIODevice::ReadOnly)) {
|
if(reply->open(QIODevice::ReadOnly)) {
|
||||||
// TODO: Support GZIP compression
|
// TODO: Support GZIP compression
|
||||||
tmpfile.write(reply->readAll());
|
tmpfile->write(reply->readAll());
|
||||||
reply->close();
|
reply->close();
|
||||||
tmpfile.close();
|
tmpfile->close();
|
||||||
|
delete tmpfile;
|
||||||
// Send finished signal
|
// Send finished signal
|
||||||
emit downloadFinished(url, filePath);
|
emit downloadFinished(url, filePath);
|
||||||
} else {
|
} else {
|
||||||
// Error when reading the request
|
// Error when reading the request
|
||||||
tmpfile.close();
|
tmpfile->close();
|
||||||
|
delete tmpfile;
|
||||||
emit downloadFailure(url, tr("I/O Error"));
|
emit downloadFailure(url, tr("I/O Error"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
delete tmpfile;
|
||||||
emit downloadFailure(url, tr("I/O Error"));
|
emit downloadFailure(url, tr("I/O Error"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,11 +155,8 @@ void SearchEngine::checkForPythonExe() {
|
|||||||
QString path_envar = QString::fromLocal8Bit(getenv("PATH"));
|
QString path_envar = QString::fromLocal8Bit(getenv("PATH"));
|
||||||
if(path_envar.isNull()) {
|
if(path_envar.isNull()) {
|
||||||
path_envar = "";
|
path_envar = "";
|
||||||
} else {
|
|
||||||
if(!path_envar.endsWith(";"))
|
|
||||||
path_envar += ";";
|
|
||||||
}
|
}
|
||||||
path_envar += python_path+";";
|
path_envar = python_path+";"+path_envar;
|
||||||
qDebug("New PATH envvar is: %s", qPrintable(path_envar));
|
qDebug("New PATH envvar is: %s", qPrintable(path_envar));
|
||||||
QString envar = "PATH="+path_envar;
|
QString envar = "PATH="+path_envar;
|
||||||
putenv(envar.toLocal8Bit().data());
|
putenv(envar.toLocal8Bit().data());
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ LANG_PATH = lang
|
|||||||
ICONS_PATH = Icons
|
ICONS_PATH = Icons
|
||||||
|
|
||||||
# Set the following variable to 1 to enable debug
|
# Set the following variable to 1 to enable debug
|
||||||
DEBUG_MODE = 1
|
DEBUG_MODE = 0
|
||||||
|
|
||||||
# Global
|
# Global
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
|
|||||||
Reference in New Issue
Block a user