1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-29 22:15:32 +00:00

make search sub-views re-usable (clear before starting a new search)

This commit is contained in:
Marc Zinnschlag 2015-03-28 12:53:01 +01:00
parent eaaf816dd3
commit 8e9365741f
5 changed files with 20 additions and 0 deletions

View file

@ -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();
}
}

View file

@ -34,6 +34,8 @@ namespace CSMTools
const CSMWorld::UniversalId& getUniversalId (int row) const;
std::string getHint (int row) const;
void clear();
};
}

View file

@ -134,3 +134,8 @@ void CSVTools::ReportTable::removeSelection()
selectionModel()->clear();
}
void CSVTools::ReportTable::clear()
{
mModel->clear();
}

View file

@ -43,6 +43,8 @@ namespace CSVTools
void updateUserSetting (const QString& name, const QStringList& list);
void clear();
private slots:
void showSelection();

View file

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