diff --git a/UpdaterWindow.cpp b/UpdaterWindow.cpp index c775bf7d..c3d68afd 100644 --- a/UpdaterWindow.cpp +++ b/UpdaterWindow.cpp @@ -89,7 +89,9 @@ void UpdaterWindow::downloadUpdateXML() { requestmode=RM_CheckUpdates; - reply=netmanager->get(QNetworkRequest(update_url)); + QNetworkRequest req=QNetworkRequest(update_url); + req.setRawHeader("User-Agent", "Wget/1.12 (linux-gnu)"); + reply=netmanager->get(req); ui->plainTextEdit->appendPlainText("Requesting "+update_url.toString()); netmanager->connect(reply,SIGNAL(downloadProgress(qint64,qint64)),this, SLOT(downloadProgress(qint64,qint64))); dltime.start(); @@ -189,7 +191,7 @@ void UpdaterWindow::ParseUpdateXML(QIODevice * dev) } if (!release || (VersionString() > release->version)) { mainwin->Notify("No updates were found for your platform",5000,"SleepyHead Updates"); - delay(4000); + sh_delay(4000); close(); return; } @@ -276,7 +278,7 @@ void UpdaterWindow::replyFinished(QNetworkReply * reply) } ui->plainTextEdit->appendPlainText(QString::number(reply->size())+" bytes received."); - QString filename=QApplication::applicationDirPath()+QDir::separator()+reply->url().toString().section("/",-1); + QString filename=QApplication::applicationDirPath()+QDir::separator()+"update.xml"; qDebug() << filename; QFile file(filename); file.open(QFile::WriteOnly); diff --git a/UpdaterWindow.h b/UpdaterWindow.h index 5dfb8b7f..00034cb4 100644 --- a/UpdaterWindow.h +++ b/UpdaterWindow.h @@ -6,6 +6,7 @@ #include #include #include +#include #include "version.h" #include "updateparser.h" diff --git a/common_gui.cpp b/common_gui.cpp index 11cb059d..d1b9590d 100644 --- a/common_gui.cpp +++ b/common_gui.cpp @@ -7,7 +7,7 @@ #include "common_gui.h" #include "qglobal.h" -void delay(int ms) +void sh_delay(int ms) { #ifdef Q_WS_WIN32 delay(ms); diff --git a/common_gui.h b/common_gui.h index 1e969422..5bb2c71f 100644 --- a/common_gui.h +++ b/common_gui.h @@ -10,6 +10,6 @@ #include Qt::DayOfWeek firstDayOfWeekFromLocale(); -void delay(int ms); +void sh_delay(int ms); #endif diff --git a/quazip/quazip_global.h b/quazip/quazip_global.h index d9d09ade..f60de970 100644 --- a/quazip/quazip_global.h +++ b/quazip/quazip_global.h @@ -26,6 +26,8 @@ quazip/(un)zip.h files for details, basically it's zlib license. #include +#define QUAZIP_BUILD + /** This is automatically defined when building a static library, but when including QuaZip sources directly into a project, QUAZIP_STATIC should