← Back to team overview

zeitgeist team mailing list archive

[Branch ~zeitgeist/zeitgeist/bluebird] Rev 242: Hook up version info to config.h

 

------------------------------------------------------------
revno: 242
committer: Michal Hruby <michal.mhr@xxxxxxxxx>
branch nick: bluebird
timestamp: Thu 2011-09-15 19:57:10 +0200
message:
  Hook up version info to config.h
added:
  config.vapi
modified:
  configure.ac
  src/Makefile.am
  src/zeitgeist-daemon.vala


--
lp:~zeitgeist/zeitgeist/bluebird
https://code.launchpad.net/~zeitgeist/zeitgeist/bluebird

Your team Zeitgeist Framework Team is subscribed to branch lp:~zeitgeist/zeitgeist/bluebird.
To unsubscribe from this branch go to https://code.launchpad.net/~zeitgeist/zeitgeist/bluebird/+edit-subscription
=== added file 'config.vapi'
--- config.vapi	1970-01-01 00:00:00 +0000
+++ config.vapi	2011-09-15 17:57:10 +0000
@@ -0,0 +1,7 @@
+[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")]
+namespace Config
+{
+  public const string GETTEXT_PACKAGE;
+  public const string VERSION;
+  public const string DATADIR;
+}

=== modified file 'configure.ac'
--- configure.ac	2011-09-05 10:27:02 +0000
+++ configure.ac	2011-09-15 17:57:10 +0000
@@ -1,4 +1,4 @@
-AC_INIT([bluebird], [0.1.0], [dev@xxxxxxxxxxxxxxxxxxxxxxxxxxx], [bluebird])
+AC_INIT([bluebird], [0.8.99], [dev@xxxxxxxxxxxxxxxxxxxxxxxxxxx], [bluebird])
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS(config.h)
 AM_INIT_AUTOMAKE([dist-bzip2])

=== modified file 'src/Makefile.am'
--- src/Makefile.am	2011-09-05 19:18:53 +0000
+++ src/Makefile.am	2011-09-15 17:57:10 +0000
@@ -15,6 +15,7 @@
 	--pkg sqlite3 \
 	--pkg posix \
 	--pkg gmodule-2.0 \
+	$(top_srcdir)/config.vapi \
 	$(NULL)
 
 # Make sure every extension has only one vala file!

=== modified file 'src/zeitgeist-daemon.vala'
--- src/zeitgeist-daemon.vala	2011-09-12 12:56:31 +0000
+++ src/zeitgeist-daemon.vala	2011-09-15 17:57:10 +0000
@@ -93,9 +93,20 @@
             owned get
             {
                 var vb = new VariantBuilder (new VariantType ("(iii)"));
-                vb.add ("i", 0);
-                vb.add ("i", 8);
-                vb.add ("i", 99);
+                string[] ver = Config.VERSION.split (".");
+                if (ver.length >= 3)
+                {
+                    vb.add ("i", int.parse (ver[0]));
+                    vb.add ("i", int.parse (ver[1]));
+                    vb.add ("i", int.parse (ver[2]));
+                }
+                else
+                {
+                    warning ("Unable to parse version info!");
+                    vb.add ("i", 0);
+                    vb.add ("i", 8);
+                    vb.add ("i", 99);
+                }
                 return vb.end ();
             }
         }
@@ -295,7 +306,7 @@
 
                 if (show_version_info)
                 {
-                    stdout.printf ("0.8.99\n"); // FIXME!
+                    stdout.printf (Config.VERSION + "\n");
                     return 0;
                 }
                 if (show_options)