summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-09-09 09:06:44 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-09-09 17:38:01 -0700
commitb73f29fea3ae88a06d8f773a6d48510520c127f0 (patch)
treed04166fd6e2fde7d716fe69cbfe35330e79cd1b9 /main.c
parentb6812946319080699f6071656f09d402d23d3e46 (diff)
downloadsubsurface-b73f29fea3ae88a06d8f773a6d48510520c127f0.tar.gz
First cut of adding a default file name
The default file name is OS specific and tries to follow the customs on each of the OSs. It can be configured through the preferences dialog. On MacOS we get a strange warning which appears to be a well documented Gtk bug on MacOS. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'main.c')
-rw-r--r--main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/main.c b/main.c
index 2489473b9..a2c24ec99 100644
--- a/main.c
+++ b/main.c
@@ -211,6 +211,7 @@ void renumber_dives(int nr)
int main(int argc, char **argv)
{
int i;
+ gboolean no_filenames = TRUE;
output_units = SI_units;
@@ -225,6 +226,7 @@ int main(int argc, char **argv)
parse_argument(a);
continue;
}
+ no_filenames = FALSE;
GError *error = NULL;
parse_file(a, &error);
@@ -235,7 +237,14 @@ int main(int argc, char **argv)
error = NULL;
}
}
-
+ if (no_filenames) {
+ GError *error = NULL;
+ const char *filename = subsurface_default_filename();
+ parse_file(filename, &error);
+ /* don't report errors - this file may not exist, but make
+ sure we remember this as the filename in use */
+ set_filename(filename);
+ }
report_dives(imported);
run_ui();