From caa9693207e362cddb08085d987ce85982e381d5 Mon Sep 17 00:00:00 2001 From: Daniel Burrows Date: Mon, 6 Oct 2008 20:53:59 -0700 Subject: Switch everything over to the new search code. This loses a little functionality in some places. Searches that go item-by-item (e.g., curses "/") are broken for ?term matchers (and hence also bare strings), and searches that return string groups (e.g., "aptitude search" with a format pattern containing substring IDs, or the "pattern" grouping policy) don't work. But other than that, everything should work. --- src/pkg_grouppolicy.h | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'src/pkg_grouppolicy.h') diff --git a/src/pkg_grouppolicy.h b/src/pkg_grouppolicy.h index ac595604..70e38447 100644 --- a/src/pkg_grouppolicy.h +++ b/src/pkg_grouppolicy.h @@ -26,6 +26,8 @@ #include +#include + /** \brief Provides a flexible way to group and filter packages * * @@ -68,13 +70,6 @@ typedef sigc::signal2 desc_signal; class pkg_subtree; -namespace aptitude -{ - namespace matching - { - class pkg_matcher; - } -} class pkg_grouppolicy { @@ -194,9 +189,9 @@ class pkg_grouppolicy_filter_factory:public pkg_grouppolicy_factory { pkg_grouppolicy_factory *chain; - aptitude::matching::pkg_matcher *filter; + cwidget::util::ref_ptr filter; public: - pkg_grouppolicy_filter_factory(aptitude::matching::pkg_matcher *_filter, + pkg_grouppolicy_filter_factory(const cwidget::util::ref_ptr &_filter, pkg_grouppolicy_factory *_chain) :chain(_chain), filter(_filter) {} @@ -298,18 +293,18 @@ public: virtual ~pkg_grouppolicy_task_factory(); }; -/** \brief Groups packages using the given list of matchers/tree names. +/** \brief Groups packages using the given list of patterns/tree names. * * Match results can be substituted into tree names using \N * notation. Each branch of the tree can have its own policy chain; * if none is specified, the default chain will be used. */ -class pkg_grouppolicy_matchers_factory:public pkg_grouppolicy_factory +class pkg_grouppolicy_patterns_factory:public pkg_grouppolicy_factory { public: struct match_entry { - aptitude::matching::pkg_matcher *matcher; + cwidget::util::ref_ptr pattern; /** \brief A pointer to the specialized sub-factory for * this entry, or NULL to use the default chain. */ @@ -317,11 +312,11 @@ public: std::wstring tree_name; bool passthrough; - match_entry(aptitude::matching::pkg_matcher *_matcher, + match_entry(const cwidget::util::ref_ptr &_pattern, pkg_grouppolicy_factory *_chain, const std::wstring &_tree_name, bool _passthrough) - : matcher(_matcher), + : pattern(_pattern), chain(_chain), tree_name(_tree_name), passthrough(_passthrough) @@ -335,7 +330,7 @@ private: std::vector subgroups; public: - pkg_grouppolicy_matchers_factory(const std::vector &_subgroups, + pkg_grouppolicy_patterns_factory(const std::vector &_subgroups, pkg_grouppolicy_factory *_chain) :chain(_chain), subgroups(_subgroups) { @@ -344,7 +339,7 @@ public: pkg_grouppolicy *instantiate(pkg_signal *sig, desc_signal *_desc_sig); - ~pkg_grouppolicy_matchers_factory(); + ~pkg_grouppolicy_patterns_factory(); }; /** Groups packages by their tags within a single facet. */ -- cgit v1.2.3