From bfdd94ddc3909ab015db5658a2391a58ce9ea84a Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 13 Nov 2014 17:09:54 -0200 Subject: Suits update method done. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/filtermodels.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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) -- cgit v1.2.3-70-g09d2