[gnome-shell/gbsneto/icon-grid-part1: 2/5] baseAppView: Remove _updateGrid()



commit dbf81912d23fe70793646d852728d054005773e7
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Aug 5 17:37:30 2019 -0300

    baseAppView: Remove _updateGrid()
    
    Following the past few patches, now that _redisplay()
    takes care of the majority of the loading routines of
    the views, _updateGrid() can be appended to it.
    
    Append the contents of _upgradeGrid() to _redisplay(),
    and remove _updateGrid().
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/645

 js/ui/appDisplay.js | 31 ++++++++++++++-----------------
 1 file changed, 14 insertions(+), 17 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 07ebc5c73..91da8aa65 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -141,7 +141,18 @@ class BaseAppView {
             this._items[icon.id] = icon;
         });
 
-        this._updateGrid();
+        // Update this._grid items
+        this._allItems.sort(this._compareItems);
+
+        this._allItems.forEach((item, index) => {
+            // Don't readd already added items
+            if (item.actor.get_parent())
+                return;
+
+            this._grid.addItem(item, index);
+        });
+
+        this.emit('view-loaded');
     }
 
     getAllItems() {
@@ -165,20 +176,6 @@ class BaseAppView {
         return a.name.localeCompare(b.name);
     }
 
-    _updateGrid() {
-        this._allItems.sort(this._compareItems);
-
-        this._allItems.forEach((item, index) => {
-            // Don't readd already added items
-            if (item.actor.get_parent())
-                return;
-
-            this._grid.addItem(item, index);
-        });
-
-        this.emit('view-loaded');
-    }
-
     _selectAppInternal(id) {
         if (this._items[id])
             this._items[id].actor.navigate_focus(null, St.DirectionType.TAB_FORWARD, false);
@@ -431,8 +428,8 @@ var AllView = class AllView extends BaseAppView {
         return newApps;
     }
 
-    _updateGrid() {
-        super._updateGrid();
+    _redisplay() {
+        super._redisplay();
         this._refilterApps();
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]