From 150cc7de1c40a0e4a40286c98f271400f8a70bd3 Mon Sep 17 00:00:00 2001 From: Gregory McLean Date: Mon, 15 Mar 1999 22:23:02 +0000 Subject: [PATCH] Mon Mar 15 17:09:37 1999 Gregory McLean * 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. --- gnome/ChangeLog | 6 ++++++ gnome/gdialogs.c | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gnome/ChangeLog b/gnome/ChangeLog index e723bf043..3157310cf 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,3 +1,9 @@ +Mon Mar 15 17:09:37 1999 Gregory McLean + + * 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 * gscreen.c (x_select_item): It is not necessary to call diff --git a/gnome/gdialogs.c b/gnome/gdialogs.c index 968316cba..660bb34f3 100644 --- a/gnome/gdialogs.c +++ b/gnome/gdialogs.c @@ -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;