aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-12-31 21:39:29 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-12-31 21:39:29 +0800
commit2c9b8c191d7ccf82c4d0c6df4c5acbe11cfa8701 (patch)
tree08c1fc050ed0159dc61219a27af9c86f4556789c /mail
parente3735c74444e3fdc35d1677c3cdf68dfc174ce10 (diff)
downloadgsoc2013-evolution-2c9b8c191d7ccf82c4d0c6df4c5acbe11cfa8701.tar
gsoc2013-evolution-2c9b8c191d7ccf82c4d0c6df4c5acbe11cfa8701.tar.gz
gsoc2013-evolution-2c9b8c191d7ccf82c4d0c6df4c5acbe11cfa8701.tar.bz2
gsoc2013-evolution-2c9b8c191d7ccf82c4d0c6df4c5acbe11cfa8701.tar.lz
gsoc2013-evolution-2c9b8c191d7ccf82c4d0c6df4c5acbe11cfa8701.tar.xz
gsoc2013-evolution-2c9b8c191d7ccf82c4d0c6df4c5acbe11cfa8701.tar.zst
gsoc2013-evolution-2c9b8c191d7ccf82c4d0c6df4c5acbe11cfa8701.zip
EMailAccountStore: Avoid a bogus runtime warning.
If the number of SortOrder items in sortorder.ini disagrees with the number of services in the EMailAccountStore, silently revert to the default ordering rather than emitting a runtime warning.
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-account-store.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/mail/e-mail-account-store.c b/mail/e-mail-account-store.c
index 824a521ee9..e0bd90ea3f 100644
--- a/mail/e-mail-account-store.c
+++ b/mail/e-mail-account-store.c
@@ -1267,7 +1267,6 @@ e_mail_account_store_reorder_services (EMailAccountStore *store,
gint *new_order;
gint n_children;
gint new_pos = 0;
- guint length;
g_return_if_fail (E_IS_MAIL_ACCOUNT_STORE (store));
@@ -1278,13 +1277,15 @@ e_mail_account_store_reorder_services (EMailAccountStore *store,
if (ordered_services != NULL && g_queue_is_empty (ordered_services))
ordered_services = NULL;
- use_default_order = (ordered_services == NULL);
-
+ /* If the length of the custom ordering disagrees with the
+ * number of rows in the store, revert to default ordering. */
if (ordered_services != NULL) {
- length = g_queue_get_length (ordered_services);
- g_return_if_fail (length == n_children);
+ if (g_queue_get_length (ordered_services) != n_children)
+ ordered_services = NULL;
}
+ use_default_order = (ordered_services == NULL);
+
/* Build a queue of CamelServices in the order they appear in
* the list store. We'll use this to construct the mapping to
* pass to gtk_list_store_reorder(). */