Fix torrent download on win32 (all seems functional now).

This commit is contained in:
Christophe Dumez
2010-05-30 17:23:41 +00:00
parent cfc4e7c8f6
commit 47e337dc5d
4 changed files with 2074 additions and 2052 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -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"));
}
}

View File

@@ -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());

View File

@@ -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