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:
Dirk Hohndel 2015-07-17 08:39:49 -07:00
parent c78e4fb92d
commit 2a4cacda21
2 changed files with 5 additions and 2 deletions

View file

@ -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();
}