2006-05-16 [wwp] 2.2.0cvs19
authorTristan Chabredier <wwp@claws-mail.org>
Tue, 16 May 2006 09:38:20 +0000 (09:38 +0000)
committerTristan Chabredier <wwp@claws-mail.org>
Tue, 16 May 2006 09:38:20 +0000 (09:38 +0000)
* src/action.c
* src/gedit-print.c
* src/inc.c
* src/mainwindow.c
* src/mh.c
* src/statusbar.c
* src/send_message.c
* src/summaryview.c
get rid of some gtk warning/errors at runtime (and avoid divide-by-0).

ChangeLog
PATCHSETS
configure.ac
src/action.c
src/gedit-print.c
src/inc.c
src/mainwindow.c
src/mh.c
src/send_message.c
src/statusbar.c
src/summaryview.c

index 52f0e7c98e3f0396a0daa50f467559253d98f66b..fd3df3f3b29a9f3297646a3aa74f1cdeba843f65 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2006-05-16 [wwp]       2.2.0cvs19
+
+       * src/action.c
+       * src/gedit-print.c
+       * src/inc.c
+       * src/mainwindow.c
+       * src/mh.c
+       * src/statusbar.c
+       * src/send_message.c
+       * src/summaryview.c
+               get rid of some gtk warning/errors at runtime (and avoid divide-by-0).
+
 2006-05-15 [colin]     2.2.0cvs18
 
        * src/procmsg.c
index 03a3bfb27306a1b826892ecee6ad02f47cab2ab7..008e7996bd6bd214663a1f3f6140d3ef9a0bd66d 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.115.2.85 -r 1.115.2.86 src/main.c;  ) > 2.2.0cvs16.patchset
 ( cvs diff -u -r 1.1.2.2 -r 1.1.2.3 tools/filter_conv_new.pl;  ) > 2.2.0cvs17.patchset
 ( cvs diff -u -r 1.150.2.62 -r 1.150.2.63 src/procmsg.c;  ) > 2.2.0cvs18.patchset
+( cvs diff -u -r 1.12.2.34 -r 1.12.2.35 src/action.c;  cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/gedit-print.c;  cvs diff -u -r 1.149.2.47 -r 1.149.2.48 src/inc.c;  cvs diff -u -r 1.274.2.110 -r 1.274.2.111 src/mainwindow.c;  cvs diff -u -r 1.79.2.25 -r 1.79.2.26 src/mh.c;  cvs diff -u -r 1.5.2.8 -r 1.5.2.9 src/statusbar.c;  cvs diff -u -r 1.17.2.27 -r 1.17.2.28 src/send_message.c;  cvs diff -u -r 1.395.2.198 -r 1.395.2.199 src/summaryview.c;  ) > 2.2.0cvs19.patchset
index 3ffbf068a675dc9f7ada3745256c65153f805f36..f6d748cd581f65855faf35812611465a3aea2c4f 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=2
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=18
+EXTRA_VERSION=19
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 0a8b52836dbc582c1c5f57dc92a7c26f528894b0..da91ae664975a1058c40aad6ca19a51b69436700 100644 (file)
@@ -1137,6 +1137,7 @@ static void update_io_dialog(Children *children)
                gchar *text;
                
                gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(children->progress_bar),
+                                                 (children->initial_nb == 0) ? 0 :
                                              (gdouble) (children->initial_nb - children->nb) /
                                              (gdouble) children->initial_nb);
                text = g_strdup_printf("%s %d/%d", _("Completed"), 
index 9598b6b6f1d2c73fb3ef455c8ef22fb1a3dec8dd..cef288edb6cf07ffa8c11f23a17ec1c1c589cb57 100644 (file)
@@ -276,7 +276,7 @@ page_cb (GtkSourcePrintJob *job, GeditPrintJobInfo *pji)
        g_free (str);
 
        gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (pji->progressbar), 
-                                      1.0 * page_num / total);
+                                      (total == 0) ? 0 : 1.0 * page_num / total);
 
        /* Update UI */
        while (gtk_events_pending ())
index 371cb1758c8ebd2dd10f2544ced3da76dd4c3946..938719a339bc997447573b9551e48f9db6fbb7d7 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -927,7 +927,7 @@ static void inc_progress_dialog_set_progress(IncProgressDialog *inc_dialog,
        }
 
        progress_dialog_set_fraction
