[gnome-builder] meson-templates: Minor Vala cleanups
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] meson-templates: Minor Vala cleanups
- Date: Mon, 14 Aug 2017 03:48:11 +0000 (UTC)
commit efc11aaa2e4a6934129132e25c770f6e7cb1a1b1
Author: Patrick Griffis <tingping tingping se>
Date: Sun Aug 13 23:47:40 2017 -0400
meson-templates: Minor Vala cleanups
.../meson_templates/resources/src/main.vala | 12 +++++-------
.../meson_templates/resources/src/window.vala | 4 +---
2 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/plugins/meson-templates/meson_templates/resources/src/main.vala
b/plugins/meson-templates/meson_templates/resources/src/main.vala
index 08f8093..9454285 100644
--- a/plugins/meson-templates/meson_templates/resources/src/main.vala
+++ b/plugins/meson-templates/meson_templates/resources/src/main.vala
@@ -1,16 +1,14 @@
{{include "license.vala"}}
-using Gtk;
-
int main (string[] args) {
var app = new Gtk.Application ("{{appid}}", ApplicationFlags.FLAGS_NONE);
app.activate.connect (() => {
- if (app.active_window == null) {
- new {{PreFix}}.Window (app);
+ var win = app.active_window;
+ if (win == null) {
+ win = new {{PreFix}}.Window (app);
}
- app.active_window.present ();
+ win.present ();
});
- int ret = app.run (args);
- return ret;
+ return app.run (args);
}
diff --git a/plugins/meson-templates/meson_templates/resources/src/window.vala
b/plugins/meson-templates/meson_templates/resources/src/window.vala
index 868df37..26732a2 100644
--- a/plugins/meson-templates/meson_templates/resources/src/window.vala
+++ b/plugins/meson-templates/meson_templates/resources/src/window.vala
@@ -1,12 +1,10 @@
{{include "license.vala"}}
-using Gtk;
-
namespace {{PreFix}} {
[GtkTemplate (ui = "{{appid_path}}/{{ui_file}}")]
public class Window : Gtk.ApplicationWindow {
[GtkChild]
- Label label;
+ Gtk.Label label;
public Window (Gtk.Application app) {
Object(application: app);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]