More code cleanup

This commit is contained in:
Christophe Dumez 2010-03-04 20:19:25 +00:00
parent 9a645b4b19
commit aec99ed14f
18 changed files with 191 additions and 201 deletions

View file

@ -59,7 +59,7 @@ void downloadThread::processDlFinished(QNetworkReply* reply) {
QVariant redirection = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
if(redirection.isValid()) {
// We should redirect
qDebug("Redirecting from %s to %s", url.toLocal8Bit().data(), redirection.toUrl().toString().toLocal8Bit().data());
qDebug("Redirecting from %s to %s", qPrintable(url), qPrintable(redirection.toUrl().toString()));
redirect_mapping.insert(redirection.toUrl().toString(), url);
downloadUrl(redirection.toUrl().toString());
return;
@ -74,7 +74,7 @@ void downloadThread::processDlFinished(QNetworkReply* reply) {
tmpfile.setAutoRemove(false);
if (tmpfile.open()) {
filePath = tmpfile.fileName();
qDebug("Temporary filename is: %s", filePath.toLocal8Bit().data());
qDebug("Temporary filename is: %s", qPrintable(filePath));
if(reply->open(QIODevice::ReadOnly)) {
// TODO: Support GZIP compression
tmpfile.write(reply->readAll());
@ -104,7 +104,7 @@ void downloadThread::downloadUrl(QString url){
// Spoof Firefox 3.5 user agent to avoid
// Web server banning
request.setRawHeader("User-Agent", "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5");
qDebug("Downloading %s...", request.url().toString().toLocal8Bit().data());
qDebug("Downloading %s...", qPrintable(request.url().toString()));
networkManager->get(request);
}
@ -117,7 +117,7 @@ void downloadThread::applyProxySettings() {
QString IP = settings.value(QString::fromUtf8("Preferences/Connection/HTTPProxy/IP"), "0.0.0.0").toString();
proxy.setHostName(IP);
QString port = settings.value(QString::fromUtf8("Preferences/Connection/HTTPProxy/Port"), 8080).toString();
qDebug("Using proxy: %s", (IP+QString(":")+port).toLocal8Bit().data());
qDebug("Using proxy: %s", qPrintable(IP+QString(":")+port));
proxy.setPort(port.toUShort());
// Default proxy type is HTTP, we must change if it is SOCKS5
if(intValue == SOCKS5 || intValue == SOCKS5_PW) {