mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-29 11:48:05 -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
|
||||
QString filePath;
|
||||
QTemporaryFile tmpfile;
|
||||
tmpfile.setAutoRemove(false);
|
||||
if (tmpfile.open()) {
|
||||
filePath = tmpfile.fileName();
|
||||
QTemporaryFile *tmpfile = new QTemporaryFile;
|
||||
tmpfile->setAutoRemove(false);
|
||||
if (tmpfile->open()) {
|
||||
filePath = tmpfile->fileName();
|
||||
qDebug("Temporary filename is: %s", qPrintable(filePath));
|
||||
if(reply->open(QIODevice::ReadOnly)) {
|
||||
// TODO: Support GZIP compression
|
||||
tmpfile.write(reply->readAll());
|
||||
tmpfile->write(reply->readAll());
|
||||
reply->close();
|
||||
tmpfile.close();
|
||||
tmpfile->close();
|
||||
delete tmpfile;
|
||||
// Send finished signal
|
||||
emit downloadFinished(url, filePath);
|
||||
} else {
|
||||
// Error when reading the request
|
||||
tmpfile.close();
|
||||
tmpfile->close();
|
||||
delete tmpfile;
|
||||
emit downloadFailure(url, tr("I/O Error"));
|
||||
}
|
||||
} else {
|
||||
delete tmpfile;
|
||||
emit downloadFailure(url, tr("I/O Error"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,11 +155,8 @@ void SearchEngine::checkForPythonExe() {
|
||||
QString path_envar = QString::fromLocal8Bit(getenv("PATH"));
|
||||
if(path_envar.isNull()) {
|
||||
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));
|
||||
QString envar = "PATH="+path_envar;
|
||||
putenv(envar.toLocal8Bit().data());
|
||||
|
||||
@@ -3,7 +3,7 @@ LANG_PATH = lang
|
||||
ICONS_PATH = Icons
|
||||
|
||||
# Set the following variable to 1 to enable debug
|
||||
DEBUG_MODE = 1
|
||||
DEBUG_MODE = 0
|
||||
|
||||
# Global
|
||||
TEMPLATE = app
|
||||
|
||||
Reference in New Issue
Block a user