summaryrefslogtreecommitdiff
path: root/src/gui/updatewindow.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <bertram@cegetel.net>2005-07-16 00:22:58 +0000
committerYohann Ferreira <bertram@cegetel.net>2005-07-16 00:22:58 +0000
commit3839ff35294ec2fba40603595f09fd98cb9f2709 (patch)
tree4bd82b27f5f6f969ec8cb90858987ce117269ebd /src/gui/updatewindow.cpp
parentfc86c594fc0d426f8d80efaeaeddcfe7c6941308 (diff)
downloadmana-3839ff35294ec2fba40603595f09fd98cb9f2709.tar.gz
mana-3839ff35294ec2fba40603595f09fd98cb9f2709.tar.bz2
mana-3839ff35294ec2fba40603595f09fd98cb9f2709.tar.xz
mana-3839ff35294ec2fba40603595f09fd98cb9f2709.zip
Now copy the files to good place wether we are under *nix or win.
Diffstat (limited to 'src/gui/updatewindow.cpp')
-rw-r--r--src/gui/updatewindow.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp
index 473cc171..7fc80dd7 100644
--- a/src/gui/updatewindow.cpp
+++ b/src/gui/updatewindow.cpp
@@ -177,8 +177,9 @@ int downloadThread(void *ptr)
{
// Download current file as a temp file
logger->log("Downloading: %s", url.c_str());
- // TODO: download in the proper folder (data?)
- outfile = fopen(TMW_DATADIR "data/download.temp", "wb");
+ // Download in the proper folder : ./data under win, /home/user/.tmw/data for unices
+ std::string outFilename = config.getValue("homeDir", "") + "/data/download.temp";
+ outfile = fopen(outFilename.c_str(), "wb");
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile);
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
@@ -196,9 +197,9 @@ int downloadThread(void *ptr)
else {
// If the download was successful give the file the proper name
// else it will be deleted later
- std::string newName(TMW_DATADIR "data/");
+ std::string newName(config.getValue("homeDir", "") + "/data/");
newName += currentFile.c_str();
- rename(TMW_DATADIR "data/download.temp", newName.c_str());
+ rename(outFilename.c_str(), newName.c_str());
}
}