From 53b5e82411ca81fa110ffb0f1fc678b3cb4c4927 Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Thu, 20 Mar 2014 13:56:04 +0100 Subject: Do not use default dive filename before setting it Changeset ee2e43f introduced a small bug. The default dive file as set in the Prefences is not opened, requiring manual opening. This patch reshuffles a little code, allowing first the preferences being set, and than using it. Signed-off-by: Jan Mulder Signed-off-by: Dirk Hohndel --- main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index 2642ccc5c..c93121400 100644 --- a/main.cpp +++ b/main.cpp @@ -36,17 +36,17 @@ int main(int argc, char **argv) files.push_back(a); } } - if (no_filenames) { - QString defaultFile(prefs.default_filename); - if (!defaultFile.isEmpty()) - files.push_back(QString(prefs.default_filename)); - } setup_system_prefs(); prefs = default_prefs; fill_profile_color(); parse_xml_init(); taglist_init_global(); init_ui(); + if (no_filenames) { + QString defaultFile(prefs.default_filename); + if (!defaultFile.isEmpty()) + files.push_back(QString(prefs.default_filename)); + } MainWindow *m = MainWindow::instance(); m->setLoadedWithFiles(!files.isEmpty() || !importedFiles.isEmpty()); -- cgit v1.2.3-70-g09d2