Mon Mar 15 17:09:37 1999 Gregory McLean <gregm@comstar.net>

* gdialogs.c (file_progress_show_bytes): Fixed a GTK Warning when
	done / total >= 1.0
	* file.c : Actually update the progress bar when copying files around.
This commit is contained in:
Gregory McLean 1999-03-15 22:23:02 +00:00
parent f91b5de7c8
commit 150cc7de1c
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,9 @@
Mon Mar 15 17:09:37 1999 Gregory McLean <gregm@comstar.net>
* gdialogs.c (file_progress_show_bytes): Fixed a GTK Warning when
done / total >= 1.0
* file.c : Actually update the progress bar when copying files around.
1999-03-15 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gscreen.c (x_select_item): It is not necessary to call

View File

@ -273,6 +273,7 @@ FileProgressStatus
file_progress_show_bytes (FileOpContext *ctx, double done, double total)
{
FileOpContextUI *ui;
gfloat per;
g_return_val_if_fail (ctx != NULL, FILE_CONT);
@ -284,12 +285,12 @@ file_progress_show_bytes (FileOpContext *ctx, double done, double total)
if (ui->aborting)
return FILE_ABORT;
per = ( done / total <= 1.0) ? done / total : 1.0;
if (total == 0.0)
if (total <= 0.0)
gtk_progress_bar_update (GTK_PROGRESS_BAR (ui->byte_prog), 0.0);
else
gtk_progress_bar_update (GTK_PROGRESS_BAR (ui->byte_prog),
(gfloat) done/(gfloat) total);
gtk_progress_bar_update (GTK_PROGRESS_BAR (ui->byte_prog), per);
while (gtk_events_pending ())
gtk_main_iteration ();
return FILE_CONT;