[balsa] balsa-index: cleanup



commit 109364db0d90159f26a723d480ac0b4ecd821844
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Mon Jan 13 15:50:18 2020 -0500

    balsa-index: cleanup
    
    Do not expand threads if threading is flat.
    On errors, show the widget anyway.

 src/balsa-index.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/balsa-index.c b/src/balsa-index.c
index 402fd48cd..3c6d97fca 100644
--- a/src/balsa-index.c
+++ b/src/balsa-index.c
@@ -824,7 +824,9 @@ bndx_scroll_on_open_idle(BalsaIndex *bindex)
     if (!libbalsa_mailbox_get_messages_threaded(mailbox))
         return TRUE; /* G_SOURCE_CONTINUE */
 
-    if (balsa_app.expand_tree && !bindex->expanded) {
+    if (balsa_app.expand_tree &&
+        libbalsa_mailbox_get_threading_type(mailbox) != LB_MAILBOX_THREADING_FLAT &&
+        !bindex->expanded) {
         gtk_tree_view_expand_all(tree_view);
         bindex->expanded = TRUE;
         return TRUE; /* G_SOURCE_CONTINUE */
@@ -838,8 +840,10 @@ bndx_scroll_on_open_idle(BalsaIndex *bindex)
     if (first_unread > 0) {
        unsigned msgno = first_unread;
         libbalsa_mailbox_set_first_unread(mailbox, 0);
-        if (!libbalsa_mailbox_msgno_find(mailbox, msgno, &path, NULL))
+        if (!libbalsa_mailbox_msgno_find(mailbox, msgno, &path, NULL)) {
+            gtk_widget_show(GTK_WIDGET(bindex));
             return FALSE; /* Oops! */
+        }
     } else {
         /* we want to scroll to the last one in current order. The
            alternative which is to scroll to the most recently
@@ -847,8 +851,10 @@ bndx_scroll_on_open_idle(BalsaIndex *bindex)
            used */
         gint n_children =
             gtk_tree_model_iter_n_children(GTK_TREE_MODEL(mailbox), NULL);
-        if (n_children == 0)
+        if (n_children == 0) {
+            gtk_widget_show(GTK_WIDGET(bindex));
             return FALSE;
+        }
         path = gtk_tree_path_new_from_indices(n_children - 1, -1);
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]