diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-01-23 21:05:05 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-01-23 21:05:05 +0000 |
commit | 05bdb92c267e3f041788f2aa41a73c9953249e7c (patch) | |
tree | 356033be4c1c373972b8a32b9e67503b3a6a0abf /src/gui/updatewindow.cpp | |
parent | d1395845cdc678db2a71326f2e6f20253ed14cac (diff) | |
download | mana-05bdb92c267e3f041788f2aa41a73c9953249e7c.tar.gz mana-05bdb92c267e3f041788f2aa41a73c9953249e7c.tar.bz2 mana-05bdb92c267e3f041788f2aa41a73c9953249e7c.tar.xz mana-05bdb92c267e3f041788f2aa41a73c9953249e7c.zip |
Merged 0.0 changes from revision 3035 to 3065 to trunk.
Diffstat (limited to 'src/gui/updatewindow.cpp')
-rw-r--r-- | src/gui/updatewindow.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
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 <SDL_thread.h> #include <zlib.h> -#include <curl/curl.h> - #include <guichan/widgets/label.hpp> #include "browserbox.h" @@ -37,6 +35,9 @@ #include "progressbar.h" #include "scrollarea.h" +// Curl should be included after Guichan to avoid Windows redefinitions +#include <curl/curl.h> + #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; |