From 128ccd81510ab7c216162672801fce24ef9602e1 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sat, 28 Mar 2015 11:54:32 +0100 Subject: [PATCH] improved search type naming --- apps/opencs/model/tools/search.cpp | 12 ++++++------ apps/opencs/model/tools/search.hpp | 4 ++-- apps/opencs/view/tools/searchbox.cpp | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/apps/opencs/model/tools/search.cpp b/apps/opencs/model/tools/search.cpp index 9e22f82dd..b873088de 100644 --- a/apps/opencs/model/tools/search.cpp +++ b/apps/opencs/model/tools/search.cpp @@ -103,14 +103,14 @@ CSMTools::Search::Search() : mType (Type_None) {} CSMTools::Search::Search (Type type, const std::string& value) : mType (type), mText (value) { - if (type!=Type_Text && type!=Type_Reference) + if (type!=Type_Text && type!=Type_Id) throw std::logic_error ("Invalid search parameter (string)"); } CSMTools::Search::Search (Type type, const QRegExp& value) : mType (type), mRegExp (value) { - if (type!=Type_TextRegEx && type!=Type_ReferenceRegEx) + if (type!=Type_TextRegEx && type!=Type_IdRegEx) throw std::logic_error ("Invalid search parameter (RegExp)"); } @@ -150,8 +150,8 @@ void CSMTools::Search::configure (const CSMWorld::IdTableBase *model) break; - case Type_Reference: - case Type_ReferenceRegEx: + case Type_Id: + case Type_IdRegEx: if (CSMWorld::ColumnBase::isId (display)) { @@ -202,13 +202,13 @@ void CSMTools::Search::searchRow (const CSMWorld::IdTableBase *model, int row, switch (mType) { case Type_Text: - case Type_Reference: + case Type_Id: searchTextCell (model, index, id, iter->second, messages); break; case Type_TextRegEx: - case Type_ReferenceRegEx: + case Type_IdRegEx: searchRegExCell (model, index, id, iter->second, messages); break; diff --git a/apps/opencs/model/tools/search.hpp b/apps/opencs/model/tools/search.hpp index 7e95a2846..46ea99686 100644 --- a/apps/opencs/model/tools/search.hpp +++ b/apps/opencs/model/tools/search.hpp @@ -30,8 +30,8 @@ namespace CSMTools { Type_Text = 0, Type_TextRegEx = 1, - Type_Reference = 2, - Type_ReferenceRegEx = 3, + Type_Id = 2, + Type_IdRegEx = 3, Type_RecordState = 4, Type_None }; diff --git a/apps/opencs/view/tools/searchbox.cpp b/apps/opencs/view/tools/searchbox.cpp index 1b11d8a4d..bfae6f50d 100644 --- a/apps/opencs/view/tools/searchbox.cpp +++ b/apps/opencs/view/tools/searchbox.cpp @@ -50,8 +50,8 @@ CSVTools::SearchBox::SearchBox (QWidget *parent) mMode.addItem ("Text"); mMode.addItem ("Text (RegEx)"); - mMode.addItem ("Reference"); - mMode.addItem ("Reference (RegEx)"); + mMode.addItem ("ID"); + mMode.addItem ("ID (RegEx)"); mMode.addItem ("Record State"); mLayout->addWidget (&mMode, 0, 0); @@ -93,12 +93,12 @@ CSMTools::Search CSVTools::SearchBox::getSearch() const switch (type) { case CSMTools::Search::Type_Text: - case CSMTools::Search::Type_Reference: + case CSMTools::Search::Type_Id: return CSMTools::Search (type, std::string (mText.text().toUtf8().data())); case CSMTools::Search::Type_TextRegEx: - case CSMTools::Search::Type_ReferenceRegEx: + case CSMTools::Search::Type_IdRegEx: return CSMTools::Search (type, QRegExp (mText.text().toUtf8().data(), Qt::CaseInsensitive)); @@ -120,8 +120,8 @@ void CSVTools::SearchBox::modeSelected (int index) { case CSMTools::Search::Type_Text: case CSMTools::Search::Type_TextRegEx: - case CSMTools::Search::Type_Reference: - case CSMTools::Search::Type_ReferenceRegEx: + case CSMTools::Search::Type_Id: + case CSMTools::Search::Type_IdRegEx: mInput.setCurrentIndex (0); break;