mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-07-08 13:21:35 +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;
|
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;
|
const CSMWorld::UniversalId& getUniversalId (int row) const;
|
||||||
|
|
||||||
std::string getHint (int row) const;
|
std::string getHint (int row) const;
|
||||||
|
|
||||||
|
void clear();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -134,3 +134,8 @@ void CSVTools::ReportTable::removeSelection()
|
||||||
|
|
||||||
selectionModel()->clear();
|
selectionModel()->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSVTools::ReportTable::clear()
|
||||||
|
{
|
||||||
|
mModel->clear();
|
||||||
|
}
|
||||||
|
|
|
@ -43,6 +43,8 @@ namespace CSVTools
|
||||||
|
|
||||||
void updateUserSetting (const QString& name, const QStringList& list);
|
void updateUserSetting (const QString& name, const QStringList& list);
|
||||||
|
|
||||||
|
void clear();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void showSelection();
|
void showSelection();
|
||||||
|
|
|
@ -54,5 +54,6 @@ void CSVTools::SearchSubView::stateChanged (int state, CSMDoc::Document *documen
|
||||||
|
|
||||||
void CSVTools::SearchSubView::startSearch (const CSMTools::Search& search)
|
void CSVTools::SearchSubView::startSearch (const CSMTools::Search& search)
|
||||||
{
|
{
|
||||||
|
mTable->clear();
|
||||||
mDocument.runSearch (getUniversalId(), search);
|
mDocument.runSearch (getUniversalId(), search);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue