mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix import tracking
Minor logical flaw that breaks the model. When the --import parameter is found we need to mark that the FOLLOWING dives are imported, not the ones loaded so far. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
dbdd42b31f
commit
6231b64d3d
1 changed files with 8 additions and 2 deletions
10
main.c
10
main.c
|
@ -97,6 +97,11 @@ static void try_to_renumber(struct dive *last, int preexisting)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* track whether we switched to importing dives
|
||||
*/
|
||||
static gboolean imported = FALSE;
|
||||
|
||||
/*
|
||||
* This doesn't really report anything at all. We just sort the
|
||||
* dives, the GUI does the reporting
|
||||
|
@ -162,7 +167,8 @@ static void parse_argument(const char *arg)
|
|||
if (strcmp(arg,"--import") == 0) {
|
||||
/* mark the dives so far as the base,
|
||||
* everything after is imported */
|
||||
report_dives(TRUE);
|
||||
report_dives(FALSE);
|
||||
imported = TRUE;
|
||||
return;
|
||||
}
|
||||
/* fallthrough */
|
||||
|
@ -229,7 +235,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
|
||||
report_dives(FALSE);
|
||||
report_dives(imported);
|
||||
|
||||
run_ui();
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue