[gnome-todo] application: Show VCS hash when debug-building



commit d5840aeaf207a0e2752ca242786c0b0c32293253
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Oct 31 19:35:52 2017 -0200

    application: Show VCS hash when debug-building

 src/gtd-application.c       |  3 ++-
 src/gtd-vcs-identifier.h.in | 38 ++++++++++++++++++++++++++++++++++++++
 src/meson.build             | 14 ++++++++++++++
 3 files changed, 54 insertions(+), 1 deletion(-)
---
diff --git a/src/gtd-application.c b/src/gtd-application.c
index aacecfc..bbd6a52 100644
--- a/src/gtd-application.c
+++ b/src/gtd-application.c
@@ -25,6 +25,7 @@
 #include "gtd-manager.h"
 #include "gtd-manager-protected.h"
 #include "gtd-plugin-dialog.h"
+#include "gtd-vcs-identifier.h"
 #include "gtd-window.h"
 
 #include <glib.h>
@@ -149,7 +150,7 @@ gtd_application_show_about (GSimpleAction *simple,
 
   gtk_show_about_dialog (GTK_WINDOW (self->window),
                          "program-name", _("To Do"),
-                         "version", VERSION,
+                         "version", VERSION GTD_VCS_IDENTIFIER,
                          "copyright", copyright,
                          "license-type", GTK_LICENSE_GPL_3_0,
                          "authors", authors,
diff --git a/src/gtd-vcs-identifier.h.in b/src/gtd-vcs-identifier.h.in
new file mode 100644
index 0000000..b95d236
--- /dev/null
+++ b/src/gtd-vcs-identifier.h.in
@@ -0,0 +1,38 @@
+/* gtd-vcs-identifier.h.in
+ *
+ * Copyright (C) 2017 Georges Basile Stavracas Neto <georges stavracas gmail com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GTD_VCS_IDENTIFIER_H
+#define GTD_VCS_IDENTIFIER_H
+
+#include <glib.h>
+
+#include "config.h"
+
+G_BEGIN_DECLS
+
+#ifdef GNOME_TODO_ENABLE_DEBUG
+  #define GTD_VCS_IDENTIFIER "-@VCS_TAG@"
+#else
+  #define GTD_VCS_IDENTIFIER ""
+#endif
+
+G_END_DECLS
+
+#endif /* GTD_VCS_IDENTIFIER_H */
+
+
diff --git a/src/meson.build b/src/meson.build
index 72f2b5d..53c772e 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,4 +1,18 @@
 
+###################
+# VCS Identifiter #
+###################
+
+vcs_identifier_h = vcs_tag(
+    fallback: meson.project_version(),
+       input: 'gtd-vcs-identifier.h.in',
+      output: 'gtd-vcs-identifier.h',
+)
+
+################
+# Header files #
+################
+
 enum_headers = files('gtd-enums.h')
 
 headers = enum_headers + files(


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