summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-21 21:00:06 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-22 20:14:34 -0800
commit50aa6d1afa38a3d71d9d699fbf9635aed34a6c14 (patch)
tree5263825db515693a307f6d5ff2e79014ef9cc14d /main.c
parent8d2abc05f60cb9a5ec79db9a215fe8aa97e0c311 (diff)
downloadsubsurface-50aa6d1afa38a3d71d9d699fbf9635aed34a6c14.tar.gz
Imrpove the nickname handling
We now store the model information together with the deviceid and nickname in order to be able to check if we have a record for any dive computer with the same model (as that now triggers our nickname dialog). This changes the format of the config entries for nicknames - the best solution might be to just delete those and start again. What is still missing is the code to store the nicknames in the XML file. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'main.c')
-rw-r--r--main.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/main.c b/main.c
index 465cded78..c5a41590d 100644
--- a/main.c
+++ b/main.c
@@ -129,6 +129,10 @@ void report_dives(gboolean is_imported, gboolean prefer_imported)
* first one */
if (preexisting < dive_table.nr && dive_table.dives[preexisting]->downloaded)
set_dc_nickname(dive_table.dives[preexisting]);
+ else
+ /* they aren't downloaded, so record / check all new ones */
+ for (i = preexisting; i < dive_table.nr; i++)
+ set_dc_nickname(dive_table.dives[i]);
/* This does the right thing for -1: NULL */
last = get_dive(preexisting-1);
@@ -251,11 +255,6 @@ int main(int argc, char **argv)
textdomain("subsurface");
output_units = SI_units;
- subsurface_command_line_init(&argc, &argv);
- parse_xml_init();
-
- init_ui(&argc, &argv);
-
#if DEBUGFILE > 1
debugfile = stderr;
#elif defined(DEBUGFILE)
@@ -265,6 +264,12 @@ int main(int argc, char **argv)
(debugfile = g_fopen(debugfilename, "w")) == NULL)
printf("oh boy, can't create debugfile");
#endif
+
+ subsurface_command_line_init(&argc, &argv);
+ parse_xml_init();
+
+ init_ui(&argc, &argv);
+
for (i = 1; i < argc; i++) {
const char *a = argv[i];