114
|
|
|
Florian Boucault |
|
13 years ago
|
|
|
113
|
|
|
Mikkel Kamstrup Erla... |
0.2.26 |
13 years ago
|
|
|
112
|
|
|
Mikkel Kamstrup Erla... |
|
13 years ago
|
|
|
111
|
|
|
Mikkel Kamstrup Erla... |
|
13 years ago
|
|
|
110
|
|
|
Mikkel Kamstrup Erla... |
0.2.24 |
13 years ago
|
|
|
109
|
|
|
Mikkel Kamstrup Erla... |
|
13 years ago
|
|
|
108
|
|
|
Mikkel Kamstrup Erla... |
|
13 years ago
|
|
|
107
|
|
|
Mikkel Kamstrup Erla... |
|
13 years ago
|
|
|
106
|
|
|
Mikkel Kamstrup Erla... |
0.2.22 |
13 years ago
|
|
|
105
|
|
|
Mikkel Kamstrup Erla... |
|
13 years ago
|
|
|
104
|
|
|
Mikkel Kamstrup Erla... |
|
13 years ago
|
|
|
103
|
|
|
Mikkel Kamstrup Erla... |
|
13 years ago
|
|
|
102
|
|
|
Mikkel Kamstrup Erla... |
|
13 years ago
|
|
|
101
|
|
|
Mikkel Kamstrup Erla... |
|
13 years ago
|
|
|
100
|
|
|
Mikkel Kamstrup Erla... |
|
13 years ago
|
|
|
99
|
|
|
Mikkel Kamstrup Erla... |
|
13 years ago
|
|
|
98
|
|
|
Mikkel Kamstrup Erla... |
0.2.20 |
13 years ago
|
|
|
97
|
|
|
Mikkel Kamstrup Erla... |
|
13 years ago
|
|
|
96
|
|
|
Mikkel Kamstrup Erla... |
|
13 years ago
|
|
|
95
|
|
Too aggresive de-duplication of results could cause unique apps to be pruned from the results. This was especially visible when typing slowly.
Note: There still is another bug in the Unity rendering that causes some apps which are in the DeeModel to not be rendered. This is bug #609994: "Optimize texture memory usage for unexposed view icons"
--------- This line and the following will be ignored --------------
modified: src/daemon.vala src/utils.vala unknown: applications.place log1.bustle unity-place-applications-0.2.15.tar.gz data/X-Unity-All-Applications.directory data/X-Unity-Media.directory data/unity-place-applications.menu po/da.gmo src/config.c src/config.vala src/daemon.c src/schemas.c src/unity-applications-daemon src/unity_applications_daemon.vala.stamp
=== modified file 'src/daemon.vala' --- a/src/daemon.vala 2010-09-09 07:49:02 +0000 +++ b/src/daemon.vala 2010-09-13 12:58:15 +0000 @@ -422,7 +422,8 @@ } else { - debug ("Doing filter search: '%s'", search.get_search_string ()); + debug ("Doing filter search on Most Used apps: '%s'", + search.get_search_string ()); uint group = Group.MOST_USED; Dee.ResultSet filter_set = results_by_group.lookup (@"$group", TermMatchFlag.EXACT); @@ -435,8 +436,7 @@ app_uris.add (ev.get_subject (0).get_uri ()); } - Unity.ApplicationsPlace.apply_uri_filter(app_uris, - filter_set); + Utils.apply_uri_filter(app_uris, filter_set); } debug ("Found %u/%u Most Used apps for query '%s'", @@ -559,7 +559,8 @@ Set<string> available_uris = new HashSet<string> (); add_pkg_search_result (appresults, installed_uris, available_uris, - model, results_by_group, is_filter_search); + model, Group.INSTALLED, results_by_group, + is_filter_search); timer.stop (); debug ("Listed %i Installed apps in %fms for query: %s", @@ -571,10 +572,11 @@ timer.start (); var pkgresults = pkgsearcher.search (search_string); add_pkg_search_result (pkgresults, installed_uris, available_uris, - model, results_by_group, is_filter_search); + model, Group.AVAILABLE, results_by_group, + is_filter_search); timer.stop (); debug ("Listed %i Available apps in %fms for query: %s", - appresults.num_hits, timer.elapsed ()*1000, search_string); + pkgresults.num_hits, timer.elapsed ()*1000, search_string); } return false; @@ -584,6 +586,7 @@ Set<string> installed_uris, Set<string> available_uris, Dee.Model model, + Group group, Dee.Index results_by_group, bool is_filter_search) { @@ -593,27 +596,42 @@ { if (pkginfo.desktop_file == null) continue; - - string uri; + string desktop_id = Path.get_basename (pkginfo.desktop_file); AppInfo? app = appmanager.lookup (desktop_id); - bool installed = app != null; if (app != null && !app.should_show ()) continue; - if (installed) - uri = @"application://$(desktop_id)"; - else + /* De-dupe by 'application://foo.desktop' URI */ + string uri = @"application://$(desktop_id)"; + if (uri in installed_uris) + continue; + + /* Apps that are not installed, ie. in the Available group + * use the 'unity-install://pkgname/Full App Name' URI scheme, + * but only use that after we've de-duped the results */ + if (group == Group.AVAILABLE) uri = @"unity-install://$(pkginfo.package_name)/$(pkginfo.application_name)"; - if (uri in installed_uris || uri in available_uris) - continue; - - if (installed) - installed_uris.add (uri); - else - available_uris.add (uri); + string display_name; + string comment; + switch (group) + { + case Group.INSTALLED: + installed_uris.add (uri); + display_name = app.get_display_name (); + comment = app.get_description (); + break; + case Group.AVAILABLE: + available_uris.add (uri); + display_name = pkginfo.application_name; + comment = ""; + break; + default: + warning (@"Illegal group for package search $(group)"); + continue; + } Icon icon = find_pkg_icon (pkginfo); @@ -621,10 +639,10 @@ { model.append (ResultsColumn.URI, uri, ResultsColumn.ICON_HINT, icon.to_string (), - ResultsColumn.GROUP_ID, installed ? Group.INSTALLED : Group.AVAILABLE, + ResultsColumn.GROUP_ID, group, ResultsColumn.MIMETYPE, "application/x-desktop", - ResultsColumn.DISPLAY_NAME, installed ? app.get_display_name () : pkginfo.application_name, - ResultsColumn.COMMENT, app != null ? app.get_description () : "", + ResultsColumn.DISPLAY_NAME, display_name, + ResultsColumn.COMMENT, comment, -1); } } @@ -632,18 +650,20 @@ if (is_filter_search) { /* Filter the Installed group */ - uint group = Group.INSTALLED; - var installed_set = results_by_group.lookup (@"$group", - TermMatchFlag.EXACT); - Unity.ApplicationsPlace.apply_uri_filter (installed_uris, - installed_set); - - /* Filter the Available group */ - group = Group.AVAILABLE; - var available_set = results_by_group.lookup (@"$group", - TermMatchFlag.EXACT); - Unity.ApplicationsPlace.apply_uri_filter (available_uris, - available_set); + var filter_set = results_by_group.lookup (@"$((uint)group)", + TermMatchFlag.EXACT); + switch (group) + { + case Group.INSTALLED: + Utils.apply_uri_filter (installed_uris, filter_set); + break; + case Group.AVAILABLE: + Utils.apply_uri_filter (available_uris, filter_set); + break; + default: + warning (@"Illegal group for package search $(group)"); + break; + } } } @@ -824,28 +844,6 @@ } /* END: class Daemon */ - /* Run through @filter_set and remove any row in which URI is not - * in @valid_uris */ - public void apply_uri_filter (Set<string> valid_uris, - Dee.ResultSet filter_set) - { - var model = filter_set.get_model (); - uint n_removed = 0; - - /* Anything in filter_set that is not in the event_uris set, is removed - * from the results_model */ - foreach (var row in filter_set) - { - if (!(model.get_string (row, ResultsColumn.URI) in valid_uris)) - { - model.remove (row); - n_removed++; - } - } - - debug ("Removed %u rows from result set", n_removed); - } - /*public void append_treedir_with_group (GMenu.TreeDirectory treedir, Dee.Model results, uint group_id)
=== modified file 'src/utils.vala' --- a/src/utils.vala 2010-09-06 13:22:00 +0000 +++ b/src/utils.vala 2010-09-13 12:58:29 +0000 @@ -118,7 +118,28 @@ else return s1.strip () != s2.strip (); } - - return true; + } + + /* Run through @filter_set and remove any row in which URI is not + * in @valid_uris */ + public void apply_uri_filter (Set<string> valid_uris, + Dee.ResultSet filter_set) + { + var model = filter_set.get_model (); + uint n_removed = 0; + + /* Anything in filter_set that is not in the event_uris set, is removed + * from the results_model */ + foreach (var row in filter_set) + { + if (!(model.get_string (row, ResultsColumn.URI) in valid_uris)) + { + //debug ("Removed: %s", model.get_string (row, ResultsColumn.URI)); + model.remove (row); + n_removed++; + } + } + + debug ("Removed %u rows from result set", n_removed); } }
|
Mikkel Kamstrup Erla... |
|
13 years ago
|
|
|