mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Better invalid dive site name
This should ensure that no one ever might end up with our "invalid" name for real. And it allows us to more easily test elsewhere for that invalid value. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
c78e4fb92d
commit
2a4cacda21
2 changed files with 5 additions and 2 deletions
|
@ -63,6 +63,8 @@ void clear_dive_site(struct dive_site *ds);
|
|||
unsigned int get_distance(degrees_t lat1, degrees_t lon1, degrees_t lat2, degrees_t lon2);
|
||||
uint32_t find_or_create_dive_site_with_name(const char *name);
|
||||
|
||||
#define INVALID_DIVE_SITE_NAME "development use only - not a valid dive site name"
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -69,9 +69,10 @@ QVariant LocationInformationModel::data(const QModelIndex &index, int role) cons
|
|||
if (index.row() == 1) {
|
||||
struct dive_site *ds = get_dive_site_name_start_which_str(textField->text());
|
||||
if (!ds)
|
||||
return "NOT HERE";
|
||||
return INVALID_DIVE_SITE_NAME;
|
||||
if (QString(ds->name) == textField->text())
|
||||
return "NOT HERE";
|
||||
return INVALID_DIVE_SITE_NAME;
|
||||
|
||||
}
|
||||
return textField->text();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue