- updates to file transfer progress bar
This commit is contained in:
parent
f3eee457c0
commit
b8e272519c
|
@ -1712,9 +1712,9 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName, FTP_Client
|
|||
if(stats != NULL) {
|
||||
int fileProgress = 0;
|
||||
if(stats->download_total > 0) {
|
||||
fileProgress = (stats->download_now * 100.0 / stats->download_total);
|
||||
fileProgress = ((stats->download_now / stats->download_total) * 100.0);
|
||||
}
|
||||
printf("Got FTP Callback for [%s] fileProgress = %d [now = %f, total = %f]\n",itemName.c_str(),fileProgress,stats->download_now,stats->download_total);
|
||||
printf("Got FTP Callback for [%s] current file [%s] fileProgress = %d [now = %f, total = %f]\n",itemName.c_str(),stats->currentFilename.c_str(), fileProgress,stats->download_now,stats->download_total);
|
||||
|
||||
fileFTPProgressList[itemName] = pair<int,string>(fileProgress,stats->currentFilename);
|
||||
}
|
||||
|
|
|
@ -91,7 +91,10 @@ static long file_is_comming(struct curl_fileinfo *finfo,void *data,int remains)
|
|||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("\n===> FTP Client thread file_is_comming: remains: [%3d] filename: [%s] size: [%10luB] ", remains, finfo->filename,(unsigned long)finfo->size);
|
||||
|
||||
if(out != NULL) {
|
||||
out->currentFilename = finfo->filename;
|
||||
//out->currentFilename = finfo->filename;
|
||||
out->currentFilename = fullFilePath;
|
||||
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf(" current filename: [%s] ", fullFilePath.c_str());
|
||||
}
|
||||
|
||||
switch(finfo->filetype) {
|
||||
|
@ -263,6 +266,7 @@ void FTPClientThread::getMapFromServer(string mapFileName) {
|
|||
}
|
||||
|
||||
if(this->pCBObject != NULL) {
|
||||
MutexSafeWrapper safeMutex(this->getProgressMutex());
|
||||
this->pCBObject->FTPClient_CallbackEvent(mapFileName,ftp_cct_Map,result,NULL);
|
||||
}
|
||||
}
|
||||
|
@ -288,6 +292,7 @@ void FTPClientThread::getTilesetFromServer(string tileSetName) {
|
|||
}
|
||||
|
||||
if(this->pCBObject != NULL) {
|
||||
MutexSafeWrapper safeMutex(this->getProgressMutex());
|
||||
this->pCBObject->FTPClient_CallbackEvent(tileSetName,ftp_cct_Tileset,result,NULL);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user