diff options
author | Seif Lotfy <seif@lotfy.com> | 2012-12-22 17:40:49 +0100 |
---|---|---|
committer | Seif Lotfy <seif@lotfy.com> | 2012-12-22 17:40:49 +0100 |
commit | 3256917c6b8fa295016f4c680e7c22f70bcad98d (patch) | |
tree | a5f65b6a4199f120246480a42bd854cca989f12b | |
parent | 6dd1918470d1d0a92671a9c2b0f2bf7bd1acc0f2 (diff) |
log.vala: Fix ownership of arugments due to new vala fix.
-rw-r--r-- | examples/python/get_events.py | 15 | ||||
-rw-r--r-- | libzeitgeist/log.vala | 12 |
2 files changed, 21 insertions, 6 deletions
diff --git a/examples/python/get_events.py b/examples/python/get_events.py new file mode 100644 index 00000000..943a30b3 --- /dev/null +++ b/examples/python/get_events.py @@ -0,0 +1,15 @@ +from gi.repository import Zeitgeist, GObject +log = Zeitgeist.Log.get_default() +mainloop = GObject.MainLoop() + +def callback (log, result, data): + events = log.get_events_finish(result) + print events.size() + for i in xrange(events.size()): + event = events.next_value() + if event: + print event.get_property("id") + mainloop.quit() + +log.get_events([x for x in xrange(200, 222)], None, callback, None) +mainloop.run() diff --git a/libzeitgeist/log.vala b/libzeitgeist/log.vala index c62d6663..1192b689 100644 --- a/libzeitgeist/log.vala +++ b/libzeitgeist/log.vala @@ -210,7 +210,7 @@ public class Log : QueuedProxyWrapper */ public async ResultSet find_events ( TimeRange time_range, - GenericArray<Event> event_templates, + owned GenericArray<Event> event_templates, StorageState storage_state, uint32 num_events, ResultType result_type, @@ -247,7 +247,7 @@ public class Log : QueuedProxyWrapper */ public async uint32[] find_event_ids ( TimeRange time_range, - GenericArray<Event> event_templates, + owned GenericArray<Event> event_templates, StorageState storage_state, uint32 num_events, ResultType result_type, @@ -276,7 +276,7 @@ public class Log : QueuedProxyWrapper * @param cancellable To cancel the operation or NULL */ public async ResultSet get_events ( - Array<uint32> event_ids, + owned Array<uint32> event_ids, Cancellable? cancellable=null) throws Error { uint32[] simple_event_ids = new uint32[event_ids.length]; @@ -304,8 +304,8 @@ public class Log : QueuedProxyWrapper */ public async string[] find_related_uris ( TimeRange time_range, - GenericArray<Event> event_templates, - GenericArray<Event> result_event_templates, + owned GenericArray<Event> event_templates, + owned GenericArray<Event> result_event_templates, StorageState storage_state, uint32 num_events, ResultType result_type, @@ -326,7 +326,7 @@ public class Log : QueuedProxyWrapper * * @param event_ids Array<uint32> */ - public async TimeRange delete_events (Array<uint32> event_ids, + public async TimeRange delete_events (owned Array<uint32> event_ids, Cancellable? cancellable=null) throws Error { yield wait_for_proxy (); |