1
1

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.
Этот коммит содержится в:
Gregory McLean 1999-03-15 22:23:02 +00:00
родитель f91b5de7c8
Коммит 150cc7de1c
2 изменённых файлов: 10 добавлений и 3 удалений

Просмотреть файл

@ -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> 1999-03-15 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gscreen.c (x_select_item): It is not necessary to call * gscreen.c (x_select_item): It is not necessary to call

Просмотреть файл

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