From c4ae0209c6b44ec22f31a3ab852bed162f879e69 Mon Sep 17 00:00:00 2001 From: David Sansome Date: Wed, 29 Aug 2012 20:53:24 +0100 Subject: [PATCH] Codereview comments from revision cd6b1a2d7ca7 --- src/playlist/playlistfilterparser.cpp | 6 +++--- src/playlist/playlistfilterparser.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/playlist/playlistfilterparser.cpp b/src/playlist/playlistfilterparser.cpp index ce95ce823..9ac94fd3a 100644 --- a/src/playlist/playlistfilterparser.cpp +++ b/src/playlist/playlistfilterparser.cpp @@ -183,13 +183,13 @@ class FilterColumnTerm : public FilterTree { class NotFilter : public FilterTree { public: explicit NotFilter(const FilterTree* inv) : child_(inv) {} - virtual ~NotFilter() { delete child_; } + virtual bool accept(int row, const QModelIndex& parent, const QAbstractItemModel* const model) const { return !child_->accept(row, parent, model); } virtual FilterType type() { return Not; } private: - const FilterTree* child_; + QScopedPointer child_; }; class OrFilter : public FilterTree { @@ -224,7 +224,7 @@ class AndFilter : public FilterTree { QList children_; }; -FilterParser::FilterParser(const QString& filter, const QMap< QString, int >& columns, QSet< int > exact_cols) +FilterParser::FilterParser(const QString& filter, const QMap& columns, const QSet& exact_cols) : filterstring_(filter), columns_(columns), exact_columns_(exact_cols) { } diff --git a/src/playlist/playlistfilterparser.h b/src/playlist/playlistfilterparser.h index 6c1288ed1..2deb80bb6 100644 --- a/src/playlist/playlistfilterparser.h +++ b/src/playlist/playlistfilterparser.h @@ -64,7 +64,7 @@ class NopFilter : public FilterTree { // col ::= "title" | "artist" | ... class FilterParser { public: - FilterParser(const QString& filter, const QMap& columns, QSet exact_cols); + FilterParser(const QString& filter, const QMap& columns, const QSet& exact_cols); FilterTree* parse();