[gnome-shell/gbsneto/icon-grid-dnd: 1/13] baseAppView: Remove	BaseAppView.addItem()
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gnome-shell/gbsneto/icon-grid-dnd: 1/13] baseAppView: Remove	BaseAppView.addItem()
- Date: Tue,  2 Jul 2019 21:02:27 +0000 (UTC)
commit 0ca006fc28389e2e746a33d3db6abb57883f596b
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Jul 2 10:12:08 2019 -0300
    baseAppView: Remove BaseAppView.addItem()
    
    Now that BaseAppView does not allow for subclasses to
    add and remove items directly, the addItem() method
    can be removed.
    
    Remove BaseAppView.addItem().
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/603
 js/ui/appDisplay.js | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index b4624de0d..4a5c4796d 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -134,8 +134,10 @@ class BaseAppView {
         }
 
         // Add new app icons
-        for (let app of addedApps)
-            this.addItem(app);
+        for (let appIcon of addedApps) {
+            this._allItems.push(appIcon);
+            this._items[appIcon.id] = appIcon;
+        }
 
         this._loadGrid();
     }
@@ -144,15 +146,6 @@ class BaseAppView {
         return this._allItems;
     }
 
-    addItem(icon) {
-        let id = icon.id;
-        if (this._items[id] !== undefined)
-            return;
-
-        this._allItems.push(icon);
-        this._items[id] = icon;
-    }
-
     _compareItems(a, b) {
         return a.name.localeCompare(b.name);
     }
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]