diff options
author | Seif Lotfy <seif@lotfy.com> | 2013-04-07 00:33:58 +0200 |
---|---|---|
committer | Seif Lotfy <seif@lotfy.com> | 2013-04-07 00:35:56 +0200 |
commit | c81d2a6afe40642b37a3ea454f274e1e6b7a4494 (patch) | |
tree | 9acb32c3ffe0153657183a9eeb71fc34160de5b8 | |
parent | dc7f3fb88713fdbac97c723b6b3dbd6390440ffd (diff) | |
download | zeitgeist-c81d2a6afe40642b37a3ea454f274e1e6b7a4494.tar.gz |
Use copies of event_templates to pass to threads to use with
search and search_with_relevancies
-rw-r--r-- | libzeitgeist/index.vala | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libzeitgeist/index.vala b/libzeitgeist/index.vala index c4e9e211..e19621a5 100644 --- a/libzeitgeist/index.vala +++ b/libzeitgeist/index.vala @@ -126,13 +126,17 @@ public class Index : QueuedProxyWrapper ResultType result_type, Cancellable? cancellable=null) throws Error { + var event_templates_cp = new GenericArray<Event> (); + for (int i = 0; i < event_templates.length; i++) + event_templates_cp.add(event_templates.get (i)); + yield wait_for_proxy (); Variant result; uint matches; yield proxy.search (query, time_range.to_variant (), - Events.to_variant (event_templates), offset, num_events, + Events.to_variant (event_templates_cp), offset, num_events, result_type, out result, out matches, cancellable); return new SimpleResultSet.with_num_matches ( @@ -179,6 +183,10 @@ public class Index : QueuedProxyWrapper Cancellable? cancellable=null, out double[] relevancies) throws Error { + var event_templates_cp = new GenericArray<Event> (); + for (int i = 0; i < event_templates.length; i++) + event_templates_cp.add(event_templates.get (i)); + yield wait_for_proxy (); Variant result; @@ -186,7 +194,7 @@ public class Index : QueuedProxyWrapper uint matches; yield proxy.search_with_relevancies (query, time_range.to_variant (), - Events.to_variant (event_templates), storage_state, offset, + Events.to_variant (event_templates_cp), storage_state, offset, num_events, result_type, out relevancies_variant, out result, out matches, cancellable); |