------------------------------------------------------------
revno: 356
committer: Seif Lotfy <s...@lotfy.com>
branch nick: zeitgeist
timestamp: Fri 2011-12-23 02:46:27 +0100
message:
  Added ForceReindex to the FTS proxy
modified:
  extensions/fts-python/fts.py
  extensions/fts.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-python/fts.py'
--- extensions/fts-python/fts.py	2011-11-02 16:15:18 +0000
+++ extensions/fts-python/fts.py	2011-12-23 01:46:27 +0000
@@ -235,7 +235,7 @@
         considered blessed public API.
         """
         log.debug ("Received ForceReindex request over DBus.")
-        self._indexer._queue.put (Reindex (self.engine))
+        self._indexer._queue.put (Reindex (self._indexer))
     
     def _make_events_sendable(self, events):
         return [NULL_EVENT if event is None else Event._make_dbus_sendable(event) for event in events]

=== modified file 'extensions/fts.vala'
--- extensions/fts.vala	2011-10-12 15:31:04 +0000
+++ extensions/fts.vala	2011-12-23 01:46:27 +0000
@@ -31,6 +31,7 @@
             [DBus (signature = "a(asaasay)")] Variant filter_templates,
             uint offset, uint count, uint result_type,
             [DBus (signature = "a(asaasay)")] out Variant events) throws Error;
+        public abstract void force_reindex () throws Error;
     }
 
     /* Because of a Vala bug we have to define the proxy interface outside of
@@ -101,6 +102,20 @@
             }
         }
 
+        public void force_reindex ()
+        {
+            if (siin == null || !(siin is DBusProxy))
+            {
+                // FIXME: queue until we have the proxy
+                throw new EngineError.DATABASE_ERROR (
+                    "Not connected to SimpleIndexer");
+            }
+            debug ("Reindexing");
+            DBusProxy proxy = (DBusProxy) siin;
+            proxy.call ("ForceReindex", null, 0, -1, null);
+        }
+
+
         /* This whole method is one huge workaround for an issue with Vala
          * enclosing all out/return parameters in a TUPLE variant */
         public async Variant search (string query_string, Variant time_range,

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

Reply via email to