mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-04 01:26:39 +00:00 
			
		
		
		
	make search sub-views re-usable (clear before starting a new search)
This commit is contained in:
		
							parent
							
								
									eaaf816dd3
								
							
						
					
					
						commit
						8e9365741f
					
				
					 5 changed files with 20 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -79,3 +79,13 @@ std::string CSMTools::ReportModel::getHint (int row) const
 | 
			
		|||
{
 | 
			
		||||
    return mRows.at (row).second.second;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void CSMTools::ReportModel::clear()
 | 
			
		||||
{
 | 
			
		||||
    if (!mRows.empty())
 | 
			
		||||
    {
 | 
			
		||||
        beginRemoveRows (QModelIndex(), 0, mRows.size()-1);
 | 
			
		||||
        mRows.clear();
 | 
			
		||||
        endRemoveRows();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -34,6 +34,8 @@ namespace CSMTools
 | 
			
		|||
            const CSMWorld::UniversalId& getUniversalId (int row) const;
 | 
			
		||||
 | 
			
		||||
            std::string getHint (int row) const;
 | 
			
		||||
 | 
			
		||||
            void clear();
 | 
			
		||||
    };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -134,3 +134,8 @@ void CSVTools::ReportTable::removeSelection()
 | 
			
		|||
 | 
			
		||||
    selectionModel()->clear();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void CSVTools::ReportTable::clear()
 | 
			
		||||
{
 | 
			
		||||
    mModel->clear();
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -43,6 +43,8 @@ namespace CSVTools
 | 
			
		|||
 | 
			
		||||
            void updateUserSetting (const QString& name, const QStringList& list);
 | 
			
		||||
 | 
			
		||||
            void clear();
 | 
			
		||||
 | 
			
		||||
        private slots:
 | 
			
		||||
 | 
			
		||||
            void showSelection();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -54,5 +54,6 @@ void CSVTools::SearchSubView::stateChanged (int state, CSMDoc::Document *documen
 | 
			
		|||
 | 
			
		||||
void CSVTools::SearchSubView::startSearch (const CSMTools::Search& search)
 | 
			
		||||
{
 | 
			
		||||
    mTable->clear();
 | 
			
		||||
    mDocument.runSearch (getUniversalId(), search);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue