From 94829f17066dcbbeb9f641a4870dd88aa916ba24 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 5 Oct 2016 20:07:53 +0200 Subject: A better resource filter api --- sinksh/syntax_modules/sink_count.cpp | 2 +- sinksh/syntax_modules/sink_list.cpp | 3 +-- sinksh/syntax_modules/sink_show.cpp | 2 +- sinksh/syntax_modules/sink_sync.cpp | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) (limited to 'sinksh') diff --git a/sinksh/syntax_modules/sink_count.cpp b/sinksh/syntax_modules/sink_count.cpp index fde7c33..7e04c79 100644 --- a/sinksh/syntax_modules/sink_count.cpp +++ b/sinksh/syntax_modules/sink_count.cpp @@ -51,7 +51,7 @@ bool count(const QStringList &args, State &state) Sink::Query query; for (const auto &res : resources) { - query.resources << res.toLatin1(); + query.resourceFilter(res.toLatin1()); } query.liveQuery = false; diff --git a/sinksh/syntax_modules/sink_list.cpp b/sinksh/syntax_modules/sink_list.cpp index 2d7ef5f..e176aab 100644 --- a/sinksh/syntax_modules/sink_list.cpp +++ b/sinksh/syntax_modules/sink_list.cpp @@ -59,8 +59,7 @@ bool list(const QStringList &args, State &state) auto filterIndex = args.indexOf("--filter"); if (filterIndex >= 0) { for (int i = 1; i < filterIndex; i++) { - query.resources << args.at(i).toLatin1(); - query.filter(Sink::ApplicationDomain::SinkResource(args.at(i).toLatin1())); + query.resourceFilter(args.at(i).toLatin1()); } for (int i = filterIndex + 1; i < args.size(); i++) { auto filter = args.at(i).split("="); diff --git a/sinksh/syntax_modules/sink_show.cpp b/sinksh/syntax_modules/sink_show.cpp index 5197e77..45fd62c 100644 --- a/sinksh/syntax_modules/sink_show.cpp +++ b/sinksh/syntax_modules/sink_show.cpp @@ -60,7 +60,7 @@ bool show(const QStringList &args, State &state) if (queryForResourceOrAgent) { query.filter(resource.toLatin1()); } else { - query.filter(Sink::ApplicationDomain::SinkResource(resource.toLatin1())); + query.resourceFilter(resource.toLatin1()); } query.liveQuery = false; diff --git a/sinksh/syntax_modules/sink_sync.cpp b/sinksh/syntax_modules/sink_sync.cpp index e3c51ff..1c7ed0f 100644 --- a/sinksh/syntax_modules/sink_sync.cpp +++ b/sinksh/syntax_modules/sink_sync.cpp @@ -41,7 +41,7 @@ bool sync(const QStringList &args, State &state) { Sink::Query query; for (const auto &res : args) { - query.resources << res.toLatin1(); + query.resourceFilter(res.toLatin1()); } QTimer::singleShot(0, [query, state]() { -- cgit v1.2.3