[gnome-maps/wip/mlundblad/cleanup-gtk-deprecations] osmTypePopover: Stop using generic GtkContainer add and remove



commit cdd4e9514034a75fc718a5ea034061ee4e64c7a7
Author: Marcus Lundblad <ml update uu se>
Date:   Wed Mar 24 22:55:46 2021 +0100

    osmTypePopover: Stop using generic GtkContainer add and remove
    
    In preparation for GTK 4 use class-specific methods
    to add and remove children when possible.

 src/osmTypePopover.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/osmTypePopover.js b/src/osmTypePopover.js
index 5355ca5d..664ae721 100644
--- a/src/osmTypePopover.js
+++ b/src/osmTypePopover.js
@@ -47,7 +47,7 @@ var OSMTypePopover = GObject.registerClass({
     }
 
     showMatches(matches) {
-        this._list.forall((row) => row.destroy());
+        this._list.foreach((row) => this._list.remove(row));
 
         matches.forEach((type) => this._addRow(type));
         this.show();
@@ -56,6 +56,6 @@ var OSMTypePopover = GObject.registerClass({
     _addRow(type) {
         let row = new OSMTypeListRow.OSMTypeListRow({ type: type,
                                                       can_focus: true });
-        this._list.add(row);
+        this._list.insert(row, -1);
     }
 });


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