add 'd.multicall.filtered' command

This commit is contained in:
pyroscope
2018-06-15 00:40:00 +02:00
parent 6c278668e4
commit 885836f68b
3 changed files with 48 additions and 0 deletions
+10
View File
@@ -295,6 +295,16 @@ View::filter() {
emit_changed();
}
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) {
iterator itr = std::find(base_type::begin(), base_type::end(), download);