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:
Tomaz Canabrava 2014-11-13 17:09:54 -02:00 committed by Dirk Hohndel
parent 88d19bca6c
commit bfdd94ddc3

View file

@ -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)