summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorGravatar Amit Chaudhuri <amit.k.chaudhuri@gmail.com>2013-04-18 08:59:31 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-04-18 12:31:15 -0700
commit073be111f48507f027256c6ecd6f11b19a2a18fc (patch)
tree083a3851fc64eb7a0557ffe789ab8e6b19483f5e /main.c
parent115ee47bfc0aa8ca2b2bdaca047ccf595bbb7120 (diff)
downloadsubsurface-073be111f48507f027256c6ecd6f11b19a2a18fc.tar.gz
Delay Qt ui construction
The Qt ui will need to read the dive_table to populate widgets with dives. Gtk functionality in init_ui is required to parse the dives. Split init_ui to allow parsing to proceed and complete before Qt ui mainwindow constructor is called. Play with qDebug()'s printf style (Thiago!) Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/main.c b/main.c
index 3c0ea7381..bf3bc0851 100644
--- a/main.c
+++ b/main.c
@@ -335,7 +335,7 @@ int main(int argc, char **argv)
subsurface_command_line_init(&argc, &argv);
parse_xml_init();
- init_ui(&argc, &argv);
+ init_ui(&argc, &argv); /* the gtk stuff is needed for parsing below */
for (i = 1; i < argc; i++) {
const char *a = argv[i];
@@ -372,12 +372,13 @@ int main(int argc, char **argv)
report_dives(imported, FALSE);
if (dive_table.nr == 0)
show_dive_info(NULL);
- run_ui();
- exit_ui();
parse_xml_exit();
subsurface_command_line_exit(&argc, &argv);
+ init_qt_ui(&argc, &argv); /* qt bit delayed until dives are parsed */
+ run_ui();
+ exit_ui();
#ifdef DEBUGFILE
if (debugfile)
fclose(debugfile);