mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Repopulate method on LocationFilter
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									1a4e69a3bb
								
							
						
					
					
						commit
						8399d6f977
					
				
					 1 changed files with 18 additions and 1 deletions
				
			
		|  | @ -2498,7 +2498,24 @@ LocationFilterModel *LocationFilterModel::instance() | |||
| 
 | ||||
| void LocationFilterModel::repopulate() | ||||
| { | ||||
| 
 | ||||
| 	QStringList list; | ||||
| 	struct dive *dive; | ||||
| 	int i = 0; | ||||
| 	for_each_dive (i, dive) | ||||
| 	{ | ||||
| 		QString location(dive->location); | ||||
| 		if (!location.isEmpty() && !list.contains(location)) { | ||||
| 			list.append(location); | ||||
| 		} | ||||
| 	} | ||||
| 	qSort(list); | ||||
| 	list << tr("No Location set"); | ||||
| 	setStringList(list); | ||||
| 	delete[] checkState; | ||||
| 	checkState = new bool[list.count()]; | ||||
| 	memset(checkState, false, list.count()); | ||||
| 	checkState[list.count() - 1] = false; | ||||
| 	anyChecked = false; | ||||
| } | ||||
| 
 | ||||
| bool LocationFilterModel::setData(const QModelIndex &index, const QVariant &value, int role) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue