summaryrefslogtreecommitdiff
authorMichal Hruby <michal.mhr@gmail.com>2011-10-11 10:18:06 (GMT)
committer Michal Hruby <michal.mhr@gmail.com>2011-10-11 10:18:06 (GMT)
commit9b593480006f72e634029c8356f3f51ae28f04fb (patch) (side-by-side diff)
tree909e53beba06ec5907ca274098c8e284bc2763d4
parent1e9357b9da1e858d97e2addbe7bec608d19933b8 (diff)
downloadzeitgeist-9b593480006f72e634029c8356f3f51ae28f04fb.zip
zeitgeist-9b593480006f72e634029c8356f3f51ae28f04fb.tar.gz
Don't overuse Variants if we can just use a struct
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/remote.vala10
-rw-r--r--src/zeitgeist-daemon.vala18
2 files changed, 17 insertions, 11 deletions
diff --git a/src/remote.vala b/src/remote.vala
index ae6b0e7..70713f7 100644
--- a/src/remote.vala
+++ b/src/remote.vala
@@ -21,6 +21,12 @@
namespace Zeitgeist
{
+ public struct VersionStruct
+ {
+ int major;
+ int minor;
+ int micro;
+ }
[DBus (name = "org.gnome.zeitgeist.Log")]
public interface RemoteLog : Object
@@ -86,8 +92,8 @@ namespace Zeitgeist
[DBus (name = "extensions")]
public abstract string[] extensions { owned get; }
- [DBus (signature = "iii", name = "version")]
- public abstract Variant version { owned get; }
+ [DBus (name = "version")]
+ public abstract VersionStruct version { owned get; }
}
diff --git a/src/zeitgeist-daemon.vala b/src/zeitgeist-daemon.vala
index 1b85d9f..fb95e99 100644
--- a/src/zeitgeist-daemon.vala
+++ b/src/zeitgeist-daemon.vala
@@ -88,26 +88,26 @@ namespace Zeitgeist
}
}
- public Variant version
+ public VersionStruct version
{
owned get
{
- var vb = new VariantBuilder (new VariantType ("(iii)"));
+ var s = VersionStruct ();
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]));
+ s.major = int.parse (ver[0]);
+ s.minor = int.parse (ver[1]);
+ s.micro = int.parse (ver[2]);
}
else
{
warning ("Unable to parse version info!");
- vb.add ("i", 0);
- vb.add ("i", 8);
- vb.add ("i", 99);
+ s.major = 0;
+ s.minor = 8;
+ s.micro = 99;
}
- return vb.end ();
+ return s;
}
}