~unity-api-team/unity-scope-click/blacklist-apps

« back to all changes in this revision

Viewing changes to libclickscope/click/interface.cpp

  • Committer: Antti Kaijanmäki
  • Date: 2016-02-18 14:55:41 UTC
  • Revision ID: antti.kaijanmaki@canonical.com-20160218145541-s4u62c7xwcgmz4go
blacklist applications

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
#include <QStandardPaths>
34
34
#include <QTimer>
35
35
 
 
36
#include <algorithm>
36
37
#include <cstdio>
37
38
#include <list>
38
39
#include <sys/stat.h>
240
241
 */
241
242
std::vector<click::Application> Interface::find_installed_apps(const std::string& search_query,
242
243
        const std::string& current_department,
243
 
        const std::shared_ptr<click::DepartmentsDb>& depts_db)
 
244
        const std::shared_ptr<click::DepartmentsDb>& depts_db,
 
245
        const std::vector<std::string>& blacklist)
244
246
{
245
247
    //
246
248
    // only apply department filtering if not in root of all departments.
265
267
 
266
268
    bool include_desktop_results = show_desktop_apps();
267
269
 
268
 
    auto enumerator = [&result, this, search_query, current_department, packages_in_department, apply_department_filter, include_desktop_results, depts_db]
 
270
    auto enumerator = [&result, this, search_query, current_department, packages_in_department, apply_department_filter, include_desktop_results, depts_db, blacklist]
269
271
            (const unity::util::IniParser& keyFile, const std::string& filename)
270
272
    {
271
273
        if (keyFile.has_group(DESKTOP_FILE_GROUP) == false) {
340
342
                }
341
343
            }
342
344
 
 
345
            if (std::count(blacklist.begin(), blacklist.end(), app.get_app_name()) != 0) {
 
346
                return;
 
347
            }
 
348
 
343
349
            if (search_query.empty()) {
344
350
                result.push_back(app);
345
351
            } else {