Siegfried Gevatter has proposed merging lp:~rainct/zeitgeist/matches-template
into lp:zeitgeist.
Requested reviews:
Zeitgeist Framework Team (zeitgeist)
For more details, see:
https://code.launchpad.net/~rainct/zeitgeist/matches-template/+merge/93279
--
https://code.launchpad.net/~rainct/zeitgeist/matches-template/+merge/93279
Your team Zeitgeist Framework Team is requested to review the proposed merge of
lp:~rainct/zeitgeist/matches-template into lp:zeitgeist.
=== modified file 'extensions/Makefile.am'
--- extensions/Makefile.am 2012-02-08 18:54:58 +
+++ extensions/Makefile.am 2012-02-15 18:59:17 +
@@ -70,3 +70,6 @@
benchmark_la_LIBADD = \
$(ZEITGEIST_LIBS) \
$(NULL)
+
+distclean-local:
+ rm -f *.c *.o *.stamp *.~[0-9]~
=== modified file 'po/POTFILES.skip'
--- po/POTFILES.skip 2011-07-25 23:24:14 +
+++ po/POTFILES.skip 2012-02-15 18:59:17 +
@@ -1,1 +1,2 @@
src/main.c
+tools/gtk/zeitgeist-data-sources-gtk.py
=== modified file 'src/datamodel.vala'
--- src/datamodel.vala 2012-02-07 14:51:50 +
+++ src/datamodel.vala 2012-02-15 18:59:17 +
@@ -4,6 +4,8 @@
* By Seif Lotfy s...@lotfy.com
* By Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
* Copyright © 2011 Manish Sinha manishsi...@ubuntu.com
+ * Copyright © 2012 Canonical Ltd.
+ * By Siegfried-A. Gevatter siegfried.gevat...@collabora.co.uk
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -262,15 +264,18 @@
ANY = 2 // The event subjects may or may not be available
}
-private bool check_field_match (string property,
-string template_property, bool is_symbol = false,
+private bool check_field_match (string? property,
+string? template_property, bool is_symbol = false,
bool can_wildcard = false)
{
var matches = false;
+var is_negated = false;
var parsed = template_property;
-var is_negated = Utils.parse_negation (ref parsed);
-
-if (parsed == )
+
+if (parsed != null)
+is_negated = Utils.parse_negation (ref parsed);
+
+if (Utils.is_empty_string (parsed))
{
return true;
}
@@ -278,14 +283,15 @@
{
matches = true;
}
-else if (is_symbol
+else if (is_symbol property != null
Symbol.get_all_parents (property).find_custom (parsed, strcmp) != null)
{
matches = true;
}
else if (can_wildcard Utils.parse_wildcard (ref parsed))
{
-if (property.has_prefix (parsed)) matches = true;
+if (property != null property.has_prefix (parsed))
+matches = true;
}
return (is_negated) ? !matches : matches;
@@ -297,27 +303,27 @@
public uint32id { get; set; }
public int64 timestamp { get; set; }
-public stringorigin { get; set; }
+public string? origin { get; set; }
-public string actor
+public string? actor
{
get { return _actor; }
-set { _actor = url_store.insert_const (value); }
+set { _actor = (value != null) ? url_store.insert_const (value) : null; }
}
-public string interpretation
+public string? interpretation
{
get { return _interpretation; }
-set { _interpretation = url_store.insert_const (value); }
+set { _interpretation = (value != null) ? url_store.insert_const (value) : null; }
}
-public string manifestation
+public string? manifestation
{
get { return _manifestation; }
-set { _manifestation = url_store.insert_const (value); }
+set { _manifestation = (value != null) ? url_store.insert_const (value) : null; }
}
-private unowned string _actor;
-private unowned string _interpretation;
-private unowned string _manifestation;
+private unowned string? _actor;
+private unowned string? _interpretation;
+private unowned string? _manifestation;
public GenericArraySubject subjects { get; set; }
public ByteArray? payload { get; set; }
@@ -342,6 +348,29 @@
subjects.add (subject);
}
+// FIXME: change this to va_list once Vala bug #647097 is fixed
+public Event.full (string? interpretation=null,
+string? manifestation=null, string? actor=null,
+string? origin=null, GenericArraySubject? subjects=null)
+{
+this.interpretation = interpretation;
+this.manifestation = manifestation;
+this.actor = actor;
+this.origin = origin;
+
+if (subjects != null)
+this.subjects = subjects