mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 10:43:25 +00:00
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:
parent
e17fa41192
commit
30cf0ba79a
1 changed files with 18 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue