- some code cleanup
This commit is contained in:
parent
b8e272519c
commit
02e591c41d
|
@ -278,14 +278,16 @@ void LogFileThread::saveToDisk(bool forceSaveAll,bool logListAlreadyLocked) {
|
||||||
// logCount = min(logCount,(std::size_t)2000000);
|
// logCount = min(logCount,(std::size_t)2000000);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
for(unsigned int i = 0; i < logCount; ++i) {
|
if(logCount > 0) {
|
||||||
LogFileEntry &entry = tempLogList[i];
|
for(unsigned int i = 0; i < logCount; ++i) {
|
||||||
SystemFlags::logDebugEntry(entry.type, entry.entry, entry.entryDateTime);
|
LogFileEntry &entry = tempLogList[i];
|
||||||
}
|
SystemFlags::logDebugEntry(entry.type, entry.entry, entry.entryDateTime);
|
||||||
|
}
|
||||||
|
|
||||||
safeMutex.Lock();
|
safeMutex.Lock();
|
||||||
logList.erase(logList.begin(),logList.begin() + logCount);
|
logList.erase(logList.begin(),logList.begin() + logCount);
|
||||||
safeMutex.ReleaseLock();
|
safeMutex.ReleaseLock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
safeMutex.ReleaseLock();
|
safeMutex.ReleaseLock();
|
||||||
|
|
|
@ -132,7 +132,7 @@ static long file_is_comming(struct curl_fileinfo *finfo,void *data,int remains)
|
||||||
static long file_is_downloaded(void *data) {
|
static long file_is_downloaded(void *data) {
|
||||||
struct FtpFile *out=(struct FtpFile *)data;
|
struct FtpFile *out=(struct FtpFile *)data;
|
||||||
if(out->stream) {
|
if(out->stream) {
|
||||||
printf("DOWNLOAD COMPLETE!\n");
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("DOWNLOAD COMPLETE!\n");
|
||||||
|
|
||||||
fclose(out->stream);
|
fclose(out->stream);
|
||||||
out->stream = NULL;
|
out->stream = NULL;
|
||||||
|
@ -141,10 +141,7 @@ static long file_is_downloaded(void *data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int file_progress(struct FtpFile *out,double download_total, double download_now, double upload_total,double upload_now) {
|
int file_progress(struct FtpFile *out,double download_total, double download_now, double upload_total,double upload_now) {
|
||||||
// printf("%d / %d (%g %%)\n", d, t, d*100.0/t);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf(" download progress [%f][%f][%f][%f] ",download_total,download_now,upload_total,upload_now);
|
||||||
//gdk_threads_enter();
|
|
||||||
//gtk_progress_set_value(GTK_PROGRESS(bar), d*100.0/t);
|
|
||||||
//gdk_threads_leave();
|
|
||||||
|
|
||||||
if(out != NULL &&
|
if(out != NULL &&
|
||||||
out->ftpServer != NULL &&
|
out->ftpServer != NULL &&
|
||||||
|
|
Loading…
Reference in New Issue
Block a user