Merge branch 'tree2' of git://git.hohndel.org/subsurface

Pull dive-trip grouping from Dirk Hohndel:
 "This turned into an updated pull request for the tree2 branch where I
  implemented the date based grouping - but is actually a very different
  topic: this adds the ability to edit multiple dives (and fixes some
  issues with the dive editing overall).  The reason for that is that it
  reuses some of the infrastructure that I implemented in the tree2
  branch for tracking the selected dives.  More details in the commit
  messages."

* 'tree2' of git://git.hohndel.org/subsurface:
  Switch from date based to dive trip based grouping
  Redo dive editing
  Fix selecting and unselecting summary items
  Apply sort functions to the correct model, don't select summary entries
  Maintain selected rows when switching between list model and tree model
  Create duplicate list model so sorting by columns works again
  Improve tree model implementation
  Allow date based grouping
This commit is contained in:
Linus Torvalds 2012-08-16 10:46:30 -07:00
commit 9b72217f79
8 changed files with 670 additions and 216 deletions

7
dive.h
View file

@ -228,6 +228,8 @@ struct event {
#define MAX_CYLINDERS (8)
#define MAX_WEIGHTSYSTEMS (4)
#define W_IDX_PRIMARY 0
#define W_IDX_SECONDARY 1
struct dive {
int number;
@ -284,7 +286,7 @@ extern int selected_dive;
static inline struct dive *get_dive(unsigned int nr)
{
if (nr >= dive_table.nr)
if (nr >= dive_table.nr || nr < 0)
return NULL;
return dive_table.dives[nr];
}
@ -301,7 +303,7 @@ extern xmlDoc *test_xslt_transforms(xmlDoc *doc);
extern void show_dive_info(struct dive *);
extern void show_dive_equipment(struct dive *);
extern void show_dive_equipment(struct dive *, int w_idx);
extern void show_dive_stats(struct dive *);
@ -349,6 +351,7 @@ extern void evn_foreach(void (*callback)(const char *, int *, void *), void *dat
extern int add_new_dive(struct dive *dive);
extern int edit_dive_info(struct dive *dive);
extern int edit_multi_dive_info(int nr, int *indices);
extern void dive_list_update_dives(void);
extern void flush_divelist(struct dive *dive);