From 3839ff35294ec2fba40603595f09fd98cb9f2709 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Sat, 16 Jul 2005 00:22:58 +0000 Subject: Now copy the files to good place wether we are under *nix or win. --- src/gui/updatewindow.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/gui') 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()); } } -- cgit v1.2.3-60-g2f50