zeitgeist team mailing list archive
-
zeitgeist team
-
Mailing list archive
-
Message #05369
[Branch ~zeitgeist/zeitgeist/bluebird] Rev 457: FTS++: Ignore Ubuntu One events
------------------------------------------------------------
revno: 457
committer: Siegfried-Angel Gevatter Pujals <siegfried@xxxxxxxxxxxx>
branch nick: bluebird
timestamp: Thu 2012-03-29 20:02:44 +0200
message:
FTS++: Ignore Ubuntu One events
See also:
https://wiki.ubuntu.com/UbuntuOne/Specs/ZeitgeistIntegration/EventsSpec
modified:
extensions/fts++/indexer.cpp
extensions/fts++/test/test-indexer.cpp
--
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++/indexer.cpp'
--- extensions/fts++/indexer.cpp 2012-03-26 16:43:07 +0000
+++ extensions/fts++/indexer.cpp 2012-03-29 18:02:44 +0000
@@ -1303,6 +1303,14 @@
void Indexer::IndexEvent (ZeitgeistEvent *event)
{
+ // Blacklist Ubuntu One events...
+ const gchar *actor;
+ actor = zeitgeist_event_get_actor (event);
+ if (strcmp(actor, "dbus://com.ubuntuone.SyncDaemon.service") == 0)
+ return;
+ if (strcmp(actor, "dbus://org.desktopcouch.CouchDB.service") == 0)
+ return;
+
try
{
const gchar *val;
=== modified file 'extensions/fts++/test/test-indexer.cpp'
--- extensions/fts++/test/test-indexer.cpp 2012-03-20 12:25:59 +0000
+++ extensions/fts++/test/test-indexer.cpp 2012-03-29 18:02:44 +0000
@@ -1074,6 +1074,23 @@
assert_nth_result_has_id (results, 2, event_id6);
}
+static void
+test_index_ignore_ubuntu_one (Fixture *fix, gconstpointer data)
+{
+ guint matches;
+
+ // add test events to DBs
+ index_event (fix, create_test_event_simple ("ubuntuone:uuid", "failme"));
+ ZeitgeistEvent *event = create_test_event_simple ("file:///nice%20uri", "failme");
+ zeitgeist_event_set_actor (event, "dbus://com.ubuntuone.SyncDaemon.service");
+ index_event (fix, event);
+
+ GPtrArray *results = search_simple (fix, "failme", NULL,
+ ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS, &matches);
+
+ g_assert_cmpuint (results->len, ==, 0);
+}
+
G_BEGIN_DECLS
static void discard_message (const gchar *domain,
@@ -1138,6 +1155,8 @@
g_test_add ("/Zeitgeist/FTS/Indexer/Query/MostPopularSubjects", Fixture, 0,
setup, test_query_most_popular_subjects, teardown);
*/
+ g_test_add ("/Zeitgeist/FTS/Indexer/Index/IgnoreUbuntuOne", Fixture, 0,
+ setup, test_index_ignore_ubuntu_one, teardown);
// get rid of the "rebuilding index..." messages
g_log_set_handler (NULL, G_LOG_LEVEL_MESSAGE, discard_message, NULL);