-               (inc_dialog->dialog,(gfloat)cur_total / (gfloat)total);
+               (inc_dialog->dialog, (total == 0) ? 0: (gfloat)cur_total / (gfloat)total);
 
        g_snprintf(buf, sizeof(buf), "%d / %d",
                   pop3_session->cur_msg, pop3_session->count);
@@ -935,7 +935,7 @@ static void inc_progress_dialog_set_progress(IncProgressDialog *inc_dialog,
                (GTK_PROGRESS_BAR(inc_dialog->mainwin->progressbar), buf);
        gtk_progress_bar_set_fraction
                (GTK_PROGRESS_BAR(inc_dialog->mainwin->progressbar),
-                (gfloat)cur_total / (gfloat)total);
+                (total == 0) ? 0 : (gfloat)cur_total / (gfloat)total);
 
        if (pop3_session->cur_total_num > 0) {
                g_snprintf(buf, sizeof(buf),
index 7c22104d21e347be179c98459662778350d3e4f8..0bba138ffbb97351a7b454fbb9b393b9abc0c316 100644 (file)
@@ -1948,8 +1948,7 @@ void main_window_progress_set(MainWindow *mainwin, gint cur, gint total)
        g_snprintf(buf, sizeof(buf), "%d / %d", cur, total);
        gtk_progress_bar_set_text(GTK_PROGRESS_BAR(mainwin->progressbar), buf);
        gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(mainwin->progressbar),
-                               (cur == 0 && total == 0) ? 0 :
-                               (gfloat)cur / (gfloat)total);
+                               (total == 0) ? 0 : (gfloat)cur / (gfloat)total);
 }
 
 void main_window_empty_trash(MainWindow *mainwin, gboolean confirm)
index 92e97b191138f570392432605f83edfecd6e9805..6215f3ac626ede2ff780a5f4be009c36747dba79 100644 (file)
--- a/src/mh.c
+++ b/src/mh.c
@@ -331,7 +331,8 @@ static MsgInfo *mh_get_msginfo(Folder *folder, FolderItem *item, gint num)
        gchar *file;
 
        g_return_val_if_fail(item != NULL, NULL);
-       g_return_val_if_fail(num > 0, NULL);
+       if (num <= 0)
+               return NULL;
 
        file = mh_fetch_msg(folder, item, num);
        if (!file) return NULL;
index 927e263f9bb9bebe99aa00ea22984fd3f7153268..f29d9a35f6309d8eabe944f5a5ade0663e741fea 100644 (file)
@@ -493,7 +493,7 @@ static gint send_send_data_progressive(Session *session, guint cur_len,
                   cur_len, total_len);
        progress_dialog_set_label(dialog->dialog, buf);
        progress_dialog_set_fraction
-               (dialog->dialog, (gfloat)cur_len / (gfloat)total_len);
+               (dialog->dialog, (total_len == 0) ? 0 : (gfloat)cur_len / (gfloat)total_len);
 
        return 0;
 }
index 129d308e846d00e45735c5620a01b2e9b033b397..9d0fb2de70aafce5e9243f6bf9fe841f35cd0e6a 100644 (file)
@@ -155,7 +155,7 @@ void statusbar_progress_all (gint done, gint total, gint step)
                        (GTK_PROGRESS_BAR(mainwindow_get_mainwindow()->progressbar), buf);
                gtk_progress_bar_set_fraction
                        (GTK_PROGRESS_BAR(mainwindow_get_mainwindow()->progressbar),
-                        (gfloat)done / (gfloat)total);
+                        (total == 0) ? 0 : (gfloat)done / (gfloat)total);
        } else if (total == 0) {
                gtk_progress_bar_set_text
                        (GTK_PROGRESS_BAR(mainwindow_get_mainwindow()->progressbar), "");
index 51afc6239558003eef3af05735be81fa86d83f75..10683e3148171bbeaff0b35a83b2433a780ab42e 100644 (file)
@@ -2496,7 +2496,8 @@ static gchar *summary_complete_address(const gchar *addr)
 
        Xstrdup_a(email_addr, addr, return NULL);
        extract_address(email_addr);
-       g_return_val_if_fail(*email_addr, NULL);
+       if (!*email_addr)
+               return NULL;
 
        /*
         * completion stuff must be already initialized