r35319 - in /desktop/unstable/gnome-shell/debian: changelog patches/27-don-t-show-apps-in-NoDisplay-categories.patch patches/series

biebl at users.alioth.debian.org biebl at users.alioth.debian.org
Tue Jun 12 15:09:04 UTC 2012


Author: biebl
Date: Tue Jun 12 15:09:02 2012
New Revision: 35319

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=35319
Log:
debian/patches/27-don-t-show-apps-in-NoDisplay-categories.patch:
Explicitly include NoDisplay applications in the ShellAppSystem because we
want application tracking for them, but filter NoDisplay applications out
when showing them to the user because we don't want to show them to the
user. Patch backported from upstream Git.

Added:
    desktop/unstable/gnome-shell/debian/patches/27-don-t-show-apps-in-NoDisplay-categories.patch
Modified:
    desktop/unstable/gnome-shell/debian/changelog
    desktop/unstable/gnome-shell/debian/patches/series

Modified: desktop/unstable/gnome-shell/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-shell/debian/changelog?rev=35319&op=diff
==============================================================================
--- desktop/unstable/gnome-shell/debian/changelog [utf-8] (original)
+++ desktop/unstable/gnome-shell/debian/changelog [utf-8] Tue Jun 12 15:09:02 2012
@@ -8,6 +8,11 @@
   * debian/patches/09-respect-NoDisplay-semantics-for-app-menu.patch: Drop
     this patch as it breaks application tracking for all applications marked
     as NoDisplay. Closes: #676425
+  * debian/patches/27-don-t-show-apps-in-NoDisplay-categories.patch:
+    Explicitly include NoDisplay applications in the ShellAppSystem because we
+    want application tracking for them, but filter NoDisplay applications out
+    when showing them to the user because we don't want to show them to the
+    user. Patch backported from upstream Git.
 
  -- Laurent Bigonville <bigon at debian.org>  Fri, 01 Jun 2012 11:39:55 +0200
 

