- some code cleanup

This commit is contained in:
Mark Vejvoda 2011-01-04 20:55:10 +00:00
parent b8e272519c
commit 02e591c41d
2 changed files with 11 additions and 12 deletions

View File

@ -278,14 +278,16 @@ void LogFileThread::saveToDisk(bool forceSaveAll,bool logListAlreadyLocked) {
// logCount = min(logCount,(std::size_t)2000000);
//}
for(unsigned int i = 0; i < logCount; ++i) {
LogFileEntry &entry = tempLogList[i];
SystemFlags::logDebugEntry(entry.type, entry.entry, entry.entryDateTime);
}
if(logCount > 0) {
for(unsigned int i = 0; i < logCount; ++i) {
LogFileEntry &entry = tempLogList[i];
SystemFlags::logDebugEntry(entry.type, entry.entry, entry.entryDateTime);
}
safeMutex.Lock();
logList.erase(logList.begin(),logList.begin() + logCount);
safeMutex.ReleaseLock();
safeMutex.Lock();
logList.erase(logList.begin(),logList.begin() + logCount);
safeMutex.ReleaseLock();
}
}
else {
safeMutex.ReleaseLock();

View File

@ -132,7 +132,7 @@ static long file_is_comming(struct curl_fileinfo *finfo,void *data,int remains)
static long file_is_downloaded(void *data) {
struct FtpFile *out=(struct FtpFile *)data;
if(out->stream) {
printf("DOWNLOAD COMPLETE!\n");
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("DOWNLOAD COMPLETE!\n");
fclose(out->stream);
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) {
// printf("%d / %d (%g %%)\n", d, t, d*100.0/t);
//gdk_threads_enter();
//gtk_progress_set_value(GTK_PROGRESS(bar), d*100.0/t);
//gdk_threads_leave();
if(SystemFlags::VERBOSE_MODE_ENABLED) printf(" download progress [%f][%f][%f][%f] ",download_total,download_now,upload_total,upload_now);
if(out != NULL &&
out->ftpServer != NULL &&