← Back to team overview

zeitgeist team mailing list archive

[Branch ~zeitgeist/zeitgeist/bluebird] Rev 395: Add storage state parameter to the SearchWithRelevancies method

 

------------------------------------------------------------
revno: 395
committer: Michal Hruby <michal.mhr@xxxxxxxxx>
branch nick: bluebird
timestamp: Fri 2012-02-10 18:03:50 +0100
message:
  Add storage state parameter to the SearchWithRelevancies method
modified:
  extensions/fts++/fts.cpp
  extensions/fts++/fts.h
  extensions/fts++/fts.vapi
  extensions/fts++/indexer.cpp
  extensions/fts++/indexer.h
  extensions/fts++/zeitgeist-fts.vala
  extensions/fts.vala
  src/remote.vala


--
lp:zeitgeist
https://code.launchpad.net/~zeitgeist/zeitgeist/bluebird

Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist.
To unsubscribe from this branch go to https://code.launchpad.net/~zeitgeist/zeitgeist/bluebird/+edit-subscription
=== modified file 'extensions/fts++/fts.cpp'
--- extensions/fts++/fts.cpp	2012-02-09 18:34:36 +0000
+++ extensions/fts++/fts.cpp	2012-02-10 17:03:50 +0000
@@ -89,6 +89,7 @@
                                            const gchar *search_string,
                                            ZeitgeistTimeRange *time_range,
                                            GPtrArray *templates,
+                                           ZeitgeistStorageState storage_state,
                                            guint offset,
                                            guint count,
                                            ZeitgeistResultType result_type,
@@ -108,8 +109,8 @@
   _indexer = (ZeitgeistFTS::Controller*) indexer;
 
   results = _indexer->indexer->SearchWithRelevancies (
-      search_string, time_range, templates, offset, count, result_type,
-      relevancies, relevancies_size, matches, error);
+      search_string, time_range, templates, storage_state, offset, count,
+      result_type, relevancies, relevancies_size, matches, error);
 
   return results;
 }

=== modified file 'extensions/fts++/fts.h'
--- extensions/fts++/fts.h	2012-02-09 18:34:36 +0000
+++ extensions/fts++/fts.h	2012-02-10 17:03:50 +0000
@@ -48,6 +48,7 @@
                                                     const gchar *search_string,
                                                     ZeitgeistTimeRange *time_range,
                                                     GPtrArray *templates,
+                                                    ZeitgeistStorageState storage_state,
                                                     guint offset,
                                                     guint count,
                                                     ZeitgeistResultType result_type,

=== modified file 'extensions/fts++/fts.vapi'
--- extensions/fts++/fts.vapi	2012-02-09 18:34:36 +0000
+++ extensions/fts++/fts.vapi	2012-02-10 17:03:50 +0000
@@ -18,6 +18,7 @@
                                             string search_string,
                                             TimeRange time_range,
                                             GLib.GenericArray<Event> templates,
+                                            StorageState storage_state,
                                             uint offset,
                                             uint count,
                                             ResultType result_type,

=== modified file 'extensions/fts++/indexer.cpp'
--- extensions/fts++/indexer.cpp	2012-02-10 12:48:52 +0000
+++ extensions/fts++/indexer.cpp	2012-02-10 17:03:50 +0000
@@ -825,6 +825,7 @@
 GPtrArray* Indexer::SearchWithRelevancies (const gchar *search,
                                            ZeitgeistTimeRange *time_range,
                                            GPtrArray *templates,
+                                           ZeitgeistStorageState storage_state,
                                            guint offset,
                                            guint count,
                                            ZeitgeistResultType result_type,
@@ -849,6 +850,15 @@
       enquire->set_sort_by_value (VALUE_TIMESTAMP, true);
     }
 
