gtk-demo: Make --version match about
authorMatthias Clasen <mclasen@redhat.com>
Fri, 19 Feb 2021 03:52:15 +0000 (22:52 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 19 Feb 2021 03:52:15 +0000 (22:52 -0500)
Print the same version information in --version
that we show in the about dialog.

demos/gtk-demo/main.c

index 5ae00882ac70db8ad8c1db3742b79f00993cd7a4..96ec96e4764ccfb635f2c70fa48813910aff65a4 100644 (file)
@@ -1052,10 +1052,10 @@ out:
 static void
 print_version (void)
 {
-  g_print ("gtk4-demo %d.%d.%d\n",
-           gtk_get_major_version (),
-           gtk_get_minor_version (),
-           gtk_get_micro_version ());
+  g_print ("gtk4-demo %s%s%s\n",
+           PACKAGE_VERSION,
+           g_strcmp0 (PROFILE, "devel") == 0 ? "-" : "",
+           g_strcmp0 (PROFILE, "devel") == 0 ? VCS_TAG : "");
 }
 
 static int