Mobile/filtering: add fullTextNoNotes role to the dive list model

This way we can filter with and without the notes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2018-10-19 21:16:50 -04:00
parent 40536286d2
commit 17347f5110
2 changed files with 4 additions and 1 deletions

View file

@ -169,6 +169,7 @@ QVariant DiveListModel::data(const QModelIndex &index, int role) const
case DiveRole: return QVariant::fromValue<QObject*>(curr_dive);
case DiveDateRole: return (qlonglong)curr_dive->timestamp();
case FullTextRole: return curr_dive->fullText();
case FullTextNoNotesRole: return curr_dive->fullTextNoNotes();
}
return QVariant();
@ -180,6 +181,7 @@ QHash<int, QByteArray> DiveListModel::roleNames() const
roles[DiveRole] = "dive";
roles[DiveDateRole] = "date";
roles[FullTextRole] = "fulltext";
roles[FullTextNoNotesRole] = "fulltextnonotes";
return roles;
}

View file

@ -30,7 +30,8 @@ public:
enum DiveListRoles {
DiveRole = Qt::UserRole + 1,
DiveDateRole,
FullTextRole
FullTextRole,
FullTextNoNotesRole
};
static DiveListModel *instance();