+    if (storage_state != ZEITGEIST_STORAGE_STATE_ANY)
+    {
+      g_set_error_literal (error,
+                           ZEITGEIST_ENGINE_ERROR,
+                           ZEITGEIST_ENGINE_ERROR_INVALID_ARGUMENT,
+                           "Only ANY stogate state is supported");
+      return NULL;
+    }
+
     Xapian::Query q(query_parser->parse_query (query_string, QUERY_PARSER_FLAGS));
     enquire->set_query (q);
     Xapian::MSet hits (enquire->get_mset (offset, maxhits));

=== modified file 'extensions/fts++/indexer.h'
--- extensions/fts++/indexer.h	2012-02-10 12:48:52 +0000
+++ extensions/fts++/indexer.h	2012-02-10 17:03:50 +0000
@@ -88,6 +88,7 @@
   GPtrArray* SearchWithRelevancies (const gchar *search,
                                     ZeitgeistTimeRange *time_range,
                                     GPtrArray *templates,
+                                    ZeitgeistStorageState storage_state,
                                     guint offset,
                                     guint count,
                                     ZeitgeistResultType result_type,

=== modified file 'extensions/fts++/zeitgeist-fts.vala'
--- extensions/fts++/zeitgeist-fts.vala	2012-02-09 18:34:36 +0000
+++ extensions/fts++/zeitgeist-fts.vala	2012-02-10 17:03:50 +0000
@@ -135,7 +135,8 @@
         public async void search_with_relevancies (
                                   string query_string, Variant time_range,
                                   Variant filter_templates,
-                                  uint offset, uint count, uint result_type,
+                                  uint storage_state, uint offset,
+                                  uint count, uint result_type,
                                   out Variant events, out double[] relevancies,
                                   out uint matches)
             throws Error
@@ -143,8 +144,9 @@
             var tr = new TimeRange.from_variant (time_range);
             var templates = Events.from_variant (filter_templates);
             var results = instance.indexer.search_with_relevancies (
-                    query_string, tr, templates, offset, count,
-                    (ResultType) result_type, out relevancies, out matches);
+                    query_string, tr, templates, (StorageState) storage_state,
+                    offset, count, (ResultType) result_type,
+                    out relevancies, out matches);
 
             events = Events.to_variant (results);
         }

=== modified file 'extensions/fts.vala'
--- extensions/fts.vala	2012-02-10 09:35:31 +0000
+++ extensions/fts.vala	2012-02-10 17:03:50 +0000
@@ -35,7 +35,7 @@
             string query_string,
             [DBus (signature = "(xx)")] Variant time_range,
             [DBus (signature = "a(asaasay)")] Variant filter_templates,
-            uint offset, uint count, uint result_type,
+            uint storage_state, uint offset, uint count, uint result_type,
             [DBus (signature = "a(asaasay)")] out Variant events,
             out double[] relevancies,
             out uint matches) throws Error;
@@ -164,7 +164,8 @@
 
         public async void search_with_relevancies (
             string query_string, Variant time_range,
-            Variant filter_templates, uint offset, uint count, uint result_type,
+            Variant filter_templates, uint storage_state,
+            uint offset, uint count, uint result_type,
             out Variant events, out double[] relevancies, out uint matches)
             throws Error
         {
@@ -173,7 +174,7 @@
             var timer = new Timer ();
             yield siin.search_with_relevancies (
                 query_string, time_range, filter_templates,
-                offset, count, result_type,
+                storage_state, offset, count, result_type,
                 out events, out relevancies, out matches);
 
             debug ("Got %u[/%u] results from indexer (in %f seconds)",

=== modified file 'src/remote.vala'
--- src/remote.vala	2012-02-09 18:34:36 +0000
+++ src/remote.vala	2012-02-10 17:03:50 +0000
@@ -125,7 +125,7 @@
             string query_string,
             [DBus (signature = "(xx)")] Variant time_range,
             [DBus (signature = "a(asaasay)")] Variant filter_templates,
-            uint offset, uint count, uint result_type,
+            uint storage_state, uint offset, uint count, uint result_type,
             [DBus (signature = "a(asaasay)")] out Variant events,
             out double[] relevancies, out uint matches) throws Error;
     }