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

search
Marc Zinnschlag 10 years ago
parent eaaf816dd3
commit 8e9365741f

@ -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…
Cancel
Save