#include <stdlib.h>
#include <time.h>
-#include <gconf/gconf-client.h>
-
#include "dive.h"
#include "divelist.h"
-GConfClient *gconf;
struct units output_units;
-#define GCONF_NAME(x) "/apps/subsurface/" #x
-
/* random helper functions, used here or elsewhere */
static int sortfn(const void *_a, const void *_b)
{
}
}
+/*
+ * 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
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 */
for (i = 0; i < dive_table.nr; i++) {
struct dive *dive = dive_table.dives[i];
dive->number = nr + i;
+ flush_divelist(dive);
}
mark_divelist_changed(TRUE);
}
}
}
- report_dives(FALSE);
+ report_dives(imported);
run_ui();
return 0;