Implemented the 'repopulate method' for BuddyFilter

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-10-31 16:28:51 -02:00 committed by Dirk Hohndel
parent e17fa41192
commit 30cf0ba79a

View file

@ -2375,6 +2375,24 @@ Qt::ItemFlags BuddyFilterModel::flags(const QModelIndex &index) const
void BuddyFilterModel::repopulate()
{
QStringList list;
struct dive *dive;
int i = 0;
for_each_dive (i, dive)
{
QString buddy(dive->buddy);
if (!list.contains(buddy)) {
list.append(buddy);
}
}
setStringList(list);
list << tr("No Buddies");
setStringList(list);
delete[] checkState;
checkState = new bool[list.count()];
memset(checkState, false, list.count());
checkState[list.count() - 1] = false;
anyChecked = false;
}
QVariant BuddyFilterModel::data(const QModelIndex &index, int role) const