src/Builder4/MainWindow.bjs
authorAlan <alan@roojs.com>
Thu, 7 Jul 2022 08:16:50 +0000 (16:16 +0800)
committerAlan <alan@roojs.com>
Thu, 7 Jul 2022 08:16:50 +0000 (16:16 +0800)
src/Builder4/MainWindow.vala

src/Builder4/MainWindow.bjs
src/Builder4/MainWindow.vala

index 29b66fd..ec34463 100644 (file)
           "\t foreach(var w in BuilderApplication.windows) {",
           "\t \tvar wid = BuilderApplication.windows.index_of(w);",
           "\t \t// fixme find a better way to display this.",
+          " \t\tif (w.windowstate == null || w.windowstate.file == null) { ",
+          " \t\t\tcontinue;",
+          "\t\t}",
+          "\t \t",
           "\t \tif (w.windowstate.file.path == _this.windowstate.file.path) {",
           "\t \t\tcontinue;",
           " \t\t}",
-          " \t\tif (w.windowstate.file == null) { ",
-          " \t\t\tcontinue;",
-          "\t\t}",
+          "",
           " \t\tGLib.debug(\"add menuitem %s\", w.windowstate.file.path);",
           "\t \tvar m = new Gtk.MenuItem.with_label(w.windowstate.file.path);",
           "\t \tm.activate.connect(() => {",
index 3d12a69..fdfce43 100644 (file)
@@ -263,12 +263,14 @@ public class Xcls_MainWindow : Object
                 foreach(var w in BuilderApplication.windows) {
                        var wid = BuilderApplication.windows.index_of(w);
                        // fixme find a better way to display this.
+                       if (w.windowstate == null || w.windowstate.file == null) { 
+                               continue;
+                       }
+                       
                        if (w.windowstate.file.path == _this.windowstate.file.path) {
                                continue;
                        }
-                       if (w.windowstate.file == null) { 
-                               continue;
-                       }
+        
                        GLib.debug("add menuitem %s", w.windowstate.file.path);
                        var m = new Gtk.MenuItem.with_label(w.windowstate.file.path);
                        m.activate.connect(() => {