Browse Source

revert to double click to view details

tags/v5.1.2
guinux 2 years ago
parent
commit
e86ac4c3fd
2 changed files with 30 additions and 2 deletions
  1. +0
    -2
      resources/manager_window.ui
  2. +30
    -0
      src/user_daemon.vala

+ 0
- 2
resources/manager_window.ui View File

@@ -331,7 +331,6 @@
<property name="fixed_height_mode">True</property>
<property name="show_expanders">False</property>
<property name="rubber_banding">True</property>
<property name="activate_on_single_click">True</property>
<signal name="button-press-event" handler="on_packages_treeview_button_press_event" swapped="no"/>
<signal name="query-tooltip" handler="on_packages_treeview_query_tooltip" swapped="no"/>
<signal name="row-activated" handler="on_packages_treeview_row_activated" swapped="no"/>
@@ -457,7 +456,6 @@
<property name="fixed_height_mode">True</property>
<property name="show_expanders">False</property>
<property name="rubber_banding">True</property>
<property name="activate_on_single_click">True</property>
<signal name="button-press-event" handler="on_aur_treeview_button_press_event" swapped="no"/>
<signal name="query-tooltip" handler="on_aur_treeview_query_tooltip" swapped="no"/>
<signal name="row-activated" handler="on_aur_treeview_row_activated" swapped="no"/>


+ 30
- 0
src/user_daemon.vala View File

@@ -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<unowned Alpm.Package> appstream_results = null;
app_store.get_apps ().foreach ((app) => {
var iter = HashTableIter<string,string> (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<string,string> (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);


Loading…
Cancel
Save