From 05bdb92c267e3f041788f2aa41a73c9953249e7c Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Tue, 23 Jan 2007 21:05:05 +0000 Subject: Merged 0.0 changes from revision 3035 to 3065 to trunk. --- src/gui/updatewindow.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/gui/updatewindow.cpp') diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp index d41dfe13..fe78a27b 100644 --- a/src/gui/updatewindow.cpp +++ b/src/gui/updatewindow.cpp @@ -28,8 +28,6 @@ #include #include -#include - #include #include "browserbox.h" @@ -37,6 +35,9 @@ #include "progressbar.h" #include "scrollarea.h" +// Curl should be included after Guichan to avoid Windows redefinitions +#include + #include "../configuration.h" #include "../log.h" #include "../main.h" @@ -137,7 +138,7 @@ void UpdaterWindow::action(const gcn::ActionEvent &event) if (event.getId() == "cancel") { // Register the user cancel - mUserCancel=true; + mUserCancel = true; // Skip the updating process if (mDownloadStatus == UPDATE_COMPLETE) { @@ -262,6 +263,11 @@ int UpdaterWindow::downloadThread(void *ptr) curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile); } +#ifdef PACKAGE_VERSION + curl_easy_setopt(curl, CURLOPT_USERAGENT, "TMW/" PACKAGE_VERSION); +#else + curl_easy_setopt(curl, CURLOPT_USERAGENT, "TMW"); +#endif curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, uw->mCurlError); curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0); @@ -365,13 +371,13 @@ void UpdaterWindow::logic() case UPDATE_ERROR: if (mThread) { - if(mUserCancel){ + if (mUserCancel) { // Kill the thread, because user has canceled SDL_KillThread(mThread); // Set the flag to false again mUserCancel = false; } - else{ + else { SDL_WaitThread(mThread, NULL); } mThread = NULL; -- cgit v1.2.3-70-g09d2