summarylogtreecommitdiffstats
path: root/ps-view-filter-by_all.patch
blob: e6ccf4a3ed79c4b2fbfb1c66ac57b7b0e8a1a502 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--- orig-096/src/core/view.h	2015-09-03 21:03:30.000000000 +0200
+++ rtorrent-0.9.6/src/core/view.h	2017-04-02 16:22:17.000000000 +0200
@@ -122,2 +122,3 @@
   void                filter();
+  void                filter_by(const torrent::Object& condition, base_type& result);
   void                filter_download(core::Download* download);
--- orig-096/src/core/view.cc	2015-09-03 21:03:30.000000000 +0200
+++ rtorrent-0.9.6/src/core/view.cc	2017-04-02 16:25:49.000000000 +0200
@@ -292,4 +296,16 @@
 }
 
+
+void
+View::filter_by(const torrent::Object& condition, View::base_type& result)
+{
+  // std::copy_if(begin_visible(), end_visible(), result.begin(), view_downloads_filter(condition));
+  view_downloads_filter matches = view_downloads_filter(condition);
+  for (iterator itr = begin_visible(); itr != end_visible(); ++itr)
+    if (matches(*itr))
+      result.push_back(*itr);
+}
+
+
 void
 View::filter_download(core::Download* download) {