diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-11-13 17:09:54 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-11-13 12:05:56 -0800 |
commit | bfdd94ddc3909ab015db5658a2391a58ce9ea84a (patch) | |
tree | ab8c22eb81a93775dcc2f105a456fa26dabe941e /qt-ui/filtermodels.cpp | |
parent | 88d19bca6cebfab88736e892b20c2da0fc67abcf (diff) | |
download | subsurface-bfdd94ddc3909ab015db5658a2391a58ce9ea84a.tar.gz |
Suits update method done.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/filtermodels.cpp')
-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) |