[gnome-calculator] Fixed build issues with GCI entry controller tests (#250)



commit d1656db7a07079f4134fa5c8e79ad305dbc6e1a7
Author: Robert Roth <robert roth off gmail com>
Date:   Tue Jan 11 08:15:36 2022 +0200

    Fixed build issues with GCI entry controller tests (#250)

 tests/gci-test-entry-controller.ui   | 18 +-----------------
 tests/test-gci-entry-controller.vala |  9 +++------
 2 files changed, 4 insertions(+), 23 deletions(-)
---
diff --git a/tests/gci-test-entry-controller.ui b/tests/gci-test-entry-controller.ui
index 4747c6aa..ecd4dacf 100644
--- a/tests/gci-test-entry-controller.ui
+++ b/tests/gci-test-entry-controller.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Generated with glade 3.22.1 -->
 <interface>
-  <requires lib="gtk+" version="3.20"/>
+  <requires lib="gtk+" version="4.4"/>
   <template class="TestsWindow" parent="GtkApplicationWindow">
     <property name="can_focus">False</property>
     <property name="title" translatable="yes">Testing GCi.EntryController</property>
@@ -19,23 +19,12 @@
             <property name="can_focus">False</property>
             <property name="label" translatable="yes">GCi Test</property>
           </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">0</property>
-          </packing>
         </child>
         <child>
           <object class="GtkEntry" id="entry">
             <property name="visible">True</property>
             <property name="can_focus">True</property>
           </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="padding">12</property>
-            <property name="position">1</property>
-          </packing>
         </child>
         <child>
           <object class="GtkButton" id="button">
@@ -47,11 +36,6 @@
               <class name="destructive-action"/>
             </style>
           </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">2</property>
-          </packing>
         </child>
       </object>
     </child>
diff --git a/tests/test-gci-entry-controller.vala b/tests/test-gci-entry-controller.vala
index d42f605e..18874e30 100644
--- a/tests/test-gci-entry-controller.vala
+++ b/tests/test-gci-entry-controller.vala
@@ -23,18 +23,15 @@ class Tests {
   [GtkTemplate (ui = "/org/gnome/Calculator/gci-test-entry-controller.ui")]
   class Window : Gtk.ApplicationWindow {
     [GtkChild]
-    Gtk.Entry entry;
+    unowned Gtk.Entry entry;
     [GtkChild]
-    Gtk.Button button;
+    unowned Gtk.Button button;
 
     GCi.EntryController controller;
 
     construct {
       controller = new GCi.EntryController ();
       controller.entry = entry;
-      this.destroy.connect (()=>{
-        application.quit ();
-      });
       GLib.Timeout.add (10000, ()=>{
         application.quit ();
       });
@@ -57,7 +54,7 @@ class Tests {
          protected override void activate () {
                  // Create the window of this application and show it
                  Gtk.ApplicationWindow w = new Window (this);
-                 w.show_all ();
+                 w.present ();
          }
   }
   static int main (string[] args)


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