diff options
-rw-r--r-- | qt-ui/filtermodels.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/qt-ui/filtermodels.cpp b/qt-ui/filtermodels.cpp index da123799f..6c80ca55f 100644 --- a/qt-ui/filtermodels.cpp +++ b/qt-ui/filtermodels.cpp @@ -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) |