aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/exchange-operations/ChangeLog7
-rw-r--r--plugins/exchange-operations/exchange-calendar.c36
-rw-r--r--plugins/exchange-operations/exchange-contacts.c42
3 files changed, 49 insertions, 36 deletions
diff --git a/plugins/exchange-operations/ChangeLog b/plugins/exchange-operations/ChangeLog
index 4033d09874..12dd8dfd14 100644
--- a/plugins/exchange-operations/ChangeLog
+++ b/plugins/exchange-operations/ChangeLog
@@ -1,3 +1,10 @@
+2005-07-25 Sarfraaz Ahmed <asarfraaz@novell.com>
+
+ * exchange-calendar.c (e_exchange_calendar_pcalendar) : Add the size
+ label only if the calendar exists.
+ * exchange-contacts.c (e_exchange_contacts_pcontacts) : Add the size
+ label only if the addressbook exists.
+
2005-07-25 Shakti Sen <shprasad@novell.com>
* Makefile.am: Added EVOLUTION_CALENDAR_CFLAGS and widgets in 'INCLUDES'.
diff --git a/plugins/exchange-operations/exchange-calendar.c b/plugins/exchange-operations/exchange-calendar.c
index 8c9efa8af2..2562eea667 100644
--- a/plugins/exchange-operations/exchange-calendar.c
+++ b/plugins/exchange-operations/exchange-calendar.c
@@ -189,23 +189,26 @@ e_exchange_calendar_pcalendar (EPlugin *epl, EConfigHookItemFactoryData *data)
/* REVIEW: Should this handle be freed? - Attn: surf */
account = exchange_operations_get_exchange_account ();
account_name = account->account_name;
- cal_name = e_source_peek_name (source);
- model = exchange_account_folder_size_get_model (account);
- if (model)
- folder_size = g_strdup_printf ("%s KB", exchange_folder_size_get_val (model, cal_name));
- else
- folder_size = g_strdup ("0 KB");
-
- /* FIXME: Take care of i18n */
- lbl_size = gtk_label_new_with_mnemonic (_("Size:"));
- lbl_size_val = gtk_label_new_with_mnemonic (_(folder_size));
- gtk_widget_show (lbl_size);
- gtk_widget_show (lbl_size_val);
- gtk_misc_set_alignment (GTK_MISC (lbl_size), 0.0, 0.5);
- gtk_misc_set_alignment (GTK_MISC (lbl_size_val), 0.0, 0.5);
- gtk_table_attach (GTK_TABLE (parent), lbl_size, 0, 2, row, row+1, GTK_FILL|GTK_EXPAND, 0, 0, 0);
- gtk_table_attach (GTK_TABLE (parent), lbl_size_val, 1, 3, row, row+1, GTK_FILL|GTK_EXPAND, 0, 0, 0);
+ if (calendar_src_exists) {
+ cal_name = e_source_peek_name (source);
+ model = exchange_account_folder_size_get_model (account);
+ if (model)
+ folder_size = g_strdup_printf ("%s KB", exchange_folder_size_get_val (model, cal_name));
+ else
+ folder_size = g_strdup ("0 KB");
+
+ /* FIXME: Take care of i18n */
+ lbl_size = gtk_label_new_with_mnemonic (_("Size:"));
+ lbl_size_val = gtk_label_new_with_mnemonic (_(folder_size));
+ gtk_widget_show (lbl_size);
+ gtk_widget_show (lbl_size_val);
+ gtk_misc_set_alignment (GTK_MISC (lbl_size), 0.0, 0.5);
+ gtk_misc_set_alignment (GTK_MISC (lbl_size_val), 0.0, 0.5);
+ gtk_table_attach (GTK_TABLE (parent), lbl_size, 0, 2, row, row+1, GTK_FILL|GTK_EXPAND, 0, 0, 0);
+ gtk_table_attach (GTK_TABLE (parent), lbl_size_val, 1, 3, row, row+1, GTK_FILL|GTK_EXPAND, 0, 0, 0);
+ g_free (folder_size);
+ }
lbl_pcalendar = gtk_label_new_with_mnemonic (_("_Location:"));
gtk_widget_show (lbl_pcalendar);
gtk_misc_set_alignment (GTK_MISC (lbl_pcalendar), 0.0, 0.5);
@@ -263,7 +266,6 @@ e_exchange_calendar_pcalendar (EPlugin *epl, EConfigHookItemFactoryData *data)
}
g_ptr_array_free (callist, TRUE);
- g_free (folder_size);
return tv_pcalendar;
}
diff --git a/plugins/exchange-operations/exchange-contacts.c b/plugins/exchange-operations/exchange-contacts.c
index 3f2d5d3de2..a08df5798e 100644
--- a/plugins/exchange-operations/exchange-contacts.c
+++ b/plugins/exchange-operations/exchange-contacts.c
@@ -161,27 +161,32 @@ e_exchange_contacts_pcontacts (EPlugin *epl, EConfigHookItemFactoryData *data)
account = exchange_operations_get_exchange_account ();
account_name = account->account_name;
- abook_name = e_source_peek_name (source);
- model = exchange_account_folder_size_get_model (account);
- if (model)
- folder_size = g_strdup_printf ("%s KB", exchange_folder_size_get_val (model, abook_name));
- else
- folder_size = g_strdup_printf ("0 KB");
-
+ hbx_size = NULL;
+ if (contacts_src_exists) {
+ abook_name = e_source_peek_name (source);
+ model = exchange_account_folder_size_get_model (account);
+ if (model)
+ folder_size = g_strdup_printf ("%s KB", exchange_folder_size_get_val (model, abook_name));
+ else
+ folder_size = g_strdup_printf ("0 KB");
+
+ /* FIXME: Take care of i18n */
+ lbl_size = gtk_label_new_with_mnemonic (_("Size:"));
+ lbl_size_val = gtk_label_new_with_mnemonic (_(folder_size));
+ hbx_size = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_start (hbx_size, lbl_size, FALSE, TRUE, 0);
+ gtk_box_pack_start (hbx_size, lbl_size_val, FALSE, TRUE, 10);
+ gtk_widget_show (lbl_size);
+ gtk_widget_show (lbl_size_val);
+ gtk_misc_set_alignment (GTK_MISC (lbl_size), 0.0, 0.5);
+ gtk_misc_set_alignment (GTK_MISC (lbl_size_val), 0.0, 0.5);
+ g_free (folder_size);
+ }
vb_pcontacts = gtk_vbox_new (FALSE, 6);
gtk_container_add (GTK_CONTAINER (data->parent), vb_pcontacts);
- /* FIXME: Take care of i18n */
- lbl_size = gtk_label_new_with_mnemonic (_("Size:"));
- lbl_size_val = gtk_label_new_with_mnemonic (_(folder_size));
- hbx_size = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (hbx_size, lbl_size, FALSE, TRUE, 0);
- gtk_box_pack_start (hbx_size, lbl_size_val, FALSE, TRUE, 10);
- gtk_widget_show (lbl_size);
- gtk_widget_show (lbl_size_val);
- gtk_misc_set_alignment (GTK_MISC (lbl_size), 0.0, 0.5);
- gtk_misc_set_alignment (GTK_MISC (lbl_size_val), 0.0, 0.5);
- gtk_box_pack_start (GTK_BOX (vb_pcontacts), hbx_size, FALSE, FALSE, 0);
+ if (hbx_size)
+ gtk_box_pack_start (GTK_BOX (vb_pcontacts), hbx_size, FALSE, FALSE, 0);
lbl_pcontacts = gtk_label_new_with_mnemonic (_("_Location:"));
gtk_widget_show (lbl_pcontacts);
@@ -245,7 +250,6 @@ e_exchange_contacts_pcontacts (EPlugin *epl, EConfigHookItemFactoryData *data)
}
g_ptr_array_free (conlist, TRUE);
- g_free (folder_size);
return vb_pcontacts;
}