Re: [Zeitgeist] [Merge] lp:~rainct/zeitgeist/matches-template into lp:zeitgeist

2012-02-18 Thread Michal Hruby
Review: Approve


-- 
https://code.launchpad.net/~rainct/zeitgeist/matches-template/+merge/93279
Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist.

___
Mailing list: https://launchpad.net/~zeitgeist
Post to : zeitgeist@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zeitgeist
More help   : https://help.launchpad.net/ListHelp


[Zeitgeist] [Merge] lp:~rainct/zeitgeist/matches-template into lp:zeitgeist

2012-02-18 Thread Michal Hruby
The proposal to merge lp:~rainct/zeitgeist/matches-template into lp:zeitgeist 
has been updated.

Status: Needs review = Approved

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 subscribed to branch lp:zeitgeist.

___
Mailing list: https://launchpad.net/~zeitgeist
Post to : zeitgeist@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zeitgeist
More help   : https://help.launchpad.net/ListHelp


[Zeitgeist] [Merge] lp:~rainct/zeitgeist/matches-template into lp:zeitgeist

2012-02-18 Thread noreply
The proposal to merge lp:~rainct/zeitgeist/matches-template into lp:zeitgeist 
has been updated.

Status: Approved = Merged

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 subscribed to branch lp:zeitgeist.

___
Mailing list: https://launchpad.net/~zeitgeist
Post to : zeitgeist@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zeitgeist
More help   : https://help.launchpad.net/ListHelp


Re: [Zeitgeist] [Merge] lp:~rainct/zeitgeist/matches-template into lp:zeitgeist

2012-02-17 Thread Siegfried Gevatter
2012/2/17 Michal Hruby michal.hr...@canonical.com:
 This is very close to public API, I'd prefer this didn't change, so if we 
 want a variant with a PtrArray, let's call it something else (for example 
 full_from_ptrarray)

I don't want PtrArray, it's just a workaround since Vala is br0ken.

 328     +    // FIXME: figure out how we want to treat multiple subjects in 
 the template
 Same way engine does, ie AND them within one event.

Yeah, that's not what I mean, but rather: if there's two empty
subjects, does that mean anything (ie. I want events with exactly two
subject) or are they just ignored? But I retract the question, the
former would just be confusing.

-- 
https://code.launchpad.net/~rainct/zeitgeist/matches-template/+merge/93279
Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist.

___
Mailing list: https://launchpad.net/~zeitgeist
Post to : zeitgeist@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zeitgeist
More help   : https://help.launchpad.net/ListHelp


Re: [Zeitgeist] [Merge] lp:~rainct/zeitgeist/matches-template into lp:zeitgeist

2012-02-17 Thread Michal Hruby
 I don't want PtrArray, it's just a workaround since Vala is br0ken.

Then don't add that method yet.
-- 
https://code.launchpad.net/~rainct/zeitgeist/matches-template/+merge/93279
Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist.

___
Mailing list: https://launchpad.net/~zeitgeist
Post to : zeitgeist@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zeitgeist
More help   : https://help.launchpad.net/ListHelp


[Zeitgeist] [Merge] lp:~rainct/zeitgeist/matches-template into lp:zeitgeist

2012-02-15 Thread Siegfried Gevatter
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