diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2011-10-28 22:51:15 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2011-10-28 22:51:15 -0700 |
commit | 84f570beef789695f080f9109febcff384d98c50 (patch) | |
tree | 76178a64c014153cb1482ab0537d78ec88e61be5 | |
parent | bf7d70fe8b9b8c2a1f6d381ae000cb0d91e36961 (diff) | |
download | subsurface-84f570beef789695f080f9109febcff384d98c50.tar.gz |
Update the known locations / buddies / divemasters as user enters them
The code that allowed a user to start typing the name of a location, buddy
or divemaster and that would then offer completions has one flaw - it
doesn't add any new names that you enter to its store of names until you
save and restart the app. This patch fixes that.
When reading the code I also noted that the location_changed,
divemaster_changed, buddy_changed variables have become meaningless. They
are set to 1 and tested, but never changed. I wasn't sure if I should
remove the variables (as the code seems to work without them having any
impact), or if we should go back to actually tracking these changes to
prevent unnecessarily marking the divelist as changed.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | info.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -53,6 +53,7 @@ void flush_dive_info_changes(struct dive *dive) char *new_text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(location)); old_text = dive->location; dive->location = new_text; + add_location(new_text); if (text_changed(old_text,dive->location)) changed = 1; if (old_text) @@ -63,6 +64,7 @@ void flush_dive_info_changes(struct dive *dive) char *new_text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(divemaster)); old_text = dive->divemaster; dive->divemaster = new_text; + add_people(new_text); if (text_changed(old_text,dive->divemaster)) changed = 1; if (old_text) @@ -73,6 +75,7 @@ void flush_dive_info_changes(struct dive *dive) char *new_text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(buddy)); old_text = dive->buddy; dive->buddy = new_text; + add_people(new_text); if (text_changed(old_text,dive->buddy)) changed = 1; if (old_text) |