From 930f797d34adf7c171ee12b9ec6f8de7901a075d Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Tue, 15 May 2007 08:13:27 +0000 Subject: [PATCH] * use guint for done/total * add parameter checks pmo-trunk-r1864 --- src/maemo/modest-progress-bar-widget.c | 13 ++++++++----- src/maemo/modest-progress-bar-widget.h | 5 +++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/maemo/modest-progress-bar-widget.c b/src/maemo/modest-progress-bar-widget.c index 202ba66..e1116a1 100644 --- a/src/maemo/modest-progress-bar-widget.c +++ b/src/maemo/modest-progress-bar-widget.c @@ -331,9 +331,9 @@ on_progress_changed (ModestMailOperation *mail_op, /* If the mail operation is the currently shown one */ if (priv->current == mail_op) { gchar *msg = NULL; - gint done = modest_mail_operation_get_task_done (mail_op); - gint total = modest_mail_operation_get_task_total (mail_op); - + guint done = modest_mail_operation_get_task_done (mail_op); + guint total = modest_mail_operation_get_task_total (mail_op); + determined = (done > 0 && total > 0); id = modest_mail_operation_get_id (mail_op); @@ -382,11 +382,14 @@ modest_progress_bar_widget_new () void modest_progress_bar_widget_set_progress (ModestProgressBarWidget *self, const gchar *message, - gint done, - gint total) + guint done, + guint total) { ModestProgressBarWidgetPrivate *priv; + g_return_if_fail (MODEST_IS_PROGRESS_BAR_WIDGET(self)); + g_return_if_fail (done <= total); + priv = MODEST_PROGRESS_BAR_WIDGET_GET_PRIVATE (self); /* Set progress */ diff --git a/src/maemo/modest-progress-bar-widget.h b/src/maemo/modest-progress-bar-widget.h index c4a5754..0db622a 100644 --- a/src/maemo/modest-progress-bar-widget.h +++ b/src/maemo/modest-progress-bar-widget.h @@ -67,9 +67,10 @@ typedef enum { /* member functions */ GType modest_progress_bar_widget_get_type (void) G_GNUC_CONST; -GtkWidget* modest_progress_bar_widget_new (); +GtkWidget* modest_progress_bar_widget_new (void); -void modest_progress_bar_widget_set_progress (ModestProgressBarWidget *self, const gchar *msg, gint done, gint total); +void modest_progress_bar_widget_set_progress (ModestProgressBarWidget *self, + const gchar *msg, guint done, guint total); -- 1.7.9.5