]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Make the first filename on the command line the default filename
authorDirk Hohndel <dirk@hohndel.org>
Fri, 21 Oct 2011 13:12:04 +0000 (06:12 -0700)
committerDirk Hohndel <dirk@hohndel.org>
Fri, 21 Oct 2011 13:12:04 +0000 (06:12 -0700)
From a usecase point of view - if we call with multiple file names then
most likely it's

subsurface MyDives.xml new_dive1.xml new_dive2.xml

and therefore the existing "database" is the first filename, not the last
one (as the current implementation assumes).

Frankly, this is a bit arbitrary - but this one seems to make more sense.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
gtk-gui.c

index 351e7b9f4812d717cafc06e83b19e583c39877ef..b28ca2513b756c8cd020dca4e7046562c28b00d4 100644 (file)
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -989,7 +989,7 @@ void update_progressbar(progressbar_t *progress, double value)
 
 void set_filename(const char *filename)
 {
-       if (filename)
+       if (!existing_filename && filename)
                existing_filename = strdup(filename);
        return;
 }