[balsa/gtk3] Select first command-line mailbox



commit 5d3d6083f00fb6b60be677fb3d5dd2f63d9c0b77
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sat Oct 22 17:06:51 2011 -0400

    Select first command-line mailbox
    
    	* src/balsa-app.c (open_mailboxes_idle_cb): select first
    	command-line mailbox; see discussion at
    	http://mail.gnome.org/archives/balsa-list/2011-October/msg00010.html

 ChangeLog       |    6 ++++++
 src/balsa-app.c |   36 ++++++++++++++++++++----------------
 2 files changed, 26 insertions(+), 16 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f8e1ce6..1c1b70f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-10-22  Peter Bloomfield
+
+	* src/balsa-app.c (open_mailboxes_idle_cb): select first
+	command-line mailbox; see discussion at
+	http://mail.gnome.org/archives/balsa-list/2011-October/msg00010.html
+
 2011-10-21  Peter Bloomfield
 
 	* src/main-window.c: when network is connected, check mail in
diff --git a/src/balsa-app.c b/src/balsa-app.c
index 355a74d..bab3bb0 100644
--- a/src/balsa-app.c
+++ b/src/balsa-app.c
@@ -532,34 +532,38 @@ open_mailboxes_idle_cb(gchar ** urls)
 
     gdk_threads_enter();
 
-    if (!urls) {
-        GPtrArray *array;
+    if (urls) {
+        gboolean hidden;
 
-        if (!libbalsa_mailbox_view_table) {
-            gdk_threads_leave();
-            return FALSE;
+        hidden = FALSE;
+        for (tmp = urls; *tmp; ++tmp) {
+            open_mailbox_by_url(*tmp, hidden);
+            hidden = TRUE;
         }
+    } else if (libbalsa_mailbox_view_table) {
+        GPtrArray *array;
 
         array = g_ptr_array_new();
         g_hash_table_foreach(libbalsa_mailbox_view_table,
                              (GHFunc) append_url_if_open, array);
         g_ptr_array_add(array, NULL);
         urls = (gchar **) g_ptr_array_free(array, FALSE);
-    }
-
-    if (urls) {
-        if (*urls) {
-            open_mailbox_by_url(balsa_app.current_mailbox_url, FALSE);
 
-            for (tmp = urls; *tmp; ++tmp)
-                if (!balsa_app.current_mailbox_url
-                    || strcmp(*tmp, balsa_app.current_mailbox_url))
-                    open_mailbox_by_url(*tmp, TRUE);
+        if (urls) {
+            if (*urls) {
+                open_mailbox_by_url(balsa_app.current_mailbox_url, TRUE);
+
+                for (tmp = urls; *tmp; ++tmp) {
+                    if (!balsa_app.current_mailbox_url
+                        || strcmp(*tmp, balsa_app.current_mailbox_url)) {
+                        open_mailbox_by_url(*tmp, TRUE);
+                    }
+                }
+            }
         }
-
-        g_strfreev(urls);
     }
 
+    g_strfreev(urls);
     gdk_threads_leave();
 
     return FALSE;



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