From e86ac4c3fdcbef50404dc41dad4db6556c717f3a Mon Sep 17 00:00:00 2001 From: guinux Date: Thu, 21 Sep 2017 21:10:03 +0200 Subject: [PATCH] revert to double click to view details --- resources/manager_window.ui | 2 -- src/user_daemon.vala | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/resources/manager_window.ui b/resources/manager_window.ui index 256d5fb..35aed84 100644 --- a/resources/manager_window.ui +++ b/resources/manager_window.ui @@ -331,7 +331,6 @@ True False True - True @@ -457,7 +456,6 @@ True False True - True diff --git a/src/user_daemon.vala b/src/user_daemon.vala index 5a670cf..70e0ee1 100644 --- a/src/user_daemon.vala +++ b/src/user_daemon.vala @@ -504,6 +504,36 @@ namespace Pamac { syncdbs.next (); } result.join (syncpkgs.diff (result, (Alpm.List.CompareFunc) alpm_pkg_compare_name)); + // search in Appstream + Alpm.List appstream_results = null; + app_store.get_apps ().foreach ((app) => { + var iter = HashTableIter (app.get_names ()); + unowned string name; + while (iter.next (null, out name)) { + if (search_string in name) { + unowned Alpm.Package? alpm_pkg = alpm_handle.localdb.get_pkg (app.get_pkgname_default ()); + if (alpm_pkg == null) { + alpm_pkg = get_syncpkg (app.get_pkgname_default ()); + } + if (alpm_pkg != null) { + appstream_results.add (alpm_pkg); + } + } + } + iter = HashTableIter (app.get_descriptions ()); + unowned string desc; + while (iter.next (null, out desc)) { + if (search_string in desc) { + unowned Alpm.Package? alpm_pkg = alpm_handle.localdb.get_pkg (app.get_pkgname_default ()); + if (alpm_pkg == null) { + alpm_pkg = get_syncpkg (app.get_pkgname_default ()); + } + if (alpm_pkg != null) { + appstream_results.add (alpm_pkg); + } + } + } + }); // use custom sort function global_search_string = search_string; result.sort (result.length, (Alpm.List.CompareFunc) alpm_pkg_sort_search_by_relevance);