mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Suits update method done.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
88d19bca6c
commit
bfdd94ddc3
1 changed files with 17 additions and 0 deletions
|
@ -87,6 +87,23 @@ bool SuitsFilterModel::filterRow(int source_row, const QModelIndex &source_paren
|
|||
|
||||
void SuitsFilterModel::repopulate()
|
||||
{
|
||||
QStringList list;
|
||||
struct dive *dive;
|
||||
int i = 0;
|
||||
for_each_dive (i, dive) {
|
||||
QString suit(dive->suit);
|
||||
if (!suit.isEmpty() && !list.contains(suit)) {
|
||||
list.append(suit);
|
||||
}
|
||||
}
|
||||
qSort(list);
|
||||
list << tr("No suit set");
|
||||
setStringList(list);
|
||||
delete[] checkState;
|
||||
checkState = new bool[list.count()];
|
||||
memset(checkState, false, list.count());
|
||||
checkState[list.count() - 1] = false;
|
||||
anyChecked = false;
|
||||
}
|
||||
|
||||
TagFilterModel::TagFilterModel(QObject *parent) : QStringListModel(parent)
|
||||
|
|
Loading…
Add table
Reference in a new issue