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>
This commit is contained in:
Jan Mulder 2014-03-20 13:56:04 +01:00 committed by Dirk Hohndel
parent 2ca6009dfa
commit 53b5e82411

View file

@ -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());