Changeset 3267 in orxonox.OLD for orxonox/branches/updater/src/gui
- Timestamp:
- Dec 24, 2004, 3:18:11 PM (20 years ago)
- Location:
- orxonox/branches/updater/src/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/updater/src/gui/orxonox_gui_update.cc
r3266 r3267 153 153 FileInfo* info = new FileInfo; 154 154 155 info->fileOnDisk = new char [5]; 156 strcpy (info->fileOnDisk, "test"); 157 info->fileOnNet = new char [100]; 158 strcpy(info->fileOnNet, "http://www.orxonox.ethz.ch/files/02%20orxonox%203.mp3"); 155 info->fileName = "03%20orxonox%203'.mp3"; 156 info->webRoot = "http://www.orxonox.ethz.ch/files/"; 157 info->localRoot = "./"; 159 158 info->Bar = (ProgressBar*)bar; 160 PRINTF(3)("Preparing to download file %s.\n", info->file OnNet);159 PRINTF(3)("Preparing to download file %s.\n", info->fileName); 161 160 // downloadThread (info); 162 161 163 162 if (downloadThreadID == NULL) 164 163 { 165 166 164 if ( (downloadThreadID =g_thread_create(&downloadThread, info, TRUE, NULL)) == 0 ) 165 PRINTF(1)("can't create the thread"); 167 166 } 168 167 else … … 218 217 FILE* outfile; 219 218 curl = curl_easy_init(); 219 char* fileOnNet = new char [strlen(info->webRoot)+strlen(info->fileName)+1]; 220 strcpy (fileOnNet, info->webRoot); 221 strcat (fileOnNet, info->fileName); 222 char* fileOnDisk = new char [strlen(info->localRoot)+strlen(info->fileName)+1]; 223 strcpy (fileOnDisk, info->localRoot); 224 strcat (fileOnDisk, info->fileName); 220 225 221 226 if(curl) 222 227 { 223 outfile = fopen( info->fileOnDisk, "w");228 outfile = fopen(fileOnDisk, "w"); 224 229 225 curl_easy_setopt(curl, CURLOPT_URL, info->fileOnNet);230 curl_easy_setopt(curl, CURLOPT_URL, fileOnNet); 226 231 curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile); 227 232 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curlWriteFunc); -
orxonox/branches/updater/src/gui/orxonox_gui_update.h
r3266 r3267 39 39 40 40 #ifdef HAVE_CURL 41 //! A Struct to hold information about one File to download. 41 42 struct FileInfo 42 43 { 43 char* fileOnNet; 44 char* fileOnDisk; 45 ProgressBar* Bar; 44 char* fileName; //!< The Name of the file we want to get. 45 char* webRoot; //!< The Root of the File on The Web 46 char* localRoot; //!< The Root directory to put the files on the local disk. 47 48 ProgressBar* Bar; //!< The ProgressBar, that sould be updated. 46 49 }; 47 50
Note: See TracChangeset
for help on using the changeset viewer.