* use guint for done/total
authorDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Tue, 15 May 2007 08:13:27 +0000 (08:13 +0000)
committerDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Tue, 15 May 2007 08:13:27 +0000 (08:13 +0000)
* add parameter checks

pmo-trunk-r1864

src/maemo/modest-progress-bar-widget.c
src/maemo/modest-progress-bar-widget.h

index 202ba66..e1116a1 100644 (file)
@@ -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;
        /* 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);
 
                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,
 void 
 modest_progress_bar_widget_set_progress   (ModestProgressBarWidget *self,
                                           const gchar *message,
-                                          gint done,
-                                          gint total)
+                                          guint done,
+                                          guint total)
 {
        ModestProgressBarWidgetPrivate *priv;
        
 {
        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 */
        priv = MODEST_PROGRESS_BAR_WIDGET_GET_PRIVATE (self);
        
        /* Set progress */
index c4a5754..0db622a 100644 (file)
@@ -67,9 +67,10 @@ typedef enum {
 /* member functions */
 GType        modest_progress_bar_widget_get_type    (void) G_GNUC_CONST;
 
 /* 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);