Added: desktop/unstable/gnome-shell/debian/patches/27-don-t-show-apps-in-NoDisplay-categories.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-shell/debian/patches/27-don-t-show-apps-in-NoDisplay-categories.patch?rev=35319&op=file
==============================================================================
--- desktop/unstable/gnome-shell/debian/patches/27-don-t-show-apps-in-NoDisplay-categories.patch (added)
+++ desktop/unstable/gnome-shell/debian/patches/27-don-t-show-apps-in-NoDisplay-categories.patch [utf-8] Tue Jun 12 15:09:02 2012
@@ -1,0 +1,222 @@
+From e4a215753914aa8a2640382a5a45e711946f31fd Mon Sep 17 00:00:00 2001
+From: "Jasper St. Pierre" <jstpierre at mecheye.net>
+Date: Mon, 11 Jun 2012 13:53:32 -0400
+Subject: [PATCH] appDisplay: Don't show apps in NoDisplay categories in the
+ All view
+
+We explicitly include NoDisplay applications in the ShellAppSystem because
+we want app tracking for them, but we explicitly filter NoDisplay applications
+out when showing them to the user because we don't want to show them to the
+user. We also based our "All" apps view on a flattened list of apps. While
+we did check for NoDisplay on the app item itself, we didn't check against
+its parents. Refactor the app display view to not use a separate flat list
+of applications, but instead a concatenation of all the applications in all
+the loaded categories.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=658176
+---
+ js/ui/appDisplay.js    |   41 ++++++++++++++++++-----------------------
+ js/ui/iconGrid.js      |    7 +++++--
+ src/shell-app-system.c |   24 ------------------------
+ src/shell-app-system.h |    2 --
+ 4 files changed, 23 insertions(+), 51 deletions(-)
+
+diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
+index 5b2c75f..8634c00 100644
+--- a/js/ui/appDisplay.js
++++ b/js/ui/appDisplay.js
+@@ -22,6 +22,7 @@ const Search = imports.ui.search;
+ const Tweener = imports.ui.tweener;
+ const Workspace = imports.ui.workspace;
+ const Params = imports.misc.params;
++const Util = imports.misc.util;
+ 
+ const MAX_APPLICATION_WORK_MILLIS = 75;
+ const MENU_POPUP_TIMEOUT = 600;
+@@ -36,6 +37,7 @@ const AlphabeticalView = new Lang.Class({
+ 
+         this._pendingAppLaterId = 0;
+         this._appIcons = {}; // desktop file id
++        this._allApps = [];
+ 
+         let box = new St.BoxLayout({ vertical: true });
+         box.add(this._grid.actor, { y_align: St.Align.START, expand: true });
+@@ -60,16 +62,22 @@ const AlphabeticalView = new Lang.Class({
+             }));
+     },
+ 
+-    _removeAll: function() {
++    removeAll: function() {
+         this._grid.removeAll();
+         this._appIcons = {};
++        this._allApps = [];
+     },
+ 
+-    _addApp: function(app) {
++    addApp: function(app) {
+         var id = app.get_id();
+-        let appIcon = new AppWellIcon(app);
++        if (this._appIcons[id] !== undefined)
++            return;
+ 
+-        this._grid.addItem(appIcon.actor);
++        let appIcon = new AppWellIcon(app);
++        let pos = Util.insertSorted(this._allApps, app, function(a, b) {
++            return a.compare_by_name(b);
++        });
++        this._grid.addItem(appIcon.actor, pos);
+         appIcon.actor.connect('key-focus-in', Lang.bind(this, this._ensureIconVisible));
+ 
+         this._appIcons[id] = appIcon;
+@@ -120,14 +128,6 @@ const AlphabeticalView = new Lang.Class({
+                 icon.actor.visible = true;
+             }
+         }
+-    },
+-
+-    setAppList: function(apps) {
+-        this._removeAll();
+-        for (var i = 0; i < apps.length; i++) {
+-            var app = apps[i];
+-            this._addApp(app);
+-         }
+     }
+ });
+ 
+@@ -147,7 +147,6 @@ const ViewByCategories = new Lang.Class({
+         // (used only before the actor is mapped the first time)
+         this._currentCategory = -2;
+         this._categories = [];
+-        this._apps = null;
+ 
+         this._categoryBox = new St.BoxLayout({ vertical: true,
+                                                reactive: true,
+@@ -204,8 +203,10 @@ const ViewByCategories = new Lang.Class({
+             if (nextType == GMenu.TreeItemType.ENTRY) {
+                 var entry = iter.get_entry();
+                 var app = this._appSystem.lookup_app_by_tree_entry(entry);
+-                if (!entry.get_app_info().get_nodisplay())
++                if (!entry.get_app_info().get_nodisplay()) {
++                    this._view.addApp(app);
+                     appList.push(app);
++                }
+             } else if (nextType == GMenu.TreeItemType.DIRECTORY) {
+                 if (!dir.get_is_nodisplay())
+                     this._loadCategory(iter.get_directory(), appList);
+@@ -213,7 +214,7 @@ const ViewByCategories = new Lang.Class({
+         }
+     },
+ 
+-    _addCategory: function(name, index, dir, allApps) {
++    _addCategory: function(name, index, dir) {
+         let button = new St.Button({ label: GLib.markup_escape_text (name, -1),
+                                      style_class: 'app-filter',
+                                      x_align: St.Align.START,
+@@ -225,7 +226,6 @@ const ViewByCategories = new Lang.Class({
+ 
+         var apps;
+         if (dir == null) {
+-            apps = allApps;
+             this._allCategoryButton = button;
+         } else {
+             apps = [];
+@@ -239,6 +239,7 @@ const ViewByCategories = new Lang.Class({
+     },
+ 
+     _removeAll: function() {
++        this._view.removeAll();
+         this._categories = [];
+         this._categoryBox.destroy_all_children();
+     },
+@@ -246,13 +247,8 @@ const ViewByCategories = new Lang.Class({
+     refresh: function() {
+         this._removeAll();
+ 
+-        var allApps = Shell.AppSystem.get_default().get_all();
+-        allApps.sort(function(a, b) {
+-            return a.compare_by_name(b);
+-        });
+-
+         /* Translators: Filter to display all applications */
+-        this._addCategory(_("All"), -1, null, allApps);
++        this._addCategory(_("All"), -1, null);
+ 
+         var tree = this._appSystem.get_tree();
+         var root = tree.get_root_directory();
+@@ -270,7 +266,6 @@ const ViewByCategories = new Lang.Class({
+             }
+         }
+ 
+-        this._view.setAppList(allApps);
+         this._selectCategory(-1);
+ 
+         if (this._focusDummy) {
+diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
+index ef71bc7..e4c4258 100644
+--- a/js/ui/iconGrid.js
++++ b/js/ui/iconGrid.js
+@@ -311,8 +311,11 @@ const IconGrid = new Lang.Class({
+         }));
+     },
+ 
+-    addItem: function(actor) {
+-        this._grid.add_actor(actor);
++    addItem: function(actor, index) {
++        if (index !== undefined)
++            this._grid.insert_child_at_index(actor, index);
++        else
++            this._grid.add_actor(actor);
+     },
+ 
+     getItemAtIndex: function(index) {
+diff --git a/src/shell-app-system.c b/src/shell-app-system.c
+index 2528e9f..98a7644 100644
+--- a/src/shell-app-system.c
++++ b/src/shell-app-system.c
+@@ -608,30 +608,6 @@ shell_app_system_lookup_heuristic_basename (ShellAppSystem *system,
+   return NULL;
+ }
+ 
+-/**
+- * shell_app_system_get_all:
+- * @system:
+- *
+- * Returns: (transfer container) (element-type ShellApp): All installed applications
+- */
+-GSList *
+-shell_app_system_get_all (ShellAppSystem  *self)
+-{
+-  GSList *result = NULL;
+-  GHashTableIter iter;
+-  gpointer key, value;
+-
+-  g_hash_table_iter_init (&iter, self->priv->id_to_app);
+-  while (g_hash_table_iter_next (&iter, &key, &value))
+-    {
+-      ShellApp *app = value;
+-      
+-      if (!g_desktop_app_info_get_nodisplay (shell_app_get_app_info (app)))
+-        result = g_slist_prepend (result, app);
+-    }
+-  return result;
+-}
+-
+ void
+ _shell_app_system_notify_app_state_changed (ShellAppSystem *self,
+                                             ShellApp       *app)
+diff --git a/src/shell-app-system.h b/src/shell-app-system.h
+index c26b728..3d36385 100644
+--- a/src/shell-app-system.h
++++ b/src/shell-app-system.h
+@@ -51,8 +51,6 @@ ShellApp       *shell_app_system_lookup_heuristic_basename    (ShellAppSystem  *
+                                                                const char      *id);
+ 
+ 
+-GSList         *shell_app_system_get_all                   (ShellAppSystem  *system);
+-
+ GSList         *shell_app_system_get_running               (ShellAppSystem  *self);
+ 
+ GSList         *shell_app_system_initial_search            (ShellAppSystem  *system,
+-- 
+1.7.10
+

Modified: desktop/unstable/gnome-shell/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-shell/debian/patches/series?rev=35319&op=diff
==============================================================================
--- desktop/unstable/gnome-shell/debian/patches/series [utf-8] (original)
+++ desktop/unstable/gnome-shell/debian/patches/series [utf-8] Tue Jun 12 15:09:02 2012
@@ -5,3 +5,4 @@
 22-remove-online-accounts-from-user-menu.patch
 25-close-the-recorder-instead-of-pausing-it.patch
 26-fix-empathy-popup-regression.patch
+27-don-t-show-apps-in-NoDisplay-categories.patch




More information about the pkg-gnome-commits mailing list