lp:~unity-team/unity-lens-applications/translatable-place-files

Created by Mikkel Kamstrup Erlandsen and last modified
Get this branch:
bzr branch lp:~unity-team/unity-lens-applications/translatable-place-files
Members of Unity Team can upload to this branch. Log in for directions.

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
Unity Team
Project:
unity-lens-applications
Status:
Merged

Recent revisions

103. By Mikkel Kamstrup Erlandsen

Fix the INTLTOOL_PLACE_RULE to not bork up the Makefiles with illegal linebreaks

Fix distcheck by making sure we clean the generated .place file

102. By Mikkel Kamstrup Erlandsen

WIP: make .place files translatable

101. By Mikkel Kamstrup Erlandsen

Allow gnome-screenshot in the menu

Apps that where excluded by some XDG menu rule, where showing up in the Available section because they'd slip through our de-duping system

Explicitly remove evolution-mail.desktop from select sections since it is a dupe of evolution.desktop. This fixes LP bug #643034 "Dupe apps in apps place (evolution)"

100. By Mikkel Kamstrup Erlandsen

Second stab at fixing LP bug #633100 "Completing last letter of a search makes the application to be hidden from result".

When doing a filter search (aka incrementally narrowing down the result set) we pruned all apps in the Available group. So if you quickly typed "banshe" you'd see Banshee in the Available group, because this would just trigger one primary search. Adding the last "e" would trigger a filter search that would remove Banshee.

99. By Mikkel Kamstrup Erlandsen

Post release version bump

98. By Mikkel Kamstrup Erlandsen

Release 0.2.20

97. By Mikkel Kamstrup Erlandsen

Merge Mikkel's branch lp:~unity-team/unity-place-applications/global-search-fixes:

 * Improves reliability of results in the global search mode

 * Allows for searching apps by executable names. Not doing this resulted in lots of confused users that couldn't find Totem by typing "totem" because we only indexed it as "Movie Player"

 * Some fixes in the de-duplication algorithm that could cause installed apps to only show up the Available group when they should be in the Installedd group

96. By Mikkel Kamstrup Erlandsen

Rebuild the application menu index on changes to the menu structure. Without this bugfix newly installed apps form Software Center will either not show up at all or show up in the Available section

95. By Mikkel Kamstrup Erlandsen

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);
   }
 }

94. By Mikkel Kamstrup Erlandsen

Post release version bump

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
lp:unity-lens-applications
This branch contains Public information 
Everyone can see this information.

Subscribers