From cfc4cc37a1aa57ba53c7de807a36dbf94cc1aeb6 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Thu, 17 Jan 2008 10:58:04 +0000 Subject: [PATCH] * small fixes (coverity), param checks pmo-trunk-r4056 --- .../modest-easysetup-provider-combo-box.c | 16 ++++++++++++---- src/maemo/modest-msg-view-window.c | 2 -- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/maemo/easysetup/modest-easysetup-provider-combo-box.c b/src/maemo/easysetup/modest-easysetup-provider-combo-box.c index e317493..de61021 100644 --- a/src/maemo/easysetup/modest-easysetup-provider-combo-box.c +++ b/src/maemo/easysetup/modest-easysetup-provider-combo-box.c @@ -114,7 +114,7 @@ enum MODEL_COLS { * strictly, we should sort providers with mcc=0 after the other ones.... but, we don't have * that info here, so ignoring for now. */ -gint +static gint provider_sort_func (GtkTreeModel *model, GtkTreeIter *iter1, GtkTreeIter *iter2, gpointer user_data) { gchar *prov1, *prov2; @@ -177,6 +177,8 @@ void easysetup_provider_combo_box_fill (EasysetupProviderComboBox *combobox, ModestPresets *presets, gint mcc) { + g_return_if_fail (EASYSETUP_IS_PROVIDER_COMBO_BOX(combobox)); + EasysetupProviderComboBoxPrivate *priv = PROVIDER_COMBO_BOX_GET_PRIVATE (combobox); /* Remove any existing rows: */ @@ -245,6 +247,9 @@ gchar* easysetup_provider_combo_box_get_active_provider_id (EasysetupProviderComboBox *combobox) { GtkTreeIter active; + + g_return_val_if_fail (EASYSETUP_IS_PROVIDER_COMBO_BOX(combobox), NULL); + const gboolean found = gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combobox), &active); if (found) { EasysetupProviderComboBoxPrivate *priv = PROVIDER_COMBO_BOX_GET_PRIVATE (combobox); @@ -262,8 +267,11 @@ easysetup_provider_combo_box_set_others_provider (EasysetupProviderComboBox *com { GtkTreeModel *model; GtkTreeIter others_iter; - model = gtk_combo_box_get_model (GTK_COMBO_BOX (combobox)); - gtk_tree_model_get_iter_first (model, &others_iter); - gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combobox), &others_iter); + g_return_if_fail (EASYSETUP_IS_PROVIDER_COMBO_BOX(combobox)); + + model = gtk_combo_box_get_model (GTK_COMBO_BOX (combobox)); + + if (gtk_tree_model_get_iter_first (model, &others_iter)) + gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combobox), &others_iter); } diff --git a/src/maemo/modest-msg-view-window.c b/src/maemo/modest-msg-view-window.c index 2df6469..c1151aa 100644 --- a/src/maemo/modest-msg-view-window.c +++ b/src/maemo/modest-msg-view-window.c @@ -538,10 +538,8 @@ init_window (ModestMsgViewWindow *obj) { GtkWidget *main_vbox; ModestMsgViewWindowPrivate *priv; - ModestWindowPrivate *parent_priv; priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE(obj); - parent_priv = MODEST_WINDOW_GET_PRIVATE(obj); priv->msg_view = GTK_WIDGET (tny_platform_factory_new_msg_view (modest_tny_platform_factory_get_instance ())); modest_msg_view_set_shadow_type (MODEST_MSG_VIEW (priv->msg_view), GTK_SHADOW_NONE); -- 1.7.9.5