mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
improved message text in search results
This commit is contained in:
parent
705ee67265
commit
babefacbfa
2 changed files with 18 additions and 3 deletions
|
@ -24,7 +24,7 @@ void CSMTools::Search::searchTextCell (const CSMWorld::IdTableBase *model,
|
|||
while ((pos = text.indexOf (search, pos, Qt::CaseInsensitive))!=-1)
|
||||
{
|
||||
std::ostringstream message;
|
||||
message << text.mid (pos).toUtf8().data();
|
||||
message << getLocation (model, index, id) << text.mid (pos).toUtf8().data();
|
||||
|
||||
std::ostringstream hint;
|
||||
hint << "r: " << index.column() << " " << pos << " " << search.length();
|
||||
|
@ -49,7 +49,7 @@ void CSMTools::Search::searchRegExCell (const CSMWorld::IdTableBase *model,
|
|||
while ((pos = mRegExp.indexIn (text, pos))!=-1)
|
||||
{
|
||||
std::ostringstream message;
|
||||
message << text.mid (pos).toUtf8().data();
|
||||
message << getLocation (model, index, id) << text.mid (pos).toUtf8().data();
|
||||
|
||||
int length = mRegExp.matchedLength();
|
||||
|
||||
|
@ -76,7 +76,7 @@ void CSMTools::Search::searchRecordStateCell (const CSMWorld::IdTableBase *model
|
|||
CSMWorld::Columns::getEnums (CSMWorld::Columns::ColumnId_Modification);
|
||||
|
||||
std::ostringstream message;
|
||||
message << id.getId() << " " << states.at (data);
|
||||
message << getLocation (model, index, id) << states.at (data);
|
||||
|
||||
std::ostringstream hint;
|
||||
hint << "r: " << index.column();
|
||||
|
@ -85,6 +85,19 @@ void CSMTools::Search::searchRecordStateCell (const CSMWorld::IdTableBase *model
|
|||
}
|
||||
}
|
||||
|
||||
std::string CSMTools::Search::getLocation (const CSMWorld::IdTableBase *model, const QModelIndex& index, const CSMWorld::UniversalId& id) const
|
||||
{
|
||||
std::ostringstream stream;
|
||||
|
||||
stream
|
||||
<< id.getId()
|
||||
<< ", "
|
||||
<< model->headerData (index.column(), Qt::Horizontal).toString().toUtf8().data()
|
||||
<< ": ";
|
||||
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
CSMTools::Search::Search() : mType (Type_None) {}
|
||||
|
||||
CSMTools::Search::Search (Type type, const std::string& value)
|
||||
|
|
|
@ -56,6 +56,8 @@ namespace CSMTools
|
|||
const QModelIndex& index, const CSMWorld::UniversalId& id,
|
||||
CSMDoc::Messages& messages) const;
|
||||
|
||||
std::string getLocation (const CSMWorld::IdTableBase *model, const QModelIndex& index, const CSMWorld::UniversalId& id) const;
|
||||
|
||||
public:
|
||||
|
||||
Search();
|
||||
|
|
Loading…
Reference in a new issue