summaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@planet.nl>2014-03-20 13:56:04 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-03-20 09:53:39 -0700
commit53b5e82411ca81fa110ffb0f1fc678b3cb4c4927 (patch)
tree5db4f273ff8b8efce127d4711b03141ebaf5ca73 /main.cpp
parent2ca6009dfa85d2eedfad633124505719d6a3a9c0 (diff)
downloadsubsurface-53b5e82411ca81fa110ffb0f1fc678b3cb4c4927.tar.gz
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 <jlmulder@planet.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp10
1 files 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());