[balsa/gtk4: 218/314] main: Adapt to libinit-balsa API change




commit ec49c9eea10da6c77f7a4c17565be08ddde0cb3d
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Thu Oct 15 12:40:04 2020 -0400

    main: Adapt to libinit-balsa API change

 src/main.c | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)
---
diff --git a/src/main.c b/src/main.c
index 3fc45220d..711fdc384 100644
--- a/src/main.c
+++ b/src/main.c
@@ -143,13 +143,27 @@ check_special_mailboxes(void)
     return bomb;
 }
 
+static void
+config_finish(void)
+{
+    config_load();
+    config_defclient_save();
+    g_application_activate(G_APPLICATION(balsa_app.application));
+}
+
 static void
 config_init(void)
 {
-    while (!config_load()) {
-       balsa_init_begin();
+    if (config_load())
+        g_application_activate(G_APPLICATION(balsa_app.application));
+    else
+       balsa_init_begin(config_finish);
+}
+
+static void
+mailboxes_finish(void)
+{
         config_defclient_save();
-    }
 }
 
 static void
@@ -158,9 +172,7 @@ mailboxes_init(gboolean check_only)
     check_special_mailboxes();
     if (!balsa_app.inbox && !check_only) {
        g_warning("*** error loading mailboxes");
-       balsa_init_begin();
-        config_defclient_save();
-       return;
+       balsa_init_begin(mailboxes_finish);
     }
 }
 
@@ -754,7 +766,6 @@ balsa_command_line_cb(GApplication            * application,
     } else {
         /* checking for valid config files */
         config_init();
-        g_application_activate(application);
     }
 
     return 0;


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