diff --git a/apps/opencs/model/filter/booleannode.cpp b/apps/opencs/model/filter/booleannode.cpp index 2f521ed06..267e06a64 100644 --- a/apps/opencs/model/filter/booleannode.cpp +++ b/apps/opencs/model/filter/booleannode.cpp @@ -4,9 +4,7 @@ CSMFilter::BooleanNode::BooleanNode (bool true_) : mTrue (true_) {} bool CSMFilter::BooleanNode::test (const CSMWorld::IdTable& table, int row, - const std::map& otherFilters, - const std::map& columns, - const std::string& userValue) const + const std::map& columns) const { return mTrue; } diff --git a/apps/opencs/model/filter/booleannode.hpp b/apps/opencs/model/filter/booleannode.hpp index 3578c7f3f..d19219e35 100644 --- a/apps/opencs/model/filter/booleannode.hpp +++ b/apps/opencs/model/filter/booleannode.hpp @@ -14,9 +14,7 @@ namespace CSMFilter BooleanNode (bool true_); virtual bool test (const CSMWorld::IdTable& table, int row, - const std::map& otherFilters, - const std::map& columns, - const std::string& userValue) const; + const std::map& columns) const; ///< \return Can the specified table row pass through to filter? /// \param columns column ID to column index mapping diff --git a/apps/opencs/model/filter/leafnode.cpp b/apps/opencs/model/filter/leafnode.cpp index 5c6d4b042..a1330f9dc 100644 --- a/apps/opencs/model/filter/leafnode.cpp +++ b/apps/opencs/model/filter/leafnode.cpp @@ -1,11 +1,6 @@ #include "leafnode.hpp" -std::vector CSMFilter::LeafNode::getReferencedFilters() const -{ - return std::vector(); -} - std::vector CSMFilter::LeafNode::getReferencedColumns() const { return std::vector(); @@ -15,8 +10,3 @@ bool CSMFilter::LeafNode::isSimple() const { return true; } - -bool CSMFilter::LeafNode::hasUserValue() const -{ - return false; -} \ No newline at end of file diff --git a/apps/opencs/model/filter/leafnode.hpp b/apps/opencs/model/filter/leafnode.hpp index 663083ff9..2b0163065 100644 --- a/apps/opencs/model/filter/leafnode.hpp +++ b/apps/opencs/model/filter/leafnode.hpp @@ -11,18 +11,12 @@ namespace CSMFilter { public: - virtual std::vector getReferencedFilters() const; - ///< Return a list of filters that are used by this node (and must be passed as - /// otherFilters when calling test). - virtual std::vector getReferencedColumns() const; ///< Return a list of the IDs of the columns referenced by this node. The column mapping /// passed into test as columns must contain all columns listed here. virtual bool isSimple() const; ///< \return Can this filter be displayed in simple mode. - - virtual bool hasUserValue() const; }; } diff --git a/apps/opencs/model/filter/narynode.cpp b/apps/opencs/model/filter/narynode.cpp index 0756f6707..cc131d8ac 100644 --- a/apps/opencs/model/filter/narynode.cpp +++ b/apps/opencs/model/filter/narynode.cpp @@ -15,21 +15,6 @@ const CSMFilter::Node& CSMFilter::NAryNode::operator[] (int index) const return *mNodes.at (index); } -std::vector CSMFilter::NAryNode::getReferencedFilters() const -{ - std::vector filters; - - for (std::vector >::const_iterator iter (mNodes.begin()); - iter!=mNodes.end(); ++iter) - { - std::vector filters2 = (*iter)->getReferencedFilters(); - - filters.insert (filters.end(), filters2.begin(), filters2.end()); - } - - return filters; -} - std::vector CSMFilter::NAryNode::getReferencedColumns() const { std::vector columns; @@ -50,12 +35,3 @@ bool CSMFilter::NAryNode::isSimple() const return false; } -bool CSMFilter::NAryNode::hasUserValue() const -{ - for (std::vector >::const_iterator iter (mNodes.begin()); - iter!=mNodes.end(); ++iter) - if ((*iter)->hasUserValue()) - return true; - - return false; -} diff --git a/apps/opencs/model/filter/narynode.hpp b/apps/opencs/model/filter/narynode.hpp index 65e12d1ed..5d8d5653b 100644 --- a/apps/opencs/model/filter/narynode.hpp +++ b/apps/opencs/model/filter/narynode.hpp @@ -21,10 +21,6 @@ namespace CSMFilter const Node& operator[] (int index) const; - virtual std::vector getReferencedFilters() const; - ///< Return a list of filters that are used by this node (and must be passed as - /// otherFilters when calling test). - virtual std::vector getReferencedColumns() const; ///< Return a list of the IDs of the columns referenced by this node. The column mapping /// passed into test as columns must contain all columns listed here. @@ -32,7 +28,6 @@ namespace CSMFilter virtual bool isSimple() const; ///< \return Can this filter be displayed in simple mode. - virtual bool hasUserValue() const; }; } diff --git a/apps/opencs/model/filter/node.hpp b/apps/opencs/model/filter/node.hpp index 9743034ba..6783c3b5e 100644 --- a/apps/opencs/model/filter/node.hpp +++ b/apps/opencs/model/filter/node.hpp @@ -33,16 +33,10 @@ namespace CSMFilter virtual ~Node(); virtual bool test (const CSMWorld::IdTable& table, int row, - const std::map& otherFilters, - const std::map& columns, - const std::string& userValue) const = 0; + const std::map& columns) const = 0; ///< \return Can the specified table row pass through to filter? /// \param columns column ID to column index mapping - virtual std::vector getReferencedFilters() const = 0; - ///< Return a list of filters that are used by this node (and must be passed as - /// otherFilters when calling test). - virtual std::vector getReferencedColumns() const = 0; ///< Return a list of the IDs of the columns referenced by this node. The column mapping /// passed into test as columns must contain all columns listed here. @@ -50,8 +44,6 @@ namespace CSMFilter virtual bool isSimple() const = 0; ///< \return Can this filter be displayed in simple mode. - virtual bool hasUserValue() const = 0; - virtual std::string toString (bool numericColumns) const = 0; ///< Return a string that represents this node. /// diff --git a/apps/opencs/model/filter/unarynode.cpp b/apps/opencs/model/filter/unarynode.cpp index 490d95376..d687b6468 100644 --- a/apps/opencs/model/filter/unarynode.cpp +++ b/apps/opencs/model/filter/unarynode.cpp @@ -13,11 +13,6 @@ CSMFilter::Node& CSMFilter::UnaryNode::getChild() return *mChild; } -std::vector CSMFilter::UnaryNode::getReferencedFilters() const -{ - return mChild->getReferencedFilters(); -} - std::vector CSMFilter::UnaryNode::getReferencedColumns() const { return mChild->getReferencedColumns(); @@ -28,7 +23,3 @@ bool CSMFilter::UnaryNode::isSimple() const return false; } -bool CSMFilter::UnaryNode::hasUserValue() const -{ - return mChild->hasUserValue(); -} diff --git a/apps/opencs/model/filter/unarynode.hpp b/apps/opencs/model/filter/unarynode.hpp index 4e1fb0cc2..6483a730f 100644 --- a/apps/opencs/model/filter/unarynode.hpp +++ b/apps/opencs/model/filter/unarynode.hpp @@ -19,10 +19,6 @@ namespace CSMFilter Node& getChild(); - virtual std::vector getReferencedFilters() const; - ///< Return a list of filters that are used by this node (and must be passed as - /// otherFilters when calling test). - virtual std::vector getReferencedColumns() const; ///< Return a list of the IDs of the columns referenced by this node. The column mapping /// passed into test as columns must contain all columns listed here. @@ -30,7 +26,6 @@ namespace CSMFilter virtual bool isSimple() const; ///< \return Can this filter be displayed in simple mode. - virtual bool hasUserValue() const; }; } diff --git a/apps/opencs/model/world/idtableproxymodel.cpp b/apps/opencs/model/world/idtableproxymodel.cpp index 4bb440ce7..2b757adfe 100644 --- a/apps/opencs/model/world/idtableproxymodel.cpp +++ b/apps/opencs/model/world/idtableproxymodel.cpp @@ -27,10 +27,8 @@ bool CSMWorld::IdTableProxyModel::filterAcceptsRow (int sourceRow, const QModelI if (!mFilter) return true; - std::map otherFilters; /// \todo get other filters; - return mFilter->test ( - dynamic_cast (*sourceModel()), sourceRow, otherFilters, mColumnMap, mUserValue); + dynamic_cast (*sourceModel()), sourceRow, mColumnMap); } CSMWorld::IdTableProxyModel::IdTableProxyModel (QObject *parent) @@ -42,11 +40,9 @@ QModelIndex CSMWorld::IdTableProxyModel::getModelIndex (const std::string& id, i return mapFromSource (dynamic_cast (*sourceModel()).getModelIndex (id, column)); } -void CSMWorld::IdTableProxyModel::setFilter (const boost::shared_ptr& filter, - const std::string& userValue) +void CSMWorld::IdTableProxyModel::setFilter (const boost::shared_ptr& filter) { mFilter = filter; - mUserValue = userValue; updateColumnMap(); invalidateFilter(); } \ No newline at end of file diff --git a/apps/opencs/model/world/idtableproxymodel.hpp b/apps/opencs/model/world/idtableproxymodel.hpp index 40bf6d4d9..b63dccd5e 100644 --- a/apps/opencs/model/world/idtableproxymodel.hpp +++ b/apps/opencs/model/world/idtableproxymodel.hpp @@ -18,7 +18,6 @@ namespace CSMWorld Q_OBJECT boost::shared_ptr mFilter; - std::string mUserValue; std::map mColumnMap; // column ID, column index in this model (or -1) private: @@ -33,8 +32,7 @@ namespace CSMWorld virtual QModelIndex getModelIndex (const std::string& id, int column) const; - void setFilter (const boost::shared_ptr& filter, - const std::string& userValue); + void setFilter (const boost::shared_ptr& filter); }; } diff --git a/apps/opencs/view/world/table.cpp b/apps/opencs/view/world/table.cpp index cc84e612d..75cbddc2a 100644 --- a/apps/opencs/view/world/table.cpp +++ b/apps/opencs/view/world/table.cpp @@ -294,8 +294,7 @@ void CSVWorld::Table::requestFocus (const std::string& id) scrollTo (index, QAbstractItemView::PositionAtTop); } -void CSVWorld::Table::recordFilterChanged (boost::shared_ptr filter, - const std::string& userValue) +void CSVWorld::Table::recordFilterChanged (boost::shared_ptr filter) { - mProxyModel->setFilter (filter, userValue); + mProxyModel->setFilter (filter); } \ No newline at end of file diff --git a/apps/opencs/view/world/table.hpp b/apps/opencs/view/world/table.hpp index 2e24e46a5..d93109056 100644 --- a/apps/opencs/view/world/table.hpp +++ b/apps/opencs/view/world/table.hpp @@ -87,8 +87,7 @@ namespace CSVWorld void requestFocus (const std::string& id); - void recordFilterChanged (boost::shared_ptr filter, - const std::string& userValue); + void recordFilterChanged (boost::shared_ptr filter); }; }