only show progess when now != total, as curl returns some weird values

at the start of a download.


SVN revision: 34875
This commit is contained in:
Sebastian Dransfeld 2008-06-19 17:30:47 +00:00
parent 544afd206d
commit 2d69efe683
1 changed files with 29 additions and 32 deletions

View File

@ -561,13 +561,12 @@ _download_media_progress_cb(void *data, const char *file, long int dltotal,
Import *import;
double status;
char title[4096];
static long int last;
import = data;
if ((dlnow == 0) || (dltotal == 0)) return 0;
if (last)
if (dlnow != dltotal)
{
status = (double) ((double) dlnow) / ((double) dltotal);
snprintf(title, sizeof(title), _("[%s] Downloading of edje file... %d%% done"),
@ -575,8 +574,6 @@ _download_media_progress_cb(void *data, const char *file, long int dltotal,
e_dialog_title_set(import->dia, title);
}
last = dlnow;
return 0;
}