[Zeitgeist] [Merge] lp:~robert-ancell/activity-log-manager/time-combo-translation into lp:activity-log-manager

2015-01-11 Thread noreply
The proposal to merge 
lp:~robert-ancell/activity-log-manager/time-combo-translation into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~robert-ancell/activity-log-manager/time-combo-translation/+merge/204543
-- 
Your team Activity Log Manager is requested to review the proposed merge of 
lp:~robert-ancell/activity-log-manager/time-combo-translation into 
lp:activity-log-manager.

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


[Zeitgeist] [Merge] lp:~luolei/activity-log-manager/fix-1375598 into lp:activity-log-manager

2014-11-10 Thread noreply
The proposal to merge lp:~luolei/activity-log-manager/fix-1375598 into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~luolei/activity-log-manager/fix-1375598/+merge/241236
-- 
https://code.launchpad.net/~luolei/activity-log-manager/fix-1375598/+merge/241236
Your team Activity Log Manager is requested to review the proposed merge of 
lp:~luolei/activity-log-manager/fix-1375598 into lp:activity-log-manager.

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


[Zeitgeist] [Merge] lp:~jbicha/activity-log-manager/search-and-security-only-for-ccpanel into lp:activity-log-manager

2013-07-21 Thread noreply
The proposal to merge 
lp:~jbicha/activity-log-manager/search-and-security-only-for-ccpanel into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~jbicha/activity-log-manager/search-and-security-only-for-ccpanel/+merge/174119
-- 
https://code.launchpad.net/~jbicha/activity-log-manager/search-and-security-only-for-ccpanel/+merge/174119
Your team Activity Log Manager is subscribed to branch lp:activity-log-manager.

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


[Zeitgeist] [Merge] lp:~jbicha/activity-log-manager/add-apps-drop-spreadsheets-presentations into lp:activity-log-manager

2013-07-21 Thread noreply
The proposal to merge 
lp:~jbicha/activity-log-manager/add-apps-drop-spreadsheets-presentations into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~jbicha/activity-log-manager/add-apps-drop-spreadsheets-presentations/+merge/174096
-- 
https://code.launchpad.net/~jbicha/activity-log-manager/add-apps-drop-spreadsheets-presentations/+merge/174096
Your team Activity Log Manager is subscribed to branch lp:activity-log-manager.

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


[Zeitgeist] [Merge] lp:~ev/activity-log-manager/split-out-diagnostics-service into lp:activity-log-manager

2013-07-21 Thread noreply
The proposal to merge lp:~ev/activity-log-manager/split-out-diagnostics-service 
into lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~ev/activity-log-manager/split-out-diagnostics-service/+merge/175820
-- 
https://code.launchpad.net/~ev/activity-log-manager/split-out-diagnostics-service/+merge/175820
Your team Activity Log Manager is subscribed to branch lp:activity-log-manager.

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


[Zeitgeist] [Merge] lp:~jbicha/activity-log-manager/add-help-link into lp:activity-log-manager

2013-07-19 Thread noreply
The proposal to merge lp:~jbicha/activity-log-manager/add-help-link into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~jbicha/activity-log-manager/add-help-link/+merge/174292
-- 
https://code.launchpad.net/~jbicha/activity-log-manager/add-help-link/+merge/174292
Your team Activity Log Manager is subscribed to branch lp:activity-log-manager.

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


[Zeitgeist] [Merge] lp:~jbicha/activity-log-manager/fix-few-warnings into lp:activity-log-manager

2013-07-09 Thread noreply
The proposal to merge lp:~jbicha/activity-log-manager/fix-few-warnings into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~jbicha/activity-log-manager/fix-few-warnings/+merge/173626
-- 
https://code.launchpad.net/~jbicha/activity-log-manager/fix-few-warnings/+merge/173626
Your team Activity Log Manager is subscribed to branch lp:activity-log-manager.

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


[Zeitgeist] [Merge] lp:~jbicha/activity-log-manager/rename-standalone-title-too into lp:activity-log-manager

2013-07-09 Thread noreply
The proposal to merge 
lp:~jbicha/activity-log-manager/rename-standalone-title-too into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~jbicha/activity-log-manager/rename-standalone-title-too/+merge/173061
-- 
https://code.launchpad.net/~jbicha/activity-log-manager/rename-standalone-title-too/+merge/173061
Your team Activity Log Manager is subscribed to branch lp:activity-log-manager.

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


[Zeitgeist] [Merge] lp:~jbicha/activity-log-manager/fix-add-popup into lp:activity-log-manager

2013-07-09 Thread noreply
The proposal to merge lp:~jbicha/activity-log-manager/fix-add-popup into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~jbicha/activity-log-manager/fix-add-popup/+merge/173842
-- 
https://code.launchpad.net/~jbicha/activity-log-manager/fix-add-popup/+merge/173842
Your team Activity Log Manager is subscribed to branch lp:activity-log-manager.

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


[Zeitgeist] [Merge] lp:~jbicha/activity-log-manager/use-ellipsis into lp:activity-log-manager

2013-07-07 Thread noreply
The proposal to merge lp:~jbicha/activity-log-manager/use-ellipsis into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~jbicha/activity-log-manager/use-ellipsis/+merge/173092
-- 
https://code.launchpad.net/~jbicha/activity-log-manager/use-ellipsis/+merge/173092
Your team Activity Log Manager is subscribed to branch lp:activity-log-manager.

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


[Zeitgeist] [Merge] lp:~jbicha/activity-log-manager/rename-to-security-and-privacy into lp:activity-log-manager

2013-07-07 Thread noreply
The proposal to merge 
lp:~jbicha/activity-log-manager/rename-to-security-and-privacy into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~jbicha/activity-log-manager/rename-to-security-and-privacy/+merge/173296
-- 
https://code.launchpad.net/~jbicha/activity-log-manager/rename-to-security-and-privacy/+merge/173296
Your team Activity Log Manager is subscribed to branch lp:activity-log-manager.

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


[Zeitgeist] [Merge] lp:~jbicha/activity-log-manager/turn-off-recently-used-too into lp:activity-log-manager

2013-07-07 Thread noreply
The proposal to merge 
lp:~jbicha/activity-log-manager/turn-off-recently-used-too into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~jbicha/activity-log-manager/turn-off-recently-used-too/+merge/173383
-- 
https://code.launchpad.net/~jbicha/activity-log-manager/turn-off-recently-used-too/+merge/173383
Your team Activity Log Manager is subscribed to branch lp:activity-log-manager.

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


[Zeitgeist] [Merge] lp:~jbicha/activity-log-manager/clear-recently-used into lp:activity-log-manager

2013-07-07 Thread noreply
The proposal to merge lp:~jbicha/activity-log-manager/clear-recently-used into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~jbicha/activity-log-manager/clear-recently-used/+merge/173391
-- 
https://code.launchpad.net/~jbicha/activity-log-manager/clear-recently-used/+merge/173391
Your team Activity Log Manager is subscribed to branch lp:activity-log-manager.

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


[Zeitgeist] [Merge] lp:~jbicha/activity-log-manager/add-search-tab into lp:activity-log-manager

2013-07-07 Thread noreply
The proposal to merge lp:~jbicha/activity-log-manager/add-search-tab into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~jbicha/activity-log-manager/add-search-tab/+merge/173393
-- 
https://code.launchpad.net/~jbicha/activity-log-manager/add-search-tab/+merge/173393
Your team Activity Log Manager is subscribed to branch lp:activity-log-manager.

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


[Zeitgeist] [Merge] lp:~ev/activity-log-manager/1192777 into lp:activity-log-manager

2013-06-27 Thread noreply
The proposal to merge lp:~ev/activity-log-manager/1192777 into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~ev/activity-log-manager/1192777/+merge/171839
-- 
https://code.launchpad.net/~ev/activity-log-manager/1192777/+merge/171839
Your team Activity Log Manager is subscribed to branch lp:activity-log-manager.

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


[Zeitgeist] [Merge] lp:~zeitgeist/zeitgeist/saucy-packaging-0-9-14 into lp:ubuntu/zeitgeist

2013-06-25 Thread noreply
The proposal to merge lp:~zeitgeist/zeitgeist/saucy-packaging-0-9-14 into 
lp:ubuntu/zeitgeist has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~zeitgeist/zeitgeist/saucy-packaging-0-9-14/+merge/170244
-- 
https://code.launchpad.net/~zeitgeist/zeitgeist/saucy-packaging-0-9-14/+merge/170244
Your team Zeitgeist Framework Team is subscribed to branch 
lp:~zeitgeist/zeitgeist/saucy-packaging-0-9-14.

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


[Zeitgeist] [Merge] lp:~ev/activity-log-manager/add-whoopsie-back into lp:activity-log-manager

2013-06-19 Thread noreply
The proposal to merge lp:~ev/activity-log-manager/add-whoopsie-back into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~ev/activity-log-manager/add-whoopsie-back/+merge/169855
-- 
https://code.launchpad.net/~ev/activity-log-manager/add-whoopsie-back/+merge/169855
Your team Activity Log Manager is subscribed to branch lp:activity-log-manager.

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


[Zeitgeist] [Merge] lp:~jbicha/activity-log-manager/tweak-include-names into lp:activity-log-manager

2013-06-19 Thread noreply
The proposal to merge lp:~jbicha/activity-log-manager/tweak-include-names into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~jbicha/activity-log-manager/tweak-include-names/+merge/168318
-- 
https://code.launchpad.net/~jbicha/activity-log-manager/tweak-include-names/+merge/168318
Your team Activity Log Manager is requested to review the proposed merge of 
lp:~jbicha/activity-log-manager/tweak-include-names into 
lp:activity-log-manager.

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


[Zeitgeist] [Merge] lp:~jbicha/activity-log-manager/capitalize-Clear-Usage-Data into lp:activity-log-manager

2013-06-19 Thread noreply
The proposal to merge 
lp:~jbicha/activity-log-manager/capitalize-Clear-Usage-Data into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~jbicha/activity-log-manager/capitalize-Clear-Usage-Data/+merge/168317
-- 
https://code.launchpad.net/~jbicha/activity-log-manager/capitalize-Clear-Usage-Data/+merge/168317
Your team Activity Log Manager is subscribed to branch lp:activity-log-manager.

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


[Zeitgeist] [Merge] lp:~jbicha/activity-log-manager/use-exclude into lp:activity-log-manager

2013-06-19 Thread noreply
The proposal to merge lp:~jbicha/activity-log-manager/use-exclude into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~jbicha/activity-log-manager/use-exclude/+merge/168316
-- 
https://code.launchpad.net/~jbicha/activity-log-manager/use-exclude/+merge/168316
Your team Activity Log Manager is requested to review the proposed merge of 
lp:~jbicha/activity-log-manager/use-exclude into lp:activity-log-manager.

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


[Zeitgeist] [Merge] lp:~malizor/activity-log-manager/fix-967150 into lp:activity-log-manager

2012-12-06 Thread noreply
The proposal to merge lp:~malizor/activity-log-manager/fix-967150 into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~malizor/activity-log-manager/fix-967150/+merge/125556
-- 
https://code.launchpad.net/~malizor/activity-log-manager/fix-967150/+merge/125556
Your team Activity Log Manager is subscribed to branch lp:activity-log-manager.

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 467: Release Bluebird (Zeitgeist 0.9)!

2012-04-10 Thread noreply

revno: 467
tags: 0.9.0
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Tue 2012-04-10 15:32:55 +0200
message:
  Release Bluebird (Zeitgeist 0.9)!
modified:
  NEWS
  configure.ac


--
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 'NEWS'
--- NEWS	2012-04-07 12:58:47 +
+++ NEWS	2012-04-10 13:32:55 +
@@ -1,4 +1,4 @@
-2012-04-07: Zeitgeist 0.9
+2012-04-10: Zeitgeist 0.9
 -
 
 Engine:

=== modified file 'configure.ac'
--- configure.ac	2012-04-07 12:58:47 +
+++ configure.ac	2012-04-10 13:32:55 +
@@ -1,4 +1,4 @@
-AC_INIT([zeitgeist], [0.9.0~rc1], [d...@lists.zeitgeist-project.com], [zeitgeist])
+AC_INIT([zeitgeist], [0.9.0], [d...@lists.zeitgeist-project.com], [zeitgeist])
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS(config.h)
 AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip])

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 466: Update NEWS.

2012-04-07 Thread noreply

revno: 466
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Sat 2012-04-07 14:58:47 +0200
message:
  Update NEWS.
modified:
  NEWS
  configure.ac


--
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 'NEWS'
--- NEWS	2012-03-20 16:36:59 +
+++ NEWS	2012-04-07 12:58:47 +
@@ -1,8 +1,22 @@
-2012-XX-XX: Zeitgeist Bluebird Beta 2
+2012-04-07: Zeitgeist 0.9
 -
 
 Engine:
  - Updated the list of recognized MIME-types.
+ - Set a size limit (4MiB) on the results returned by individual FindEvents and
+   GetEvents calls. Too big queries will result in an exception.
+ - Improved handling of FTS not being present (Beta 1 would leak memory).
+ - Enhanced database corruption detection and recovery.
+ - DataSourceRegistry: don't ignore bus addresses that registered more than
+   one data-source if one of them is disabled.
+
+FTS:
+ - Added a build-time option to disable FTS.
+ - The index is now automatically re-build if it gets corrupted.
+ - The index is now automatically re-build if the Zeitgeist DB is re-created.
+ - Split the reindex query into several smaller ones, for enhanced performance.
+ - Quit when Zeitgeist leaves the bus.
+ - Ignore events from Ubuntu One.
 
 Python API:
  - Updated the list of recognized MIME-types.

=== modified file 'configure.ac'
--- configure.ac	2012-03-29 10:54:52 +
+++ configure.ac	2012-04-07 12:58:47 +
@@ -1,4 +1,4 @@
-AC_INIT([zeitgeist], [0.8.99~beta1], [d...@lists.zeitgeist-project.com], [zeitgeist])
+AC_INIT([zeitgeist], [0.9.0~rc1], [d...@lists.zeitgeist-project.com], [zeitgeist])
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS(config.h)
 AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip])

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 465: Merge lp:~rainct/zeitgeist/rebuild-fts-on-new-db

2012-04-06 Thread noreply
Merge authors:
  Siegfried Gevatter (rainct)
Related merge proposals:
  
https://code.launchpad.net/~rainct/zeitgeist/rebuild-fts-on-new-db/+merge/101024
  proposed by: Siegfried Gevatter (rainct)
  review: Needs Fixing - Michal Hruby (mhr3)

revno: 465 [merge]
committer: Michal Hruby michal@gmail.com
branch nick: zeitgeist
timestamp: Fri 2012-04-06 10:43:18 +0200
message:
  Merge lp:~rainct/zeitgeist/rebuild-fts-on-new-db
modified:
  extensions/fts++/controller.cpp
  extensions/fts++/indexer.cpp
  extensions/fts++/indexer.h
  src/sql-schema.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++/controller.cpp'
--- extensions/fts++/controller.cpp	2012-04-03 18:40:44 +
+++ extensions/fts++/controller.cpp	2012-04-06 08:43:18 +
@@ -81,6 +81,11 @@
 
 // Set the db metadata key only once we're done
 PushTask (new MetadataTask (fts_index_version, INDEX_VERSION));
+gint64 zg_creation_date = indexer-GetZeitgeistCreationDate ();
+gchar *creation = g_strdup_printf (% G_GINT64_FORMAT, zg_creation_date);
+std::string zg_creation_date_str (creation);
+PushTask (new MetadataTask (zg_db_creation_date, zg_creation_date_str));
+g_free (creation);
   }
 
   g_object_unref (time_range);

=== modified file 'extensions/fts++/indexer.cpp'
--- extensions/fts++/indexer.cpp	2012-04-03 18:40:44 +
+++ extensions/fts++/indexer.cpp	2012-04-05 22:34:51 +
@@ -146,6 +146,14 @@
   }
 }
 
+gint64 Indexer::GetZeitgeistCreationDate ()
+{
+  ZeitgeistSQLiteDatabase *database = zeitgeist_db_reader_get_database (
+  zg_reader);
+  return zeitgeist_sq_lite_database_schema_get_creation_date (
+  database-database);
+}
+
 /**
  * Returns true if and only if the index is good.
  * Otherwise the index should be rebuild.
@@ -164,6 +172,24 @@
 return false;
   }
 
+  // Get stored Zeitgeist DB creation date
+  gint64 metadata_date;
+  std::string metadata_date_str (db-get_metadata (zg_db_creation_date));
+  if (metadata_date_str.empty ())
+metadata_date = -1;
+  else
+metadata_date = g_ascii_strtoll (metadata_date_str.c_str (), NULL, 0);
+
+  // In case the Zeitgeist DB is newer than Xapian, we need to re-build.
+  // This may happen if the Zeitgeist DB gets corrupt and is re-created
+  // from scratch.
+  gint64 database_creation_date = GetZeitgeistCreationDate ();
+  if (database_creation_date != metadata_date)
+  {
+g_message (Zeitgeist database has been replaced. Doing full rebuild);
+return false;
+  }
+
   return true;
 }
 

=== modified file 'extensions/fts++/indexer.h'
--- extensions/fts++/indexer.h	2012-04-03 19:01:28 +
+++ extensions/fts++/indexer.h	2012-04-05 19:08:10 +
@@ -80,6 +80,7 @@
   void IndexEvent (ZeitgeistEvent *event);
   void DeleteEvent (guint32 event_id);
   void SetDbMetadata (std::string const key, std::string const value);
+  gint64 GetZeitgeistCreationDate ();
 
   GPtrArray* Search (const gchar *search,
  ZeitgeistTimeRange *time_range,

=== modified file 'src/sql-schema.vala'
--- src/sql-schema.vala	2012-04-05 12:12:49 +
+++ src/sql-schema.vala	2012-04-05 20:07:23 +
@@ -38,6 +38,8 @@
 public const string CORE_SCHEMA = core;
 public const int CORE_SCHEMA_VERSION = 6;
 
+private const string DATABASE_CREATION = database_creation;
+
 public static void ensure_schema (Sqlite.Database database)
 throws EngineError
 {
@@ -48,6 +50,12 @@
 {
 // most likely a new DB
 create_schema (database);
+
+// set database creation date
+var schema_sql = (INSERT INTO schema_version VALUES ('%s', % +
+int64.FORMAT + )).printf (DATABASE_CREATION,
+Timestamp.now ());
+exec_query (database, schema_sql);
 }
 else if (schema_version == 4 || schema_version == 5)
 {
@@ -123,28 +131,44 @@
 public static int get_schema_version (Sqlite.Database database)
 throws EngineError
 {
-  var sql = SELECT version FROM schema_version WHERE schema='core';
-  int schema_version = -1;
-  database.exec (sql,
-  (n_cols, values, column_names) =
-  {
-  if (values[0] != null)
-  {
-  schema_version = int.parse (values[0]);
-  }
-  return 0;
-  }, null);
-
-  // we don't really care about the return value of exec, the result
-  // will be -1 if something went wrong anyway
-  debug (schema_version is %d, schema_version);
-
-  if 

[Zeitgeist] [Merge] lp:~rainct/zeitgeist/rebuild-fts-on-new-db into lp:zeitgeist

2012-04-06 Thread noreply
The proposal to merge lp:~rainct/zeitgeist/rebuild-fts-on-new-db into 
lp:zeitgeist has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~rainct/zeitgeist/rebuild-fts-on-new-db/+merge/101024
-- 
https://code.launchpad.net/~rainct/zeitgeist/rebuild-fts-on-new-db/+merge/101024
Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist.

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


[Zeitgeist] [Merge] lp:~mefrio-g/activity-log-manager/switchboard-plug into lp:activity-log-manager

2012-04-06 Thread noreply
The proposal to merge lp:~mefrio-g/activity-log-manager/switchboard-plug into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~mefrio-g/activity-log-manager/switchboard-plug/+merge/99189
-- 
https://code.launchpad.net/~mefrio-g/activity-log-manager/switchboard-plug/+merge/99189
Your team Activity Log Manager is requested to review the proposed merge of 
lp:~mefrio-g/activity-log-manager/switchboard-plug into lp:activity-log-manager.

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 461: Enhanced database corruption detection and recovery.

2012-04-05 Thread noreply

revno: 461
fixes bug: https://launchpad.net/bugs/961974
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Thu 2012-04-05 14:12:49 +0200
message:
  Enhanced database corruption detection and recovery.
modified:
  extensions/histogram.vala
  src/db-reader.vala
  src/engine.vala
  src/extension-store.vala
  src/sql-schema.vala
  src/sql.vala
  src/table-lookup.vala
  src/utils.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/histogram.vala'
--- extensions/histogram.vala	2011-12-07 12:17:29 +
+++ extensions/histogram.vala	2012-04-05 12:12:49 +
@@ -96,14 +96,8 @@
 
 builder.add ((xu), t, count);
 }
-
-if (rc != Sqlite.DONE)
-{
-string error_message = Error in get_histogram_data:  +
-%d, %s.printf (rc, db.errmsg ());
-warning (%s, error_message);
-throw new EngineError.DATABASE_ERROR (error_message);
-}
+database.assert_query_success (rc, Error in get_histogram_data,
+Sqlite.DONE);
 
 return builder.end ();
 }

=== modified file 'src/db-reader.vala'
--- src/db-reader.vala	2012-03-19 19:56:38 +
+++ src/db-reader.vala	2012-04-05 12:12:49 +
@@ -55,13 +55,22 @@
 database.set_deletion_callback (delete_from_cache);
 db = database.database;
 
-interpretations_table = new TableLookup (database, interpretation);
-manifestations_table = new TableLookup (database, manifestation);
-mimetypes_table = new TableLookup (database, mimetype);
-actors_table = new TableLookup (database, actor);
+try
+{
+interpretations_table = new TableLookup (database, interpretation);
+manifestations_table = new TableLookup (database, manifestation);
+mimetypes_table = new TableLookup (database, mimetype);
+actors_table = new TableLookup (database, actor);
+}
+catch (EngineError err)
+{
+// FIXME: propagate this properly?
+critical (TableLookup initialization failed: %s, err.message);
+}
 }
 
 protected Event get_event_from_row (Sqlite.Statement stmt, uint32 event_id)
+throws EngineError
 {
 Event event = new Event ();
 event.id = event_id;
@@ -88,6 +97,7 @@
 }
 
 protected Subject get_subject_from_row (Sqlite.Statement stmt)
+throws EngineError
 {
 Subject subject = new Subject ();
 subject.uri = stmt.column_text (EventViewRows.SUBJECT_URI);
@@ -142,11 +152,7 @@
 Subject subject = get_subject_from_row(stmt);
 event.add_subject(subject);
 }
-if (rc != Sqlite.DONE)
-{
-throw new EngineError.DATABASE_ERROR (Error: %d, %s\n,
-rc, db.errmsg ());
-}
+database.assert_query_success (rc, Error, Sqlite.DONE);
 
 // Sort events according to the sequence of event_ids
 var results = new GenericArrayEvent? ();
@@ -270,7 +276,7 @@
 warning (error_message);
 throw new EngineError.INVALID_ARGUMENT (error_message);
 }
-
+
 // complete the sort rule
 bool time_asc = ResultType.is_sort_order_asc ((ResultType) result_type);
 sql +=  timestamp %s.printf ((time_asc) ? ASC : DESC);
@@ -306,6 +312,7 @@
 string error_message = Error in find_event_ids: %d, %s.printf (
 rc, db.errmsg ());
 warning (error_message);
+database.assert_not_corrupt (rc);
 throw new EngineError.DATABASE_ERROR (error_message);
 }
 
@@ -458,14 +465,7 @@
 // for (int i=0; irelated_uris.length; i++)
 //related_uris[i] = temp_related_uris[i];
 
-if (rc != Sqlite.DONE)
-{
-string error_message =
-Error in find_related_uris: %d, %s.printf (
-rc, db.errmsg ());
-warning (error_message);
-throw new EngineError.DATABASE_ERROR (error_message);
-}
+database.assert_query_success (rc, Error in find_related_uris);
 
 var uri_counter = new HashTablestring, RelatedUri?(
 str_hash, str_equal);

=== modified file 'src/engine.vala'
--- src/engine.vala	2012-03-14 14:26:11 +
+++ src/engine.vala	2012-04-05 12:12:49 +
@@ -241,6 +241,7 @@
 if ((rc = insert_stmt.step()) != Sqlite.DONE) {
 if (rc != Sqlite.CONSTRAINT)
 {
+

[Zeitgeist] [Merge] lp:~rainct/zeitgeist/961974 into lp:zeitgeist

2012-04-05 Thread noreply
The proposal to merge lp:~rainct/zeitgeist/961974 into lp:zeitgeist has been 
updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~rainct/zeitgeist/961974/+merge/100946
-- 
https://code.launchpad.net/~rainct/zeitgeist/961974/+merge/100946
Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist.

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 462: Fix typo.

2012-04-05 Thread noreply

revno: 462
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Thu 2012-04-05 14:43:45 +0200
message:
  Fix typo.
modified:
  src/extension-store.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 'src/extension-store.vala'
--- src/extension-store.vala	2012-04-05 12:12:49 +
+++ src/extension-store.vala	2012-04-05 12:43:45 +
@@ -109,7 +109,7 @@
 {
 database.assert_not_corrupt (rc);
 }
-catch (EngineError) { }
+catch (EngineError err) { }
 warning (SQL error: %d, %s, rc, db.errmsg ());
 }
 return null;

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 463: Some fixes for lp:~rainct/zeitgeist/961974

2012-04-05 Thread noreply

revno: 463
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Thu 2012-04-05 14:59:44 +0200
message:
  Some fixes for lp:~rainct/zeitgeist/961974
modified:
  src/db-reader.vala
  src/table-lookup.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 'src/db-reader.vala'
--- src/db-reader.vala	2012-04-05 12:12:49 +
+++ src/db-reader.vala	2012-04-05 12:59:44 +
@@ -465,7 +465,8 @@
 // for (int i=0; irelated_uris.length; i++)
 //related_uris[i] = temp_related_uris[i];
 
-database.assert_query_success (rc, Error in find_related_uris);
+database.assert_query_success (rc, Error in find_related_uris,
+Sqlite.DONE);
 
 var uri_counter = new HashTablestring, RelatedUri?(
 str_hash, str_equal);

=== modified file 'src/table-lookup.vala'
--- src/table-lookup.vala	2012-04-05 12:12:49 +
+++ src/table-lookup.vala	2012-04-05 12:59:44 +
@@ -94,7 +94,8 @@
 insertion_stmt.reset ();
 insertion_stmt.bind_text (1, name);
 rc = insertion_stmt.step ();
-database.assert_query_success (rc, Error in id_for_string);
+database.assert_query_success (rc, Error in id_for_string,
+Sqlite.DONE);
 
 id = (int) db.last_insert_rowid ();
 
@@ -127,7 +128,8 @@
 value_to_id.insert (text, id);
 rc = retrieval_stmt.step ();
 }
-database.assert_query_success (rc, Error in get_value);
+database.assert_query_success (rc, Error in get_value,
+Sqlite.DONE);
 if (text == null)
 {
 critical (Error getting data from table: %d, %s\n,

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 460: We can't auto-discard events from disabled data sources based on bus address, cause there can be ...

2012-04-04 Thread noreply

revno: 460
committer: Michal Hruby michal@gmail.com
branch nick: zeitgeist
timestamp: Wed 2012-04-04 19:25:15 +0200
message:
  We can't auto-discard events from disabled data sources based on bus address, 
cause there can be multiple sources registered for the same address - fixes an 
issue with datahub
modified:
  extensions/ds-registry.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/ds-registry.vala'
--- extensions/ds-registry.vala	2012-03-26 18:12:03 +
+++ extensions/ds-registry.vala	2012-04-04 17:25:15 +
@@ -166,8 +166,10 @@
 
 class DataSourceRegistry: Extension, RemoteRegistry
 {
+private const string MULTIPLE_MARKER = multiple;
 private HashTablestring, DataSource sources;
-private HashTablestring, GenericArrayBusName running;
+private HashTablestring, GenericArrayBusName running_ds;
+private HashTablestring, string bus_name_2_ds;
 private uint registration_id;
 private bool dirty;
 
@@ -180,7 +182,8 @@
 
 construct
 {
-running = new HashTablestring, GenericArrayBusName?(
+bus_name_2_ds = new HashTablestring, string (str_hash, str_equal);
+running_ds = new HashTablestring, GenericArrayBusName?(
 str_hash, str_equal);
 
 Variant? registry = retrieve_config (registry,
@@ -272,15 +275,26 @@
 }
 
 
-var sender_array = running.lookup (unique_id);
+var sender_array = running_ds.lookup (unique_id);
 if (sender_array == null)
 {
-running.insert (unique_id, new GenericArrayBusName?());
-running.lookup (unique_id).add (sender);
-}
-else if (is_sender_known (sender, sender_array))
-{
-running.lookup (unique_id).add (sender);
+sender_array = new GenericArrayBusName?();
+sender_array.add (sender);
+running_ds.insert (unique_id, sender_array);
+}
+else if (!is_sender_known (sender, sender_array))
+{
+sender_array.add (sender);
+}
+
+unowned string ds_id = bus_name_2_ds.lookup (sender);
+if (ds_id == null)
+{
+bus_name_2_ds.insert (sender, unique_id);
+}
+else if (ds_id != unique_id  ds_id != MULTIPLE_MARKER)
+{
+bus_name_2_ds.insert (sender, MULTIPLE_MARKER);
 }
 
 unowned DataSource? ds = sources.lookup (unique_id);
@@ -350,17 +364,21 @@
 public override void pre_insert_events (GenericArrayEvent? events,
 BusName? sender)
 {
-foreach (string unique_id in running.get_keys())
+foreach (unowned string unique_id in running_ds.get_keys())
 {
-GenericArrayBusName? bus_names = running.lookup (unique_id);
+GenericArrayBusName? bus_names = running_ds.lookup (unique_id);
 if (is_sender_known (sender, bus_names))
 {
 var data_source = sources.lookup (unique_id);
 
-data_source.timestamp =  Timestamp.now ();
+data_source.timestamp = Timestamp.now ();
 dirty = true;
 
-if (!data_source.enabled)
+// if one sender registers multiple unique data sources,
+// we have to rely that it's the correct thing, otherwise
+// we can just ignore the events
+unowned string ds_id = bus_name_2_ds.lookup (sender);
+if (!data_source.enabled  ds_id != MULTIPLE_MARKER)
 {
 for (int i = 0; i  events.length; i++)
 events[i] = null;
@@ -386,7 +404,7 @@
 var disconnected_ds = new GenericArrayDataSource ();
 {
 var iter = HashTableIterstring, GenericArrayBusName? (
-running);
+running_ds);
 unowned string uid;
 unowned GenericArrayBusName name_arr;
 while (iter.next (out uid, out name_arr))
@@ -414,11 +432,11 @@
 ds.timestamp = Timestamp.now ();
 dirty = true;
 
-if (running.lookup (uid).length == 0)
+if (running_ds.lookup (uid).length == 0)
 {
 debug (No remaining client running: %s [%s],
 ds.name, uid);
-running.remove (uid);
+

[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 458: FTS++: Ubuntu One events blacklist:

2012-04-03 Thread noreply

revno: 458
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Tue 2012-04-03 20:40:44 +0200
message:
  FTS++: Ubuntu One events blacklist:
   - Move blacklist check to separate function.
   - Exclude blacklisted events from the Zeitgeist query when reindexing.
   - Add environment variable to disable blacklisting.
modified:
  extensions/fts++/controller.cpp
  extensions/fts++/indexer.cpp
  extensions/fts++/indexer.h
  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++/controller.cpp'
--- extensions/fts++/controller.cpp	2012-03-26 15:09:54 +
+++ extensions/fts++/controller.cpp	2012-04-03 18:40:44 +
@@ -39,9 +39,23 @@
   GError *error = NULL;
   guint32 *event_ids;
   gint event_ids_size;
-  GPtrArray *templates = g_ptr_array_new ();
+  GPtrArray *templates = g_ptr_array_new_with_free_func (g_object_unref);
+  ZeitgeistEvent *event;
   ZeitgeistTimeRange *time_range = zeitgeist_time_range_new_anytime ();
 
+  if (g_getenv (ZEITGEIST_FTS_DISABLE_EVENT_BLACKLIST) == NULL)
+  {
+// Blacklist Ubuntu One events...
+
+event = zeitgeist_event_new ();
+zeitgeist_event_set_actor (event, !dbus://com.ubuntuone.SyncDaemon.service);
+g_ptr_array_add (templates, event);
+
+event = zeitgeist_event_new ();
+zeitgeist_event_set_actor (event, !dbus://org.desktopcouch.CouchDB.service);
+g_ptr_array_add (templates, event);
+  }
+
   g_debug (asking reader for all events);
   event_ids = zeitgeist_db_reader_find_event_ids (zg_reader,
   time_range,

=== modified file 'extensions/fts++/indexer.cpp'
--- extensions/fts++/indexer.cpp	2012-03-29 18:02:44 +
+++ extensions/fts++/indexer.cpp	2012-04-03 18:40:44 +
@@ -1301,14 +1301,23 @@
   g_assert (digest_size == NULL || *digest_size == HASH_LENGTH);
 }
 
-void Indexer::IndexEvent (ZeitgeistEvent *event)
+static bool
+CheckEventBlacklisted (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)
+  if (g_strcmp0(actor, dbus://com.ubuntuone.SyncDaemon.service) == 0)
+return true;
+  if (g_strcmp0(actor, dbus://org.desktopcouch.CouchDB.service) == 0)
+return true;
+
+  return false;
+}
+
+void Indexer::IndexEvent (ZeitgeistEvent *event)
+{
+  if (blacklisting_enabled and CheckEventBlacklisted (event))
 return;
 
   try

=== modified file 'extensions/fts++/indexer.h'
--- extensions/fts++/indexer.h	2012-03-19 21:42:52 +
+++ extensions/fts++/indexer.h	2012-04-03 18:40:44 +
@@ -48,6 +48,7 @@
   {
 const gchar *home_dir = g_get_home_dir ();
 home_dir_path = home_dir != NULL ? home_dir : /home;
+blacklisting_enabled = g_getenv (ZEITGEIST_FTS_DISABLE_EVENT_BLACKLIST) == NULL;
   }
 
   ~Indexer ()
@@ -129,6 +130,7 @@
 
   guint clear_failed_id;
   std::string   home_dir_path;
+  bool  blacklisting_enabled;
 };
 
 }

=== modified file 'extensions/fts++/test/test-indexer.cpp'
--- extensions/fts++/test/test-indexer.cpp	2012-03-29 18:02:44 +
+++ extensions/fts++/test/test-indexer.cpp	2012-04-03 18:40:44 +
@@ -270,6 +270,15 @@
   return event;
 }
 
+static void
+process_pending (Fixture *fix)
+{
+  while (zeitgeist_indexer_has_pending_tasks (fix-indexer))
+  {
+zeitgeist_indexer_process_task (fix-indexer);
+  }
+}
+
 // Steals the event, ref it if you want to keep it
 static guint
 index_event (Fixture *fix, ZeitgeistEvent *event)
@@ -295,10 +304,7 @@
   zeitgeist_indexer_index_events (fix-indexer, events);
   g_ptr_array_unref (events);
 
-  while (zeitgeist_indexer_has_pending_tasks (fix-indexer))
-  {
-zeitgeist_indexer_process_task (fix-indexer);
-  }
+  process_pending (fix);
 
   // sleep for 1 msec to make sure the next event will have a
   // different timestamp
@@ -1078,17 +1084,36 @@
 test_index_ignore_ubuntu_one (Fixture *fix, gconstpointer data)
 {
   guint matches;
+  ZeitgeistEvent *event;
+  GPtrArray *results;
 
   // 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);
+  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,
+  results = search_simple (fix, failme, NULL,
   

[Zeitgeist] [Merge] lp:~rainct/zeitgeist/ignore-ubuntuone-actor into lp:zeitgeist

2012-04-03 Thread noreply
The proposal to merge lp:~rainct/zeitgeist/ignore-ubuntuone-actor into 
lp:zeitgeist has been updated.

Status: Approved = Merged

For more details, see:
https://code.launchpad.net/~rainct/zeitgeist/ignore-ubuntuone-actor/+merge/99986
-- 
https://code.launchpad.net/~rainct/zeitgeist/ignore-ubuntuone-actor/+merge/99986
Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist.

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 455: Make FTS++ optional.

2012-03-29 Thread noreply
Merge authors:
  Moritz Neeb (zormit)
Related merge proposals:
  https://code.launchpad.net/~zormit/zeitgeist/fix-932989/+merge/98760
  proposed by: Moritz Neeb (zormit)
  review: Approve - Michal Hruby (mhr3)
  review: Resubmit - Moritz Neeb (zormit)

revno: 455 [merge]
committer: Seif Lotfy s...@lotfy.com
branch nick: zeitgeist
timestamp: Thu 2012-03-29 12:54:52 +0200
message:
   Make FTS++ optional.
  * Make the fts.vala extension behave if FTS++ isn't there.
modified:
  configure.ac
  extensions/Makefile.am
  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 'configure.ac'
--- configure.ac	2012-03-20 12:29:29 +
+++ configure.ac	2012-03-29 10:54:52 +
@@ -80,6 +80,16 @@
 DBUS_SERVICES_DIR=$services_dir
 AC_SUBST(DBUS_SERVICES_DIR)
 
+
+#
+# Configure options: --disable-fts.
+#
+AC_ARG_ENABLE([fts],
+AS_HELP_STRING([--disable-fts], [Build without FTS++ extension]),
+[enable_fts=$enableval],[enable_fts=yes])
+
+AM_CONDITIONAL(HAVE_FTS, test x$enable_fts != xno)
+
 AC_CONFIG_FILES([
 	Makefile
 	src/Makefile
@@ -131,6 +141,7 @@
 Install Prefix: ${prefix}
 
   Optional dependencies
+fts++:  ${enable_fts}
 dee-icu:${with_dee_icu}
 
 EOF

=== modified file 'extensions/Makefile.am'
--- extensions/Makefile.am	2012-02-15 18:27:21 +
+++ extensions/Makefile.am	2012-03-15 21:36:10 +
@@ -1,4 +1,6 @@
+if HAVE_FTS
 SUBDIRS = fts++
+endif
 
 NULL =
 

=== modified file 'extensions/fts.vala'
--- extensions/fts.vala	2012-02-10 17:03:50 +
+++ extensions/fts.vala	2012-03-26 20:49:32 +
@@ -95,24 +95,22 @@
 
 // FIXME: shouldn't we delay this to next idle callback?
 // Get SimpleIndexer
-Bus.watch_name_on_connection (connection,
+connection.get_proxy.beginRemoteSimpleIndexer (
 INDEXER_NAME,
-BusNameWatcherFlags.AUTO_START,
-(conn) =
-{
-if (siin != null) return;
-conn.get_proxy.beginRemoteSimpleIndexer (
-org.gnome.zeitgeist.SimpleIndexer,
-/org/gnome/zeitgeist/index/activity,
-0, null, this.proxy_acquired);
-},
-() = {});
+/org/gnome/zeitgeist/index/activity,
+0, null, this.proxy_acquired);
 }
 catch (Error err)
 {
 warning (%s, err.message);
 }
 }
+
+private void proxy_not_present()
+{
+notifier.remove_monitor (new BusName (INDEXER_NAME),/org/gnome/zeitgeist/monitor/special);
+this.unload();
+}
 
 private void proxy_acquired (Object? obj, AsyncResult res)
 {
@@ -120,7 +118,15 @@
 try
 {
 siin = conn.get_proxy.endRemoteSimpleIndexer (res);
-siin_connection_failed = false;
+if((siin as DBusProxy).g_name_owner == null)
+{
+this.proxy_not_present();
+siin_connection_failed = true;
+}
+else
+{
+siin_connection_failed = false;
+}
 }
 catch (IOError err)
 {
@@ -147,6 +153,25 @@
 Not connected to SimpleIndexer);
 }
 }
+
+public override void unload ()
+{
+try
+{
+var connection = Bus.get_sync (BusType.SESSION, null);
+if (registration_id != 0)
+{
+connection.unregister_object (registration_id);
+registration_id = 0;
+}
+}
+catch (Error err)
+{
+warning (%s, err.message);
+}
+
+debug (%s, this.ref_count = %u, Log.METHOD, this.ref_count);
+}
 
 public async void search (string query_string, Variant time_range,
 Variant filter_templates, uint offset, uint count, uint result_type,

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


[Zeitgeist] [Merge] lp:~zormit/zeitgeist/fix-932989 into lp:zeitgeist

2012-03-29 Thread noreply
The proposal to merge lp:~zormit/zeitgeist/fix-932989 into lp:zeitgeist has 
been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~zormit/zeitgeist/fix-932989/+merge/98760
-- 
https://code.launchpad.net/~zormit/zeitgeist/fix-932989/+merge/98760
Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist.

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 456: indentation fix

2012-03-29 Thread noreply

revno: 456
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Thu 2012-03-29 19:51:33 +0200
message:
  indentation fix
modified:
  src/sql.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 'src/sql.vala'
--- src/sql.vala	2012-03-26 14:38:14 +
+++ src/sql.vala	2012-03-29 17:51:33 +
@@ -101,7 +101,7 @@
 int rc = Sqlite.Database.open_v2 (
 Utils.get_database_file_path (),
 out database, flags);
-
+
 if (rc == Sqlite.OK)
 {
 try
@@ -134,7 +134,7 @@
 throw err;
 }
 }
-
+
 if (rc != Sqlite.OK)
 {
 if (rc == Sqlite.CORRUPT  retry)

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 453: Merge lp:~tdfischer/zeitgeist/warning-fixes

2012-03-27 Thread noreply
Merge authors:
  Trever Fischer (tdfischer)
Related merge proposals:
  https://code.launchpad.net/~tdfischer/zeitgeist/warning-fixes/+merge/99374
  proposed by: Trever Fischer (tdfischer)
  review: Needs Fixing - Siegfried Gevatter (rainct)

revno: 453 [merge]
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Tue 2012-03-27 16:30:23 +0200
message:
  Merge lp:~tdfischer/zeitgeist/warning-fixes
modified:
  extensions/blacklist.vala
  extensions/ds-registry.vala
  extensions/fts++/zeitgeist-fts.vala
  extensions/storage-monitor.vala
  src/datamodel.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/blacklist.vala'
--- extensions/blacklist.vala	2012-03-15 09:25:01 +
+++ extensions/blacklist.vala	2012-03-26 18:12:03 +
@@ -47,7 +47,7 @@
 private const string SIG_BLACKLIST = a{s(+Utils.SIG_EVENT+)};
 
 private static HashTablestring, Event from_variant (
-Variant templates_variant)
+Variant templates_variant) throws EngineError
 {
 var blacklist = new HashTablestring, Event (str_hash, str_equal);
 
@@ -100,9 +100,21 @@
 Variant? templates = retrieve_config (blacklist,
 BlacklistTemplates.SIG_BLACKLIST);
 if (templates != null)
-blacklist = BlacklistTemplates.from_variant (templates);
+{
+try
+{
+blacklist = BlacklistTemplates.from_variant (templates);
+}
+catch (EngineError e)
+{
+warning (Could not load blacklist from variant: %s, e.message);
+blacklist = new HashTablestring, Event (str_hash, str_equal);
+}
+}
 else
+{
 blacklist = new HashTablestring, Event (str_hash, str_equal);
+}
 
 // This will be called after bus is acquired, so it shouldn't block
 try

=== modified file 'extensions/ds-registry.vala'
--- extensions/ds-registry.vala	2012-03-17 14:53:25 +
+++ extensions/ds-registry.vala	2012-03-26 18:12:03 +
@@ -72,7 +72,7 @@
 }
 
 public DataSource.from_variant (Variant variant,
-bool reset_running=false)
+bool reset_running=false) throws EngineError
 {
 warn_if_fail (
 variant.get_type_string () == (sssa(+Utils.SIG_EVENT+)bxb)
@@ -127,7 +127,7 @@
 a(sssa(+Utils.SIG_EVENT+)bxb);
 
 private static HashTablestring, DataSource from_variant (
-Variant sources_variant, bool reset_running=false)
+Variant sources_variant, bool reset_running=false) throws EngineError
 {
 var registry = new HashTablestring, DataSource (
 str_hash, str_equal);
@@ -186,10 +186,23 @@
 Variant? registry = retrieve_config (registry,
 DataSources.SIG_DATASOURCES);
 if (registry != null)
-sources = DataSources.from_variant (registry, true);
+{
+try
+{
+sources = DataSources.from_variant (registry, true);
+}
+catch (EngineError e)
+{
+warning (Error while loading datasource registry: %s, e.message);
+sources = new HashTablestring, DataSource (
+str_hash, str_equal);
+}
+}
 else
+{
 sources = new HashTablestring, DataSource (
 str_hash, str_equal);
+}
 
 // this will be called after bus is acquired, so it shouldn't block
 try
@@ -249,7 +262,7 @@
 }
 
 public bool register_data_source (string unique_id, string name,
-string description, Variant event_templates, BusName? sender)
+string description, Variant event_templates, BusName? sender) throws EngineError
 {
 debug (%s: %s, %s, %s, Log.METHOD, unique_id, name, description);
 if (sender == null)

=== modified file 'extensions/fts++/zeitgeist-fts.vala'
--- extensions/fts++/zeitgeist-fts.vala	2012-03-26 15:52:08 +
+++ extensions/fts++/zeitgeist-fts.vala	2012-03-27 14:30:23 +
@@ -100,7 +100,7 @@
 }
 
 public async void notify_insert (Variant time_range, Variant events)
-throws IOError
+throws IOError, EngineError
 {
 debug (got insertion notification);
 var events_arr = Events.from_variant 

[Zeitgeist] [Merge] lp:~tdfischer/zeitgeist/warning-fixes into lp:zeitgeist

2012-03-27 Thread noreply
The proposal to merge lp:~tdfischer/zeitgeist/warning-fixes into lp:zeitgeist 
has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~tdfischer/zeitgeist/warning-fixes/+merge/99374
-- 
https://code.launchpad.net/~tdfischer/zeitgeist/warning-fixes/+merge/99374
Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist.

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 454: storage-monitor.vala: Commented out unused methods until gvfs decides to play nice

2012-03-27 Thread noreply

revno: 454
committer: Seif Lotfy s...@lotfy.com
branch nick: zeitgeist
timestamp: Tue 2012-03-27 20:36:40 +0200
message:
  storage-monitor.vala: Commented out unused methods until gvfs decides to play 
nice
modified:
  extensions/storage-monitor.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/storage-monitor.vala'
--- extensions/storage-monitor.vala	2012-03-26 18:12:03 +
+++ extensions/storage-monitor.vala	2012-03-27 18:36:40 +
@@ -318,6 +318,8 @@
 return unknown;
 }
 
+/*
+// It is not being used since gvfs is not being friendly
 private void on_volume_added (Volume volume)
 {
 debug (volume added);
@@ -329,19 +331,21 @@
 add_storage_medium (get_volume_id (volume), icon_name,
 volume.get_name ());
 }
-
+
 private void on_volume_removed (Volume volume)
 {
 debug (Volume removed);
 remove_storage_medium (get_volume_id (volume));
 }
+*/
 
 /*
  * Return a string identifier for a GIO Volume. This id is constructed
  * as a `best effort` since we can not always uniquely identify
  * volumes, especially audio- and data CDs are problematic.
  */
-private string get_volume_id (Volume volume)
+
+/*private string get_volume_id (Volume volume)
 {
 string volume_id;
 
@@ -358,7 +362,7 @@
 return volume_id;
 
 return unknown;
-}
+}*/
 
 public void add_storage_medium (string medium_name, string icon,
 string display_name)

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


[Zeitgeist] [Merge] lp:~dhananjaysathe/zeitgeist-explorer/zeitgeist-explorer into lp:zeitgeist-explorer

2012-03-26 Thread noreply
The proposal to merge lp:~dhananjaysathe/zeitgeist-explorer/zeitgeist-explorer 
into lp:zeitgeist-explorer has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~dhananjaysathe/zeitgeist-explorer/zeitgeist-explorer/+merge/99166
-- 
https://code.launchpad.net/~dhananjaysathe/zeitgeist-explorer/zeitgeist-explorer/+merge/99166
Your team Zeitgeist Framework Team is requested to review the proposed merge of 
lp:~dhananjaysathe/zeitgeist-explorer/zeitgeist-explorer into 
lp:zeitgeist-explorer.

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 449: sql.vala: fix formatting typo

2012-03-26 Thread noreply

revno: 449
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Mon 2012-03-26 16:38:14 +0200
message:
  sql.vala: fix formatting typo
modified:
  src/sql.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 'src/sql.vala'
--- src/sql.vala	2012-02-21 18:17:16 +
+++ src/sql.vala	2012-03-26 14:38:14 +
@@ -168,7 +168,7 @@
 }
 else
 {
-string message = Can't open database: %d, %s.printf(rc,
+string message = Can't open database: %d, %s.printf (rc,
 database.errmsg ());
 throw new EngineError.DATABASE_ERROR (message);
 }
@@ -326,7 +326,7 @@
 {
 if (unlikely (rc != success_code))
 {
-string error_message = %s: %d, %s.printf(
+string error_message = %s: %d, %s.printf (
 msg, rc, database.errmsg ());
 warning (%s\n, error_message);
 throw new EngineError.DATABASE_ERROR (error_message);

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 450: Merge lp:~mhr3/zeitgeist/fts-optimizations

2012-03-26 Thread noreply
Merge authors:
  Michal Hruby (mhr3)
Related merge proposals:
  https://code.launchpad.net/~mhr3/zeitgeist/fts-optimizations/+merge/99350
  proposed by: Michal Hruby (mhr3)

revno: 450 [merge]
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Mon 2012-03-26 17:52:08 +0200
message:
  Merge lp:~mhr3/zeitgeist/fts-optimizations
   - Query the DB in chunks when reindexing (reduces memory usage)
   - Quit FTS when Zeitgeist quits
modified:
  extensions/fts++/controller.cpp
  extensions/fts++/controller.h
  extensions/fts++/task.cpp
  extensions/fts++/task.h
  extensions/fts++/zeitgeist-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++/controller.cpp'
--- extensions/fts++/controller.cpp	2012-02-14 16:56:04 +
+++ extensions/fts++/controller.cpp	2012-03-26 15:09:54 +
@@ -37,19 +37,21 @@
 void Controller::RebuildIndex ()
 {
   GError *error = NULL;
-  GPtrArray *events;
+  guint32 *event_ids;
+  gint event_ids_size;
   GPtrArray *templates = g_ptr_array_new ();
   ZeitgeistTimeRange *time_range = zeitgeist_time_range_new_anytime ();
 
   g_debug (asking reader for all events);
-  events = zeitgeist_db_reader_find_events (zg_reader,
-time_range,
-templates,
-ZEITGEIST_STORAGE_STATE_ANY,
-0,
-ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS,
-NULL,
-error);
+  event_ids = zeitgeist_db_reader_find_event_ids (zg_reader,
+  time_range,
+  templates,
+  ZEITGEIST_STORAGE_STATE_ANY,
+  0,
+  ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS,
+  NULL,
+  event_ids_size,
+  error);
 
   if (error)
   {
@@ -58,10 +60,10 @@
   }
   else
   {
-g_debug (reader returned %u events, events-len);
+g_debug (reader returned %d events, event_ids_size);
 
-IndexEvents (events);
-g_ptr_array_unref (events);
+IndexEvents (event_ids, event_ids_size);
+g_free (event_ids);
 
 // Set the db metadata key only once we're done
 PushTask (new MetadataTask (fts_index_version, INDEX_VERSION));
@@ -81,6 +83,19 @@
   }
 }
 
+void Controller::IndexEvents (guint *event_ids, int event_ids_size)
+{
+  const int CHUNK_SIZE = 64;
+  // Break down index tasks into suitable chunks
+  for (int i = 0; i  event_ids_size; i += CHUNK_SIZE)
+  {
+int num_ids = i + CHUNK_SIZE  event_ids_size ? 
+  event_ids_size - i : CHUNK_SIZE;
+PushTask (new IndexEventsTask (zg_reader,
+std::vectorguint (event_ids[i], event_ids[i + num_ids])));
+  }
+}
+
 void Controller::DeleteEvents (guint *event_ids, int event_ids_size)
 {
   // FIXME: Should we break the task here as well?

=== modified file 'extensions/fts++/controller.h'
--- extensions/fts++/controller.h	2012-02-14 16:56:04 +
+++ extensions/fts++/controller.h	2012-03-26 15:09:54 +
@@ -49,6 +49,7 @@
   void RebuildIndex ();
 
   void IndexEvents (GPtrArray *events);
+  void IndexEvents (guint *event_ids, int event_ids_size);
   void DeleteEvents (guint *event_ids, int event_ids_size);
 
   void PushTask (Task* task);

=== modified file 'extensions/fts++/task.cpp'
--- extensions/fts++/task.cpp	2012-02-14 16:56:04 +
+++ extensions/fts++/task.cpp	2012-03-26 15:09:54 +
@@ -23,10 +23,36 @@
 
 void IndexEventsTask::Process (Indexer *indexer)
 {
-  unsigned end_index = MIN (start_index + event_count, events-len);
-  for (unsigned i = start_index; i  end_index; i++)
-  {
-indexer-IndexEvent ((ZeitgeistEvent*) g_ptr_array_index (events, i));
+  if (events)
+  {
+unsigned end_index = MIN (start_index + event_count, events-len);
+for (unsigned i = start_index; i  end_index; i++)
+{
+  indexer-IndexEvent ((ZeitgeistEvent*) g_ptr_array_index (events, i));
+}
+  }
+  else if (!event_ids.empty ())
+  {
+GError *error = NULL;
+GPtrArray *results = zeitgeist_db_reader_get_events (zg_reader,
+ event_ids[0],
+ event_ids.size (),
+ NULL,
+  

[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 451: FTS++: Re-index if database is corrupt

2012-03-26 Thread noreply

revno: 451
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Mon 2012-03-26 18:43:07 +0200
message:
  FTS++: Re-index if database is corrupt
modified:
  extensions/fts++/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-20 12:19:23 +
+++ extensions/fts++/indexer.cpp	2012-03-26 16:43:07 +
@@ -67,8 +67,25 @@
 {
   gchar *path = g_build_filename (zeitgeist_utils_get_data_path (),
   FTS_MAIN_DIR.c_str (), NULL);
-  this-db = new Xapian::WritableDatabase (path,
-   Xapian::DB_CREATE_OR_OPEN);
+  try
+  {
+this-db = new Xapian::WritableDatabase (path,
+ Xapian::DB_CREATE_OR_OPEN);
+  }
+  catch (const Xapian::DatabaseCorruptError xp_error)
+  {
+g_message (Database is corrupt (%s). Overwriting...,
+xp_error.get_msg ().c_str ());
+this-db = new Xapian::WritableDatabase (path,
+ Xapian::DB_CREATE_OR_OVERWRITE);
+  }
+  catch (const Xapian::DatabaseOpeningError xp_error)
+  {
+g_message (Database is corrupt (%s). Overwriting...,
+xp_error.get_msg ().c_str ());
+this-db = new Xapian::WritableDatabase (path,
+ Xapian::DB_CREATE_OR_OVERWRITE);
+  }
   g_free (path);
 }
 

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 452: Merge lp:~rainct/zeitgeist/limit-dbus-mb

2012-03-26 Thread noreply
Merge authors:
  Siegfried Gevatter (rainct)
Related merge proposals:
  https://code.launchpad.net/~rainct/zeitgeist/limit-dbus-mb/+merge/99349
  proposed by: Siegfried Gevatter (rainct)
  review: Approve - Michal Hruby (mhr3)

revno: 452 [merge]
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Mon 2012-03-26 18:45:28 +0200
message:
  Merge lp:~rainct/zeitgeist/limit-dbus-mb
  
  Set a limit on the result size FindEvents and GetEvents may return.
  
  D-Bus has a hard limit of 1GB of data per call and Gio limits us to
  100MB. We need to ensure we don't go over this limit, since otherwise
  Zeitgeist will crash. Additionally, ransfers of such size take several
  minutes and are clear misuse of the Zeitgeist engine.
  
  Therefore, this commit limit the result of FindEvents and GetEvents calls
  to not more than 4MiB of data (2MiB would probably be enough, but let's
  leave some margin). Queries requesting more than this limit will get
  an exception.
modified:
  src/datamodel.vala
  src/errors.vala
  src/utils.vala
  src/zeitgeist-daemon.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 'src/datamodel.vala'
--- src/datamodel.vala	2012-03-20 12:19:23 +
+++ src/datamodel.vala	2012-03-26 15:31:28 +
@@ -621,6 +621,46 @@
 return vb.end ();
 }
 
+/* Same as to_variant but raises an exception if the variant size
+ * exceeds `limit' bytes.
+ * */
+public static Variant to_variant_with_limit (GenericArrayEvent? events,
+size_t limit=Utils.MAX_DBUS_RESULT_SIZE) throws EngineError
+{
+var vb = new VariantBuilder(new VariantType(a(+Utils.SIG_EVENT+)));
+
+size_t variant_size = 0;
+
+for (int i = 0; i  events.length; ++i)
+{
+Variant event_variant;
+
+if (events[i] != null)
+{
+event_variant = events[i].to_variant ();
+}
+else
+{
+event_variant = get_null_event_variant ();
+}
+
+variant_size += event_variant.get_size();
+if (variant_size  limit)
+{
+size_t avg_event_size = variant_size / (i+1);
+string error_message = (Query exceeded size limit of %  +
+size_t.FORMAT + MiB (roughly ~%d events).).printf (
+limit / 1024 / 1024, limit / avg_event_size);
+warning (error_message);
+throw new EngineError.TOO_MANY_RESULTS (error_message);
+}
+
+vb.add_value (event_variant);
+}
+
+return vb.end ();
+}
+
 private static Variant get_null_event_variant ()
 {
 var vb = new VariantBuilder (new VariantType ((+Utils.SIG_EVENT+)));

=== modified file 'src/errors.vala'
--- src/errors.vala	2012-01-25 17:37:55 +
+++ src/errors.vala	2012-03-26 15:03:10 +
@@ -29,10 +29,11 @@
 DATABASE_CORRUPT,
 DATABASE_ERROR,
 DATABASE_RETIRE_FAILED,
+EXISTING_INSTANCE,
 INVALID_ARGUMENT,
 INVALID_KEY,
-EXISTING_INSTANCE,
 INVALID_SIGNATURE, // FIXME: change from EngineError to sth. + public
+TOO_MANY_RESULTS,
 }
 
 // vala doesn't include proper headers, this fixes it

=== modified file 'src/utils.vala'
--- src/utils.vala	2012-03-01 14:47:30 +
+++ src/utils.vala	2012-03-26 15:03:10 +
@@ -38,6 +38,7 @@
 // D-Bus
 public const string DBUS_INTERFACE = ;
 public const string SIG_EVENT = asaasay;
+public const size_t MAX_DBUS_RESULT_SIZE = 4 * 1024 * 1024; // 4MiB
 
 // configure runtime cache for events
 // default size is 2000

=== modified file 'src/zeitgeist-daemon.vala'
--- src/zeitgeist-daemon.vala	2012-03-01 14:47:30 +
+++ src/zeitgeist-daemon.vala	2012-03-26 15:03:10 +
@@ -138,7 +138,7 @@
 var timer = new Timer ();
 GenericArrayEvent events = engine.get_events (event_ids);
 debug (%s executed in %f seconds, Log.METHOD, timer.elapsed ());
-return Events.to_variant (events);
+return Events.to_variant_with_limit (events);
 }
 
 public string[] find_related_uris (Variant time_range,
@@ -176,7 +176,7 @@
 Events.from_variant (event_templates),
 storage_state, num_events, result_type, sender);
 debug (%s executed in %f seconds, Log.METHOD, timer.elapsed ());
-return Events.to_variant (events);
+   

[Zeitgeist] [Merge] lp:~rainct/zeitgeist/limit-dbus-mb into lp:zeitgeist

2012-03-26 Thread noreply
The proposal to merge lp:~rainct/zeitgeist/limit-dbus-mb into lp:zeitgeist has 
been updated.

Status: Approved = Merged

For more details, see:
https://code.launchpad.net/~rainct/zeitgeist/limit-dbus-mb/+merge/99349
-- 
https://code.launchpad.net/~rainct/zeitgeist/limit-dbus-mb/+merge/99349
Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist.

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 444: Make sure make check passes

2012-03-20 Thread noreply

revno: 444
committer: Michal Hruby michal@gmail.com
branch nick: zeitgeist
timestamp: Tue 2012-03-20 13:00:45 +0100
message:
  Make sure make check passes
modified:
  extensions/fts++/test/test-indexer.cpp
  test/direct/table-lookup-test.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++/test/test-indexer.cpp'
--- extensions/fts++/test/test-indexer.cpp	2012-03-19 21:57:17 +
+++ extensions/fts++/test/test-indexer.cpp	2012-03-20 12:00:45 +
@@ -1018,9 +1018,11 @@
   assert_nth_result_has_id (results, 0, event_id4);
   assert_nth_result_has_id (results, 1, event_id3);
 
+  // FIXME: these fail
+/*
   // Search for MostPopularSubjects
   results = search_simple (fix, test, NULL,
-  ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECTS, matches);
+  ZEITGEIST_RESULT_TYPE_MOST_POPULAR_SUBJECTS, matches);
 
   g_assert_cmpuint (matches, , 0);
   g_assert_cmpuint (results-len, ==, 2);
@@ -1035,6 +1037,7 @@
   g_assert_cmpuint (results-len, ==, 2);
   assert_nth_result_has_id (results, 0, event_id3);
   assert_nth_result_has_id (results, 1, event_id4); // or event_id1 until stuff gets fixed
+*/
 }
 
 static void
@@ -1130,8 +1133,11 @@
   setup, test_query_sort_order, teardown);
   g_test_add (/Zeitgeist/FTS/Indexer/Query/Duplicates, Fixture, 0,
   setup, test_query_with_duplicates, teardown);
+  // FIXME: this one doesn't work atm
+  /*
   g_test_add (/Zeitgeist/FTS/Indexer/Query/MostPopularSubjects, Fixture, 0,
   setup, test_query_most_popular_subjects, teardown);
+  */
 
   // get rid of the rebuilding index... messages
   g_log_set_handler (NULL, G_LOG_LEVEL_MESSAGE, discard_message, NULL);

=== modified file 'test/direct/table-lookup-test.vala'
--- test/direct/table-lookup-test.vala	2012-02-13 20:14:41 +
+++ test/direct/table-lookup-test.vala	2012-03-20 12:00:45 +
@@ -57,16 +57,16 @@
 unowned Sqlite.Database db = database.database;
 TableLookup table_lookup = new TableLookup (database, actor);
 
-int id = table_lookup.get_id (1st-actor);
-assert_cmpint (table_lookup.get_id (2nd-actor), OperatorType.EQUAL, id+1);
-assert_cmpint (table_lookup.get_id (1st-actor), OperatorType.EQUAL, id);
+int id = table_lookup.id_for_string (1st-actor);
+assert_cmpint (table_lookup.id_for_string (2nd-actor), OperatorType.EQUAL, id+1);
+assert_cmpint (table_lookup.id_for_string (1st-actor), OperatorType.EQUAL, id);
 
 int rc = db.exec (DELETE FROM actor WHERE value='1st-actor');
 assert (rc == Sqlite.OK);
 
 table_lookup.remove (1);
-assert_cmpint (table_lookup.get_id (2nd-actor), OperatorType.EQUAL, id+1);
-assert_cmpint (table_lookup.get_id (1st-actor), OperatorType.EQUAL, id+2);
+assert_cmpint (table_lookup.id_for_string (2nd-actor), OperatorType.EQUAL, id+1);
+assert_cmpint (table_lookup.id_for_string (1st-actor), OperatorType.EQUAL, id+2);
 }
 
 public void get_value_with_query_test ()
@@ -88,14 +88,14 @@
 unowned Sqlite.Database db = database.database;
 TableLookup table_lookup = engine.get_actors_table_lookup();
 
-assert_cmpint (table_lookup.get_id (something), OperatorType.EQUAL, 1);
+assert_cmpint (table_lookup.id_for_string (something), OperatorType.EQUAL, 1);
 
 // Since we're running with Engine, this should trigger the deletion
 // callback, which in turn should fix the cache (LP: #598666).
 int rc = db.exec (DELETE FROM actor WHERE value='something');
 assert (rc == Sqlite.OK);
 
-assert_cmpint (table_lookup.get_id (something), OperatorType.EQUAL, 2);
+assert_cmpint (table_lookup.id_for_string (something), OperatorType.EQUAL, 2);
 }
 
 // vim:expandtab:ts=4:sw=4

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 445: Add Event.take_subject

2012-03-20 Thread noreply

revno: 445
committer: Michal Hruby michal@gmail.com
branch nick: zeitgeist
timestamp: Tue 2012-03-20 13:19:23 +0100
message:
  Add Event.take_subject
modified:
  extensions/fts++/indexer.cpp
  src/datamodel.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++/indexer.cpp'
--- extensions/fts++/indexer.cpp	2012-03-19 21:33:59 +
+++ extensions/fts++/indexer.cpp	2012-03-20 12:19:23 +
@@ -958,7 +958,7 @@
 ZeitgeistEvent *event = zeitgeist_event_new ();
 ZeitgeistSubject *subject = zeitgeist_subject_new ();
 zeitgeist_subject_set_current_uri (subject, subj_uri);
-zeitgeist_event_add_subject (event, subject); // FIXME: leaks?
+zeitgeist_event_take_subject (event, subject);
 g_ptr_array_add (event_templates, event);
   }
 }
@@ -1032,7 +1032,7 @@
 ZeitgeistEvent *event = zeitgeist_event_new ();
 ZeitgeistSubject *subject = zeitgeist_subject_new ();
 zeitgeist_subject_set_origin (subject, subj_origin);
-zeitgeist_event_add_subject (event, subject); // FIXME: leaks?
+zeitgeist_event_take_subject (event, subject);
 g_ptr_array_add (event_templates, event);
   }
 }
@@ -1040,7 +1040,7 @@
 g_ptr_array_unref (results);
 
 // construct custom where clause which combines the original template
-// with the uris we found
+// with the origins we found
 ZeitgeistWhereClause *where;
 where = zeitgeist_db_reader_get_where_clause_for_query (zg_reader,
 time_range, templates, storage_state, error);

=== modified file 'src/datamodel.vala'
--- src/datamodel.vala	2012-03-19 19:56:38 +
+++ src/datamodel.vala	2012-03-20 12:19:23 +
@@ -398,6 +398,11 @@
 subjects.add (subject);
 }
 
+public void take_subject (owned Subject subject)
+{
+subjects.add ((owned) subject);
+}
+
 public Event.full (string? interpretation=null,
 string? manifestation=null, string? actor=null,
 string? origin=null, ...)

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 446: But it's so much nicer without the warnings

2012-03-20 Thread noreply

revno: 446
committer: Michal Hruby michal@gmail.com
branch nick: zeitgeist
timestamp: Tue 2012-03-20 13:25:59 +0100
message:
  But it's so much nicer without the warnings
modified:
  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++/test/test-indexer.cpp'
--- extensions/fts++/test/test-indexer.cpp	2012-03-20 12:00:45 +
+++ extensions/fts++/test/test-indexer.cpp	2012-03-20 12:25:59 +
@@ -263,7 +263,7 @@
 
   zeitgeist_event_set_interpretation (event, ZEITGEIST_ZG_ACCESS_EVENT);
   zeitgeist_event_set_manifestation (event, ZEITGEIST_ZG_USER_ACTIVITY);
-  zeitgeist_event_set_actor (event, application://random.desktop);
+  zeitgeist_event_set_actor (event, application://gedit.desktop);
   zeitgeist_event_add_subject (event, subject);
 
   g_object_unref (subject);

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 447: Release 0.8.99~beta1

2012-03-20 Thread noreply

revno: 447
tags: 0.8.99~beta1
committer: Michal Hruby michal@gmail.com
branch nick: zeitgeist
timestamp: Tue 2012-03-20 13:29:29 +0100
message:
  Release 0.8.99~beta1
modified:
  NEWS
  configure.ac


--
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 'NEWS'
--- NEWS	2012-03-19 21:52:42 +
+++ NEWS	2012-03-20 12:29:29 +
@@ -1,4 +1,4 @@
-2012-03-01: Zeitgeist Bluebird Beta 1
+2012-03-20: Zeitgeist Bluebird Beta 1
 -
 
 Engine:

=== modified file 'configure.ac'
--- configure.ac	2012-02-14 16:57:23 +
+++ configure.ac	2012-03-20 12:29:29 +
@@ -1,4 +1,4 @@
-AC_INIT([zeitgeist], [0.8.99~alpha3], [d...@lists.zeitgeist-project.com], [zeitgeist])
+AC_INIT([zeitgeist], [0.8.99~beta1], [d...@lists.zeitgeist-project.com], [zeitgeist])
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS(config.h)
 AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip])

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 448: MIME-Types:

2012-03-20 Thread noreply

revno: 448
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Tue 2012-03-20 17:36:59 +0100
message:
  MIME-Types:
   - Remove application/x-object, we don't want it as SOURCE_CODE.
   - Add additional mappings, from en.wikipedia.org/wiki/Internet_media_type
modified:
  NEWS
  python/mimetypes.py
  src/mimetype.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 'NEWS'
--- NEWS	2012-03-20 12:29:29 +
+++ NEWS	2012-03-20 16:36:59 +
@@ -1,3 +1,12 @@
+2012-XX-XX: Zeitgeist Bluebird Beta 2
+-
+
+Engine:
+ - Updated the list of recognized MIME-types.
+
+Python API:
+ - Updated the list of recognized MIME-types.
+
 2012-03-20: Zeitgeist Bluebird Beta 1
 -
 
@@ -204,37 +213,37 @@
 
 Engine:
 
- - Added some new mimetype mappings
- - Speed up the GetEvents method by caching events (LP: #686732)
- - Allow extension without public method (LP: #691660)
+ - Added some new mimetype mappings.
+ - Speed up the GetEvents method by caching events (LP: #686732).
+ - Allow extension without public method (LP: #691660).
  - Added a read-only DBus property extensions to org.gnome.zeitgeist.Log 
-   (LP: #693861)
- - Added helper function to get an extension's name
+   (LP: #693861).
+ - Added helper function to get an extension's name.
  - Fixed bug in RemoteInterface.Quit(): make sure to close connection to the
used bus if this method gets called, this is needed if RemoteInterface
does not know anything about the loop it is running in.
- - Fix sending payload from engine to client (LP: #692645)
- - Improve performance of DataSourceRegistry (LP: #695311)
+ - Fix sending payload from engine to client (LP: #692645).
+ - Improve performance of DataSourceRegistry (LP: #695311).
  - Improve performance of find_event queries with timerange other than 
-   TimeRange.always() (LP: #672965)
- - Add an auto-filter for broken database entries (LP: #598666 workaround)
+   TimeRange.always() (LP: #672965).
+ - Add an auto-filter for broken database entries (LP: #598666 workaround).
  - Introduce new DB schema (version 3) that bundles a few performance related 
-   fixes (LP: #673452, #673394)
+   fixes (LP: #673452, #673394).
  - Added a (LRU-type) event cache to speed up similar requests.
 
 Python API:
 
- - Fix find_event_for_template to stop ignoring the template (LP: #690377)
- - Add get_extensions method to ZeitgeistClient
+ - Fix find_event_for_template to stop ignoring the template (LP: #690377).
+ - Add get_extensions method to ZeitgeistClient.
 
 Overall:
 
- - Using logging output for debugging purposes (LP: #660440)
- - Stop building man page for zeitgeist-datahub (LP: #680360)
- - Allow easy building for KDE (LP: #683280)
+ - Using logging output for debugging purposes (LP: #660440).
+ - Stop building man page for zeitgeist-datahub (LP: #680360).
+ - Allow easy building for KDE (LP: #683280).
  - Logging output now displays how many events were actually inserted from 
-   the batch of requested inserts (LP: #660440)
- - Changed License to LGPL 2.1+
+   the batch of requested inserts (LP: #660440).
+ - Changed License to LGPL 2.1+.
 
 2010-11-01: Zeitgeist 0.6 Buzzer Beater
 -

=== modified file 'python/mimetypes.py'
--- python/mimetypes.py	2012-02-12 20:52:37 +
+++ python/mimetypes.py	2012-03-20 16:36:59 +
@@ -103,6 +103,7 @@
 
 # Plain text
 text/plain: Interpretation.TEXT_DOCUMENT,
+text/csv: Interpretation.TEXT_DOCUMENT,
   
 # HTML files on disk are always HTML_DOCUMENTS while online we should
 # assume them to be WEBSITEs. By default we anticipate local files...
@@ -111,11 +112,13 @@
 # Image types
 application/vnd.corel-draw: Interpretation.VECTOR_IMAGE,
 image/jpeg: Interpretation.RASTER_IMAGE,
+image/pjpeg: Interpretation.RASTER_IMAGE,
 image/png: Interpretation.RASTER_IMAGE,
 image/tiff: Interpretation.RASTER_IMAGE,
 image/gif: Interpretation.RASTER_IMAGE,
 image/x-xcf: Interpretation.RASTER_IMAGE,
 image/svg+xml: Interpretation.VECTOR_IMAGE,
+image/vnd.microsoft.icon: Interpretation.ICON,
 
 # Audio
 application/ogg: Interpretation.AUDIO,
@@ -124,6 +127,9 @@
 # Development files
 application/ecmascript: Interpretation.SOURCE_CODE,
 application/javascript: Interpretation.SOURCE_CODE,
+application/json: Interpretation.SOURCE_CODE,
+application/soap+xml: Interpretation.SOURCE_CODE,
+application/xml-dtd: Interpretation.SOURCE_CODE,
 application/x-csh: Interpretation.SOURCE_CODE,
 application/x-designer: Interpretation.SOURCE_CODE,
 

[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 435: Storage Monitor Extensions: fix bug lp:950983

2012-03-19 Thread noreply

revno: 435
committer: Seif Lotfy s...@lotfy.com
branch nick: zeitgeist
timestamp: Mon 2012-03-19 11:02:10 +0100
message:
  Storage Monitor Extensions: fix bug lp:950983
modified:
  extensions/storage-monitor.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/storage-monitor.vala'
--- extensions/storage-monitor.vala	2012-02-10 13:35:02 +
+++ extensions/storage-monitor.vala	2012-03-19 10:02:10 +
@@ -112,8 +112,10 @@
 
 private Sqlite.Statement get_storages_stmt;
 private Sqlite.Statement store_storage_medium_stmt;
+private Sqlite.Statement update_storage_medium_stmt;
 private Sqlite.Statement insert_unavailable_medium_stmt;
 private Sqlite.Statement update_medium_state_stmt;
+private Sqlite.Statement get_storage_medium_id_stmt;
 
 private NetworkMonitor network;
 private uint watch_connman;
@@ -236,7 +238,7 @@
 database.assert_query_success (rc, Storage retrieval query error);
 
 sql = 
-INSERT OR REPLACE INTO storage (
+INSERT INTO storage (
 value, state, icon, display_name
 ) VALUES (
 ?, ?, ?, ?
@@ -245,6 +247,14 @@
 database.assert_query_success (rc, Storage insertion query error);
 
 sql = 
+UPDATE storage SET 
+state=?, icon=?, display_name=? 
+WHERE value=?
+;
+rc = db.prepare_v2 (sql, -1, out update_storage_medium_stmt);
+database.assert_query_success (rc, Storage update query error);
+
+sql = 
 INSERT INTO storage (
 state, value
 ) VALUES (
@@ -262,6 +272,13 @@
 rc = db.prepare_v2 (sql, -1, out update_medium_state_stmt);
 database.assert_query_success (rc,
 update_medium_state_stmt error);
+
+sql = 
+SELECT id FROM storage WHERE value=?
+;
+rc = db.prepare_v2 (sql, -1, out get_storage_medium_id_stmt);
+database.assert_query_success (rc,
+get_storage_medium_id_stmt error);
 }
 
 public override void pre_insert_events (GenericArrayEvent? events,
@@ -355,15 +372,31 @@
 string display_name)
 {
 debug (VOLUME ADDED: %s.printf(medium_name));
-store_storage_medium_stmt.reset ();
-store_storage_medium_stmt.bind_text (1, medium_name);
-store_storage_medium_stmt.bind_int (2, 1);
-store_storage_medium_stmt.bind_text (3, icon);
-store_storage_medium_stmt.bind_text (4, display_name);
 
-int rc = store_storage_medium_stmt.step ();
-database.assert_query_success (rc, add_storage_medium,
-Sqlite.DONE);
+get_storage_medium_id_stmt.reset ();
+get_storage_medium_id_stmt.bind_text (1, medium_name);
+if (get_storage_medium_id_stmt.step () == Sqlite.ROW)
+{
+update_storage_medium_stmt.reset ();
+update_storage_medium_stmt.bind_int (1, 1);
+update_storage_medium_stmt.bind_text (2, icon);
+update_storage_medium_stmt.bind_text (3, display_name);
+update_storage_medium_stmt.bind_text (4, medium_name);
+int rc = update_storage_medium_stmt.step ();
+database.assert_query_success (rc, update_storage_medium,
+Sqlite.DONE);
+}
+else
+{
+store_storage_medium_stmt.reset ();
+store_storage_medium_stmt.bind_text (1, medium_name);
+store_storage_medium_stmt.bind_int (2, 1);
+store_storage_medium_stmt.bind_text (3, icon);
+store_storage_medium_stmt.bind_text (4, display_name);
+int rc = store_storage_medium_stmt.step ();
+database.assert_query_success (rc, add_storage_medium,
+Sqlite.DONE);
+}
 
 storage_available (medium_name, StorageMedia.to_variant (
 medium_name, true, icon, display_name));

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 436: Storage Monitor Extension: refactor the INSERT OR REPLACE statement

2012-03-19 Thread noreply

revno: 436
committer: Seif Lotfy s...@lotfy.com
branch nick: zeitgeist
timestamp: Mon 2012-03-19 11:51:53 +0100
message:
  Storage Monitor Extension: refactor the INSERT OR REPLACE statement
modified:
  extensions/storage-monitor.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/storage-monitor.vala'
--- extensions/storage-monitor.vala	2012-03-19 10:02:10 +
+++ extensions/storage-monitor.vala	2012-03-19 10:51:53 +
@@ -115,7 +115,6 @@
 private Sqlite.Statement update_storage_medium_stmt;
 private Sqlite.Statement insert_unavailable_medium_stmt;
 private Sqlite.Statement update_medium_state_stmt;
-private Sqlite.Statement get_storage_medium_id_stmt;
 
 private NetworkMonitor network;
 private uint watch_connman;
@@ -272,13 +271,6 @@
 rc = db.prepare_v2 (sql, -1, out update_medium_state_stmt);
 database.assert_query_success (rc,
 update_medium_state_stmt error);
-
-sql = 
-SELECT id FROM storage WHERE value=?
-;
-rc = db.prepare_v2 (sql, -1, out get_storage_medium_id_stmt);
-database.assert_query_success (rc,
-get_storage_medium_id_stmt error);
 }
 
 public override void pre_insert_events (GenericArrayEvent? events,
@@ -372,10 +364,12 @@
 string display_name)
 {
 debug (VOLUME ADDED: %s.printf(medium_name));
-
-get_storage_medium_id_stmt.reset ();
-get_storage_medium_id_stmt.bind_text (1, medium_name);
-if (get_storage_medium_id_stmt.step () == Sqlite.ROW)
+store_storage_medium_stmt.reset ();
+store_storage_medium_stmt.bind_text (1, medium_name);
+store_storage_medium_stmt.bind_int (2, 1);
+store_storage_medium_stmt.bind_text (3, icon);
+store_storage_medium_stmt.bind_text (4, display_name);
+if (store_storage_medium_stmt.step () != Sqlite.DONE)
 {
 update_storage_medium_stmt.reset ();
 update_storage_medium_stmt.bind_int (1, 1);
@@ -383,21 +377,8 @@
 update_storage_medium_stmt.bind_text (3, display_name);
 update_storage_medium_stmt.bind_text (4, medium_name);
 int rc = update_storage_medium_stmt.step ();
-database.assert_query_success (rc, update_storage_medium,
-Sqlite.DONE);
-}
-else
-{
-store_storage_medium_stmt.reset ();
-store_storage_medium_stmt.bind_text (1, medium_name);
-store_storage_medium_stmt.bind_int (2, 1);
-store_storage_medium_stmt.bind_text (3, icon);
-store_storage_medium_stmt.bind_text (4, display_name);
-int rc = store_storage_medium_stmt.step ();
-database.assert_query_success (rc, add_storage_medium,
-Sqlite.DONE);
-}
-
+database.assert_query_success (rc, add_storage_medium, Sqlite.DONE);
+}
 storage_available (medium_name, StorageMedia.to_variant (
 medium_name, true, icon, display_name));
 }

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


[Zeitgeist] [Merge] lp:~zeitgeist/zeitgeist/fix-950983 into lp:zeitgeist

2012-03-19 Thread noreply
The proposal to merge lp:~zeitgeist/zeitgeist/fix-950983 into lp:zeitgeist has 
been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~zeitgeist/zeitgeist/fix-950983/+merge/98176
-- 
https://code.launchpad.net/~zeitgeist/zeitgeist/fix-950983/+merge/98176
Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist.

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


[Zeitgeist] [Merge] lp:~cando/activity-log-manager/appdialog-fixes into lp:activity-log-manager

2012-03-19 Thread noreply
The proposal to merge lp:~cando/activity-log-manager/appdialog-fixes into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~cando/activity-log-manager/appdialog-fixes/+merge/97629
-- 
https://code.launchpad.net/~cando/activity-log-manager/appdialog-fixes/+merge/97629
Your team Activity Log Manager is subscribed to branch lp:activity-log-manager.

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 437: Fix typo in table-lookup comment.

2012-03-19 Thread noreply

revno: 437
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Mon 2012-03-19 20:12:41 +0100
message:
  Fix typo in table-lookup comment.
modified:
  src/table-lookup.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 'src/table-lookup.vala'
--- src/table-lookup.vala	2012-03-14 14:26:11 +
+++ src/table-lookup.vala	2012-03-19 19:12:41 +
@@ -91,7 +91,7 @@
 /**
  * Searches the table for the given ID, inserts a new one if not found.
  *
- * @see id_for_string
+ * @see id_try_string
  *
  */
 public int id_for_string (string name)

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


[Zeitgeist] [Merge] lp:~kelemeng/activity-log-manager/bug958483 into lp:activity-log-manager

2012-03-19 Thread noreply
The proposal to merge lp:~kelemeng/activity-log-manager/bug958483 into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~kelemeng/activity-log-manager/bug958483/+merge/98096
-- 
https://code.launchpad.net/~kelemeng/activity-log-manager/bug958483/+merge/98096
Your team Activity Log Manager is subscribed to branch lp:activity-log-manager.

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 438: Refactor ResultType sorting and fix FTS++'s Search() with LeastRecent*

2012-03-19 Thread noreply
Merge authors:
  Siegfried Gevatter (rainct)

revno: 438 [merge]
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Mon 2012-03-19 20:56:38 +0100
message:
  Refactor ResultType sorting and fix FTS++'s Search() with LeastRecent*
modified:
  extensions/fts++/indexer.cpp
  src/datamodel.vala
  src/db-reader.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++/indexer.cpp'
--- extensions/fts++/indexer.cpp	2012-03-16 20:03:05 +
+++ extensions/fts++/indexer.cpp	2012-03-19 19:56:38 +
@@ -778,7 +778,9 @@
 }
 else
 {
-  enquire-set_sort_by_value (VALUE_TIMESTAMP, true);
+  bool reversed_sort = not
+  zeitgeist_result_type_is_sort_order_asc (result_type);
+  enquire-set_sort_by_value (VALUE_TIMESTAMP, reversed_sort);
 }
 
 if (result_type == ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECTS ||
@@ -786,7 +788,20 @@
 result_type == ZEITGEIST_RESULT_TYPE_MOST_POPULAR_SUBJECTS ||
 result_type == ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_SUBJECTS)
 {
-enquire-set_collapse_key (VALUE_URI_HASH);
+  enquire-set_collapse_key (VALUE_URI_HASH);
+}
+else if (result_type == ZEITGEIST_RESULT_TYPE_MOST_RECENT_ORIGIN ||
+result_type == ZEITGEIST_RESULT_TYPE_LEAST_RECENT_ORIGIN ||
+result_type == ZEITGEIST_RESULT_TYPE_MOST_POPULAR_ORIGIN ||
+result_type == ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_ORIGIN)
+{
+  // FIXME: not really correct but close :)
+  enquire-set_collapse_key (VALUE_URI_HASH);
+}
+else if (result_type == ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS ||
+result_type == ZEITGEIST_RESULT_TYPE_LEAST_RECENT_EVENTS)
+{
+  enquire-set_collapse_key (VALUE_EVENT_ID);
 }
 
 Xapian::Query q(query_parser-parse_query (query_string, QUERY_PARSER_FLAGS));
@@ -1096,12 +,8 @@
   return NULL;
 }
 
-bool reversed_sort =
-  result_type == ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS ||
-  result_type == ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECTS ||
-  result_type == ZEITGEIST_RESULT_TYPE_MOST_POPULAR_SUBJECTS ||
-  result_type == ZEITGEIST_RESULT_TYPE_MOST_RECENT_ORIGIN ||
-  result_type == ZEITGEIST_RESULT_TYPE_MOST_POPULAR_ORIGIN;
+bool reversed_sort = not
+zeitgeist_result_type_is_sort_order_asc (result_type);
 
 if (result_type == RELEVANCY_RESULT_TYPE)
 {

=== modified file 'src/datamodel.vala'
--- src/datamodel.vala	2012-02-18 21:33:57 +
+++ src/datamodel.vala	2012-03-19 19:56:38 +
@@ -230,10 +230,60 @@
// different origin ordered
// by the popularity of the
// origins
-LEAST_POPULAR_EVENT_ORIGIN   = 30, //   The last event of each
+LEAST_POPULAR_EVENT_ORIGIN   = 30; //   The last event of each
// different origin, ordered
// ascendingly by the
// popularity of the origin
+
+/*
+ * Returns true if the results for the given result_type will be sorted
+ * ascendantly by date, false if they'll be sorted descendingly.
+ **/
+public static bool is_sort_order_asc (ResultType result_type)
+{
+switch (result_type)
+{
+// FIXME: Why are LEAST_POPULAR_* using ASC?
+case ResultType.LEAST_RECENT_EVENTS:
+case ResultType.LEAST_RECENT_EVENT_ORIGIN:
+case ResultType.LEAST_POPULAR_EVENT_ORIGIN:
+case ResultType.LEAST_RECENT_SUBJECTS:
+case ResultType.LEAST_POPULAR_SUBJECTS:
+case ResultType.LEAST_RECENT_CURRENT_URI:
+case ResultType.LEAST_POPULAR_CURRENT_URI:
+case ResultType.LEAST_RECENT_ACTOR:
+case ResultType.LEAST_POPULAR_ACTOR:
+case ResultType.OLDEST_ACTOR:
+case ResultType.LEAST_RECENT_ORIGIN:
+case ResultType.LEAST_POPULAR_ORIGIN:
+case ResultType.LEAST_RECENT_SUBJECT_INTERPRETATION:
+case ResultType.LEAST_POPULAR_SUBJECT_INTERPRETATION:
+case ResultType.LEAST_RECENT_MIMETYPE:
+case ResultType.LEAST_POPULAR_MIMETYPE:
+return true;
+
+case ResultType.MOST_RECENT_EVENTS:
+case ResultType.MOST_RECENT_EVENT_ORIGIN:
+case 

[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 439: FTS++ test case: popularity is broken :(

2012-03-19 Thread noreply

revno: 439
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Mon 2012-03-19 22:15:57 +0100
message:
  FTS++ test case: popularity is broken :(
modified:
  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++/test/test-indexer.cpp'
--- extensions/fts++/test/test-indexer.cpp	2012-03-16 20:03:05 +
+++ extensions/fts++/test/test-indexer.cpp	2012-03-19 21:15:57 +
@@ -1,5 +1,7 @@
 /*
  * Copyright © 2012 Mikkel Kamstrup Erlandsen mikkel.kamst...@gmail.com
+ * Copyright © 2012 Canonical Ltd.
+ * By Siegfried-A. Gevatter siegfried.gevat...@collabora.co.uk
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -987,8 +989,6 @@
   guint event_id1, event_id2, event_id3, event_id4;
   ZeitgeistEvent* event;
   GPtrArray* results;
-  //gdouble *relevancies;
-  //gint relevancies_size;
  
   // add test events to DBs
   const char uri1[] = file:///home/fibonacci/test.py;
@@ -1029,7 +1029,7 @@
 
   // Search for LeastPopularSubjects
   results = search_simple (fix, test, NULL,
-  ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECTS, matches);
+  ZEITGEIST_RESULT_TYPE_LEAST_RECENT_SUBJECTS, matches);
 
   g_assert_cmpuint (matches, , 0);
   g_assert_cmpuint (results-len, ==, 2);
@@ -1037,6 +1037,40 @@
   assert_nth_result_has_id (results, 1, event_id4);
 }
 
+static void
+test_query_most_popular_subjects (Fixture *fix, gconstpointer data)
+{
+  guint matches;
+  guint event_id1, event_id2, event_id3, event_id4, event_id5,
+event_id6, event_id7, event_id8, event_id9;
+  ZeitgeistEvent* event;
+  GPtrArray* results;
+ 
+  // add test events to DBs
+  const char uri1[] = file:///file1.txt;
+  const char uri2[] = file:///file2.txt;
+  const char uri3[] = file:///file3.txt;
+  event_id1 = index_event (fix, create_test_event_simple (uri1, test));
+  event_id2 = index_event (fix, create_test_event_simple (uri1, test));
+  event_id3 = index_event (fix, create_test_event_simple (uri2, test));
+  event_id4 = index_event (fix, create_test_event_simple (uri1, test));
+  event_id5 = index_event (fix, create_test_event_simple (uri3, test));
+  event_id6 = index_event (fix, create_test_event_simple (uri2, test));
+  event_id7 = index_event (fix, create_test_event_simple (uri1, test));
+  event_id8 = index_event (fix, create_test_event_simple (uri3, test));
+  event_id9 = index_event (fix, create_test_event_simple (uri3, test));
+
+  // Search for MostPopularSubjects
+  results = search_simple (fix, test, NULL,
+  ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECTS, matches);
+
+  g_assert_cmpuint (matches, , 0);
+  g_assert_cmpuint (results-len, ==, 3);
+  assert_nth_result_has_id (results, 0, event_id7);
+  assert_nth_result_has_id (results, 1, event_id9);
+  assert_nth_result_has_id (results, 2, event_id6);
+}
+
 G_BEGIN_DECLS
 
 static void discard_message (const gchar *domain,
@@ -1096,6 +1130,8 @@
   setup, test_query_sort_order, teardown);
   g_test_add (/Zeitgeist/FTS/Indexer/Query/Duplicates, Fixture, 0,
   setup, test_query_with_duplicates, teardown);
+  g_test_add (/Zeitgeist/FTS/Indexer/Query/MostPopularSubjects, Fixture, 0,
+  setup, test_query_most_popular_subjects, teardown);
 
   // get rid of the rebuilding index... messages
   g_log_set_handler (NULL, G_LOG_LEVEL_MESSAGE, discard_message, NULL);

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 440: Merge lp:~zeitgeist/zeitgeist/fts-origin-hashing

2012-03-19 Thread noreply
Merge authors:
  Michal Hruby (mhr3)
Related merge proposals:
  
https://code.launchpad.net/~zeitgeist/zeitgeist/fts-origin-hashing/+merge/98281
  proposed by: Siegfried Gevatter (rainct)
  review: Approve - Siegfried Gevatter (rainct)

revno: 440 [merge]
committer: Michal Hruby michal@gmail.com
branch nick: zeitgeist
timestamp: Mon 2012-03-19 22:44:48 +0100
message:
  Merge lp:~zeitgeist/zeitgeist/fts-origin-hashing
modified:
  extensions/fts++/indexer.cpp
  extensions/fts++/indexer.h


--
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-19 19:56:38 +
+++ extensions/fts++/indexer.cpp	2012-03-19 21:33:59 +
@@ -43,6 +43,7 @@
 const Xapian::valueno VALUE_EVENT_ID = 0;
 const Xapian::valueno VALUE_TIMESTAMP = 1;
 const Xapian::valueno VALUE_URI_HASH = 2;
+const Xapian::valueno VALUE_ORIGIN_HASH = 3;
 
 #define QUERY_PARSER_FLAGS \
   Xapian::QueryParser::FLAG_PHRASE | Xapian::QueryParser::FLAG_BOOLEAN | \
@@ -763,7 +764,11 @@
 result_type == ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECTS ||
 result_type == ZEITGEIST_RESULT_TYPE_LEAST_RECENT_SUBJECTS ||
 result_type == ZEITGEIST_RESULT_TYPE_MOST_POPULAR_SUBJECTS ||
-result_type == ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_SUBJECTS)
+result_type == ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_SUBJECTS ||
+result_type == ZEITGEIST_RESULT_TYPE_MOST_RECENT_ORIGIN ||
+result_type == ZEITGEIST_RESULT_TYPE_LEAST_RECENT_ORIGIN ||
+result_type == ZEITGEIST_RESULT_TYPE_MOST_POPULAR_ORIGIN ||
+result_type == ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_ORIGIN)
 {
   maxhits = count;
 }
@@ -795,8 +800,7 @@
 result_type == ZEITGEIST_RESULT_TYPE_MOST_POPULAR_ORIGIN ||
 result_type == ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_ORIGIN)
 {
-  // FIXME: not really correct but close :)
-  enquire-set_collapse_key (VALUE_URI_HASH);
+  enquire-set_collapse_key (VALUE_ORIGIN_HASH);
 }
 else if (result_type == ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS ||
 result_type == ZEITGEIST_RESULT_TYPE_LEAST_RECENT_EVENTS)
@@ -1137,10 +1141,8 @@
 result_type == ZEITGEIST_RESULT_TYPE_MOST_POPULAR_ORIGIN ||
 result_type == ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_ORIGIN)
 {
-  // FIXME: not really correct but close :)
   enquire-set_sort_by_relevance_then_value (VALUE_TIMESTAMP, reversed_sort);
-  enquire-set_collapse_key (VALUE_URI_HASH);
-  maxhits *= 3;
+  enquire-set_collapse_key (VALUE_ORIGIN_HASH);
 }
 else
 {
@@ -1272,6 +1274,16 @@
   return results;
 }
 
+static void
+get_digest_for_uri (GChecksum *checksum, const gchar *uri,
+guint8 *digest, gsize *digest_size)
+{
+  g_checksum_update (checksum, (guchar *) uri, -1);
+  g_checksum_get_digest (checksum, digest, digest_size);
+  g_checksum_reset (checksum);
+  g_assert (digest_size == NULL || *digest_size == HASH_LENGTH);
+}
+
 void Indexer::IndexEvent (ZeitgeistEvent *event)
 {
   try
@@ -1322,19 +1334,28 @@
 return; // ignore this event completely...
   }
 
+  guint8 uri_hash[HASH_LENGTH + 1];
+  gsize hash_size = HASH_LENGTH;
+
   // We need the subject URI so we can use Xapian's collapse key feature
   // for *_SUBJECT grouping. However, to save space, we'll just save a hash.
   // A better option would be using URI's id, but for that we'd need a SQL
   // query that'd be subject to races.
   // FIXME(?): This doesn't work for events with multiple subjects.
-  g_checksum_update (checksum, (guchar *) uri.c_str (), -1);
-  guint8 uri_hash[HASH_LENGTH + 1];
-  gsize hash_size = HASH_LENGTH;
-  g_checksum_get_digest (checksum, uri_hash, hash_size);
-  g_checksum_reset (checksum);
-  g_assert (hash_size == HASH_LENGTH);
+  get_digest_for_uri (checksum, uri.c_str (), uri_hash, hash_size);
   doc.add_value (VALUE_URI_HASH, std::string((char *) uri_hash, hash_size));
 
+  size_t colon_pos = uri.find (':');
+  // FIXME: current_origin once we have that
+  val = zeitgeist_subject_get_origin (subject);
+  // make sure the schemas of the URI and origin are the same
+  if (val  colon_pos != std::string::npos  strncmp (uri.c_str (), val, colon_pos+1) == 0)
+  {
+hash_size = HASH_LENGTH;
+get_digest_for_uri (checksum, val, uri_hash, hash_size);
+doc.add_value (VALUE_ORIGIN_HASH, std::string((char *) uri_hash, hash_size));
+  }
+
   val = zeitgeist_subject_get_text (subject);
   if (val  val[0] != '\0')
   {

=== modified file 'extensions/fts++/indexer.h'
--- extensions/fts++/indexer.h	

[Zeitgeist] [Merge] lp:~zeitgeist/zeitgeist/fts-origin-hashing into lp:zeitgeist

2012-03-19 Thread noreply
The proposal to merge lp:~zeitgeist/zeitgeist/fts-origin-hashing into 
lp:zeitgeist has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~zeitgeist/zeitgeist/fts-origin-hashing/+merge/98281
-- 
https://code.launchpad.net/~zeitgeist/zeitgeist/fts-origin-hashing/+merge/98281
Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist.

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 441: Update NEWS.

2012-03-19 Thread noreply

revno: 441
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Mon 2012-03-19 22:52:42 +0100
message:
  Update NEWS.
modified:
  NEWS


--
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 'NEWS'
--- NEWS	2012-03-01 14:44:32 +
+++ NEWS	2012-03-19 21:52:42 +
@@ -3,8 +3,17 @@
 
 Engine:
  - Fixed crash when events had NULL fields (LP: #941530).
- - Made sure no aborted SQLite transactions are left open.
+ - Made sure no aborted SQLite transactions are left open (LP: #937991).
  - Enhanced logging and added --log-file option.
+ - Fixed bug Storage Monitor corrupting storage IDs in DB (LP: #950983).
+ - Fixed bug inserting previously non-existant values when searching for
+   them (LP: #953041).
+
+FTS:
+ - Filter indexing of unrecognized values (eg. non-standard URIs).
+ - Enhanced grouping by URI and origin (LP: #947835).
+ - Use current_uri instead of URI; index MOVE_EVENTs (LP: #948794).
+ - Added SearchWithRelevancies D-Bus function.
 
 2012-02-14: Zeitgeist Bluebird Alpha 3
 --

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 442: Fix tests

2012-03-19 Thread noreply

revno: 442
committer: Michal Hruby michal@gmail.com
branch nick: zeitgeist
timestamp: Mon 2012-03-19 22:55:09 +0100
message:
  Fix tests
modified:
  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++/test/test-indexer.cpp'
--- extensions/fts++/test/test-indexer.cpp	2012-03-19 21:15:57 +
+++ extensions/fts++/test/test-indexer.cpp	2012-03-19 21:55:09 +
@@ -1033,8 +1033,8 @@
 
   g_assert_cmpuint (matches, , 0);
   g_assert_cmpuint (results-len, ==, 2);
-  assert_nth_result_has_id (results, 0, event_id3);
-  assert_nth_result_has_id (results, 1, event_id4);
+  assert_nth_result_has_id (results, 0, event_id1);
+  assert_nth_result_has_id (results, 1, event_id3);
 }
 
 static void
@@ -1066,8 +1066,8 @@
 
   g_assert_cmpuint (matches, , 0);
   g_assert_cmpuint (results-len, ==, 3);
-  assert_nth_result_has_id (results, 0, event_id7);
-  assert_nth_result_has_id (results, 1, event_id9);
+  assert_nth_result_has_id (results, 0, event_id9);
+  assert_nth_result_has_id (results, 1, event_id7);
   assert_nth_result_has_id (results, 2, event_id6);
 }
 

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 443: Fix FTS tests.

2012-03-19 Thread noreply

revno: 443
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Mon 2012-03-19 22:57:17 +0100
message:
  Fix FTS tests.
modified:
  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++/test/test-indexer.cpp'
--- extensions/fts++/test/test-indexer.cpp	2012-03-19 21:55:09 +
+++ extensions/fts++/test/test-indexer.cpp	2012-03-19 21:57:17 +
@@ -1029,12 +1029,12 @@
 
   // Search for LeastPopularSubjects
   results = search_simple (fix, test, NULL,
-  ZEITGEIST_RESULT_TYPE_LEAST_RECENT_SUBJECTS, matches);
+  ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_SUBJECTS, matches);
 
   g_assert_cmpuint (matches, , 0);
   g_assert_cmpuint (results-len, ==, 2);
-  assert_nth_result_has_id (results, 0, event_id1);
-  assert_nth_result_has_id (results, 1, event_id3);
+  assert_nth_result_has_id (results, 0, event_id3);
+  assert_nth_result_has_id (results, 1, event_id4); // or event_id1 until stuff gets fixed
 }
 
 static void
@@ -1062,12 +1062,12 @@
 
   // Search for MostPopularSubjects
   results = search_simple (fix, test, NULL,
-  ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECTS, matches);
+  ZEITGEIST_RESULT_TYPE_MOST_POPULAR_SUBJECTS, matches);
 
   g_assert_cmpuint (matches, , 0);
   g_assert_cmpuint (results-len, ==, 3);
-  assert_nth_result_has_id (results, 0, event_id9);
-  assert_nth_result_has_id (results, 1, event_id7);
+  assert_nth_result_has_id (results, 0, event_id7);
+  assert_nth_result_has_id (results, 1, event_id9);
   assert_nth_result_has_id (results, 2, event_id6);
 }
 

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


[Zeitgeist] [Merge] lp:~kelemeng/activity-log-manager/bug957891 into lp:activity-log-manager

2012-03-18 Thread noreply
The proposal to merge lp:~kelemeng/activity-log-manager/bug957891 into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~kelemeng/activity-log-manager/bug957891/+merge/98054
-- 
https://code.launchpad.net/~kelemeng/activity-log-manager/bug957891/+merge/98054
Your team Activity Log Manager is subscribed to branch lp:activity-log-manager.

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 433: Merged Trever's fixes for bug 953041

2012-03-17 Thread noreply
Merge authors:
  Trever Fischer (tdfischer)
Related merge proposals:
  https://code.launchpad.net/~tdfischer/zeitgeist/bluebird/+merge/97026
  proposed by: Trever Fischer (tdfischer)
  review: Approve - Seif Lotfy (seif)

revno: 433 [merge]
committer: Seif Lotfy s...@lotfy.com
branch nick: zeitgeist
timestamp: Sat 2012-03-17 15:47:09 +0100
message:
  Merged Trever's fixes for bug 953041
modified:
  extensions/ds-registry.vala
  src/db-reader.vala
  src/engine.vala
  src/table-lookup.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/ds-registry.vala'
--- extensions/ds-registry.vala	2012-03-12 13:41:16 +
+++ extensions/ds-registry.vala	2012-03-12 14:10:17 +
@@ -144,7 +144,7 @@
 return registry;
 }
 
-private static Variant to_variant (
+public static Variant to_variant (
 HashTablestring, DataSource sources)
 {
 var vb = new VariantBuilder (new VariantType (SIG_DATASOURCES));

=== modified file 'src/db-reader.vala'
--- src/db-reader.vala	2012-03-14 12:31:51 +
+++ src/db-reader.vala	2012-03-17 14:47:09 +
@@ -667,7 +667,7 @@
 where.add_wildcard_condition (actor, val, negated);
 else
 where.add_match_condition (actor,
-actors_table.get_id (val), negated);
+actors_table.id_try_string (val), negated);
 }
 
 // Origin
@@ -727,7 +727,7 @@
 subj_mimetype, val, negated);
 else
 where.add_match_condition (subj_mimetype,
-mimetypes_table.get_id (val), negated);
+mimetypes_table.id_try_string (val), negated);
 }
 
 // URI
@@ -866,14 +866,14 @@
 if (symbols.length () == 1)
 {
 subwhere.add_match_condition (table_name,
-lookup_table.get_id (_symbol));
+lookup_table.id_try_string (_symbol));
 }
 else
 {
 var sb = new StringBuilder ();
 foreach (unowned string uri in symbols)
 {
-sb.append_printf (%d,, lookup_table.get_id (uri));
+sb.append_printf (%d,, lookup_table.id_try_string (uri));
 }
 sb.truncate (sb.len - 1);
 

=== modified file 'src/engine.vala'
--- src/engine.vala	2012-02-21 18:17:16 +
+++ src/engine.vala	2012-03-14 14:26:11 +
@@ -212,10 +212,10 @@
 insert_stmt.bind_int64 (1, event.id);
 insert_stmt.bind_int64 (2, event.timestamp);
 insert_stmt.bind_int64 (3,
-interpretations_table.get_id (event.interpretation));
+interpretations_table.id_for_string (event.interpretation));
 insert_stmt.bind_int64 (4,
-manifestations_table.get_id (event.manifestation));
-insert_stmt.bind_int64 (5, actors_table.get_id (event.actor));
+manifestations_table.id_for_string (event.manifestation));
+insert_stmt.bind_int64 (5, actors_table.id_for_string (event.actor));
 insert_stmt.bind_text (6, event.origin);
 insert_stmt.bind_int64 (7, payload_id);
 
@@ -228,12 +228,12 @@
 insert_stmt.bind_text (8, subject.uri);
 insert_stmt.bind_text (9, subject.current_uri);
 insert_stmt.bind_int64 (10,
-interpretations_table.get_id (subject.interpretation));
+interpretations_table.id_for_string (subject.interpretation));
 insert_stmt.bind_int64 (11,
-manifestations_table.get_id (subject.manifestation));
+manifestations_table.id_for_string (subject.manifestation));
 insert_stmt.bind_text (12, subject.origin);
 insert_stmt.bind_int64 (13,
-mimetypes_table.get_id (subject.mimetype));
+mimetypes_table.id_for_string (subject.mimetype));
 insert_stmt.bind_text (14, subject.text);
 // FIXME: Consider a storages_table table. Too dangerous?
 insert_stmt.bind_text (15, subject.storage);
@@ -255,10 +255,10 @@
 
 retrieval_stmt.bind_int64 (1, event.timestamp);
 retrieval_stmt.bind_int64 (2,
-interpretations_table.get_id (event.interpretation));
+interpretations_table.id_for_string (event.interpretation));
 retrieval_stmt.bind_int64 (3,
-manifestations_table.get_id (event.manifestation));
-retrieval_stmt.bind_int64 (4, actors_table.get_id (event.actor));
+

[Zeitgeist] [Merge] lp:~tdfischer/zeitgeist/bluebird into lp:zeitgeist

2012-03-17 Thread noreply
The proposal to merge lp:~tdfischer/zeitgeist/bluebird into lp:zeitgeist has 
been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~tdfischer/zeitgeist/bluebird/+merge/97026
-- 
https://code.launchpad.net/~tdfischer/zeitgeist/bluebird/+merge/97026
Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist.

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 434: DS-Registry: fix vala 0.16 incompatiblity

2012-03-17 Thread noreply

revno: 434
committer: Seif Lotfy s...@lotfy.com
branch nick: zeitgeist
timestamp: Sat 2012-03-17 15:53:25 +0100
message:
  DS-Registry: fix vala 0.16 incompatiblity
modified:
  extensions/ds-registry.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/ds-registry.vala'
--- extensions/ds-registry.vala	2012-03-12 14:10:17 +
+++ extensions/ds-registry.vala	2012-03-17 14:53:25 +
@@ -144,7 +144,7 @@
 return registry;
 }
 
-public static Variant to_variant (
+private static Variant to_variant (
 HashTablestring, DataSource sources)
 {
 var vb = new VariantBuilder (new VariantType (SIG_DATASOURCES));

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 428: FTS++: Log `current_uri' instead of `uri'

2012-03-16 Thread noreply

revno: 428
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Thu 2012-03-15 14:39:43 +0100
message:
  FTS++: Log `current_uri' instead of `uri'
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-14 12:31:51 +
+++ extensions/fts++/indexer.cpp	2012-03-15 13:39:43 +
@@ -1259,7 +1259,6 @@
 {
   try
   {
-// FIXME: we need to special case MOVE_EVENTs
 const gchar *val;
 guint event_id = zeitgeist_event_get_id (event);
 g_return_if_fail (event_id  0);
@@ -1288,7 +1287,13 @@
   ZeitgeistSubject *subject;
   subject = (ZeitgeistSubject*) g_ptr_array_index (subjects, i);
 
-  val = zeitgeist_subject_get_uri (subject);
+  // We use current_uri (vs. uri) where since we care about real stuff,
+  // not whatever happened some time ago.
+  //
+  // This will most likely still be the same as URI (unless something
+  // triggers a reindexation of the DB), but at least MOVE_EVENTS
+  // will have the updated URI.
+  val = zeitgeist_subject_get_current_uri (subject);
   if (val == NULL || val[0] == '\0') continue;
 
   std::string uri(val);

=== modified file 'extensions/fts++/test/test-indexer.cpp'
--- extensions/fts++/test/test-indexer.cpp	2012-03-14 15:47:20 +
+++ extensions/fts++/test/test-indexer.cpp	2012-03-15 13:39:43 +
@@ -203,6 +203,27 @@
   return event;
 }
 
+static ZeitgeistEvent* create_test_event8 (void)
+{
+  ZeitgeistEvent *event = zeitgeist_event_new ();
+  ZeitgeistSubject *subject = zeitgeist_subject_new ();
+  
+  zeitgeist_subject_set_interpretation (subject, ZEITGEIST_NFO_PRESENTATION);
+  zeitgeist_subject_set_manifestation (subject, ZEITGEIST_NFO_FILE_DATA_OBJECT);
+  zeitgeist_subject_set_uri (subject, file:///home/username/Documents/my_fabulous_presentation.pdf);
+  zeitgeist_subject_set_current_uri (subject, file:///home/username/Awesome.pdf);
+  zeitgeist_subject_set_text (subject, NULL);
+  zeitgeist_subject_set_mimetype (subject, application/pdf);
+
+  zeitgeist_event_set_interpretation (event, ZEITGEIST_ZG_MOVE_EVENT);
+  zeitgeist_event_set_manifestation (event, ZEITGEIST_ZG_USER_ACTIVITY);
+  zeitgeist_event_set_actor (event, application://nautilus.desktop);
+  zeitgeist_event_add_subject (event, subject);
+
+  g_object_unref (subject);
+  return event;
+}
+
 // Steals the event, ref it if you want to keep it
 static guint
 index_event (Fixture *fix, ZeitgeistEvent *event)
@@ -838,6 +859,36 @@
   zeitgeist_event_get_id ((ZeitgeistEvent*) results-pdata[0]));
 }
 
+static void
+test_simple_move_event (Fixture *fix, gconstpointer data)
+{
+  guint matches;
+  guint event_id;
+  ZeitgeistEvent* event;
+ 
+  // add test events to DBs
+  index_event (fix, create_test_event1 ());
+  index_event (fix, create_test_event4 ());
+  event_id = index_event (fix, create_test_event8 ());
+
+  GPtrArray *results =
+zeitgeist_indexer_search (fix-indexer,
+  awesome,
+  zeitgeist_time_range_new_anytime (),
+  g_ptr_array_new (),
+  0,
+  10,
+  ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS,
+  matches,
+  NULL);
+
+  g_assert_cmpuint (matches, , 0);
+  g_assert_cmpuint (results-len, ==, 1);
+
+  event = (ZeitgeistEvent*) results-pdata[0];
+  g_assert_cmpuint (zeitgeist_event_get_id (event), ==, event_id);
+}
+
 G_BEGIN_DECLS
 
 static void discard_message (const gchar *domain,
@@ -881,6 +932,8 @@
   setup, test_simple_relevancies_query, teardown);
   g_test_add (/Zeitgeist/FTS/Indexer/RelevanciesSubject, Fixture, 0,
   setup, test_simple_relevancies_subject_query, teardown);
+  g_test_add (/Zeitgeist/FTS/Indexer/MoveEvent, Fixture, 0,
+  setup, test_simple_move_event, teardown);
 
   // get rid of the rebuilding index... messages
   g_log_set_handler (NULL, G_LOG_LEVEL_MESSAGE, discard_message, NULL);

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 431: FTS++: more test stuff (add more asserts, extend {Most, Least}Recent tests,

2012-03-16 Thread noreply

revno: 431
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Fri 2012-03-16 19:41:52 +0100
message:
  FTS++: more test stuff (add more asserts, extend {Most,Least}Recent tests,
 introduce new helper function)
modified:
  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++/test/test-indexer.cpp'
--- extensions/fts++/test/test-indexer.cpp	2012-03-16 18:05:50 +
+++ extensions/fts++/test/test-indexer.cpp	2012-03-16 18:41:52 +
@@ -63,9 +63,11 @@
 }
 
 static void
-assert_nth_result_has_id (GPtrArray* results, int n, guint32 event_id)
+assert_nth_result_has_id (GPtrArray* results, guint n, guint32 event_id)
 {
+  g_assert_cmpuint (n, , results-len);
   ZeitgeistEvent *event = (ZeitgeistEvent*) results-pdata[n];
+  g_assert (event);
   g_assert_cmpuint (zeitgeist_event_get_id (event), ==, event_id);
 }
 
@@ -74,9 +76,13 @@
 static void
 assert_nth_result_has_text (GPtrArray* results, int n, const char *text)
 {
+  g_assert_cmpuint (n, , results-len);
   ZeitgeistEvent *event = (ZeitgeistEvent*) results-pdata[n];
+  g_assert (event);
+  g_assert_cmpint (zeitgeist_event_num_subjects (event), ==, 1);
   ZeitgeistSubject *subject = (ZeitgeistSubject*)
 g_ptr_array_index (zeitgeist_event_get_subjects (event), 0);
+  g_assert (subject);
   g_assert_cmpstr (zeitgeist_subject_get_text (subject), ==, text);
 }
 
@@ -275,6 +281,42 @@
   return event_id;
 }
 
+static GPtrArray*
+search_simple (Fixture *fix, const char *text, GPtrArray *templates,
+ZeitgeistResultType result_type, guint *matches)
+{
+  if (!templates) templates = g_ptr_array_new ();
+  return zeitgeist_indexer_search (fix-indexer,
+text,
+zeitgeist_time_range_new_anytime (),
+templates,
+0, // offset
+10, // count
+result_type,
+matches,
+NULL);
+}
+
+static GPtrArray*
+search_with_relevancies_simple (Fixture *fix, const char *text,
+GPtrArray *templates, ZeitgeistResultType result_type,
+gdouble **relevancies, gint *relevancies_size, guint *matches)
+{
+  if (!templates) templates = g_ptr_array_new ();
+  return zeitgeist_indexer_search_with_relevancies (fix-indexer,
+text,
+zeitgeist_time_range_new_anytime (),
+templates,
+ZEITGEIST_STORAGE_STATE_ANY,
+0, // offset
+10, // count
+result_type,
+relevancies,
+relevancies_size,
+matches,
+NULL);
+}
+
 static void
 test_simple_query (Fixture *fix, gconstpointer data)
 {
@@ -288,16 +330,8 @@
   index_event (fix, create_test_event3 ());
   index_event (fix, create_test_event4 ());
 
-  GPtrArray *results =
-zeitgeist_indexer_search (fix-indexer,
-  text,
-  zeitgeist_time_range_new_anytime (),
-  g_ptr_array_new (),
-  0,
-  10,
-  ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS,
-  matches,
-  NULL);
+  GPtrArray *results = search_simple (fix, text, NULL,
+  ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS, matches);
 
   g_assert_cmpuint (matches, , 0);
   g_assert_cmpuint (results-len, ==, 1);
@@ -310,16 +344,9 @@
 {
   guint matches;
 
-  GPtrArray *results =
-zeitgeist_indexer_search (fix-indexer,
-  NothingWillEverMatchThisMwhahahaha,
-  zeitgeist_time_range_new_anytime (),
-  g_ptr_array_new (),
-  0,
-  10,
-  ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS,
-  matches,
-  NULL);
+  GPtrArray *results = search_simple (fix,
+  NothingWillEverMatchThisMwhahahaha, NULL,
+  ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS, matches);
 
   g_assert_cmpuint (matches, ==, 0);
   g_assert_cmpuint (results-len, ==, 0);
@@ -352,16 +379,8 @@
   zeitgeist_event_set_interpretation (event, ZEITGEIST_NFO_DOCUMENT);
   g_ptr_array_add (filters, event); // steals ref
 
-  GPtrArray *results =
-zeitgeist_indexer_search 

[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 430: FTS++: some more test cases and add a couple utility functions

2012-03-16 Thread noreply

revno: 430
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Fri 2012-03-16 19:05:50 +0100
message:
  FTS++: some more test cases and add a couple utility functions
modified:
  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++/test/test-indexer.cpp'
--- extensions/fts++/test/test-indexer.cpp	2012-03-16 17:08:43 +
+++ extensions/fts++/test/test-indexer.cpp	2012-03-16 18:05:50 +
@@ -62,6 +62,24 @@
   g_object_unref (fix-db);
 }
 
+static void
+assert_nth_result_has_id (GPtrArray* results, int n, guint32 event_id)
+{
+  ZeitgeistEvent *event = (ZeitgeistEvent*) results-pdata[n];
+  g_assert_cmpuint (zeitgeist_event_get_id (event), ==, event_id);
+}
+
+// This function only supports events with a single subject,
+// since that's enough for the tests in this file.
+static void
+assert_nth_result_has_text (GPtrArray* results, int n, const char *text)
+{
+  ZeitgeistEvent *event = (ZeitgeistEvent*) results-pdata[n];
+  ZeitgeistSubject *subject = (ZeitgeistSubject*)
+g_ptr_array_index (zeitgeist_event_get_subjects (event), 0);
+  g_assert_cmpstr (zeitgeist_subject_get_text (subject), ==, text);
+}
+
 static ZeitgeistEvent* create_test_event1 (void)
 {
   ZeitgeistEvent *event = zeitgeist_event_new ();
@@ -131,7 +149,7 @@
   zeitgeist_subject_set_interpretation (subject, ZEITGEIST_NFO_PRESENTATION);
   zeitgeist_subject_set_manifestation (subject, ZEITGEIST_NFO_FILE_DATA_OBJECT);
   zeitgeist_subject_set_uri (subject, file:///home/username/Documents/my_fabulous_presentation.pdf);
-  zeitgeist_subject_set_text (subject, NULL);
+  zeitgeist_subject_set_text (subject, test texts);
   zeitgeist_subject_set_mimetype (subject, application/pdf);
 
   zeitgeist_event_set_interpretation (event, ZEITGEIST_ZG_MODIFY_EVENT);
@@ -191,7 +209,7 @@
   zeitgeist_subject_set_interpretation (subject, ZEITGEIST_NFO_PRESENTATION);
   zeitgeist_subject_set_manifestation (subject, ZEITGEIST_NFO_FILE_DATA_OBJECT);
   zeitgeist_subject_set_uri (subject, file:///home/username/directory-with-dashes/and.dot/%C4%8C%20some-intl/CamelCasePresentation.pdf);
-  zeitgeist_subject_set_text (subject, NULL);
+  zeitgeist_subject_set_text (subject, some more texts);
   zeitgeist_subject_set_mimetype (subject, application/pdf);
 
   zeitgeist_event_set_interpretation (event, ZEITGEIST_ZG_MODIFY_EVENT);
@@ -212,7 +230,7 @@
   zeitgeist_subject_set_manifestation (subject, ZEITGEIST_NFO_FILE_DATA_OBJECT);
   zeitgeist_subject_set_uri (subject, file:///home/username/Documents/my_fabulous_presentation.pdf);
   zeitgeist_subject_set_current_uri (subject, file:///home/username/Awesome.pdf);
-  zeitgeist_subject_set_text (subject, NULL);
+  zeitgeist_subject_set_text (subject, some more textt about a presentation or something);
   zeitgeist_subject_set_mimetype (subject, application/pdf);
 
   zeitgeist_event_set_interpretation (event, ZEITGEIST_ZG_MOVE_EVENT);
@@ -283,13 +301,8 @@
 
   g_assert_cmpuint (matches, , 0);
   g_assert_cmpuint (results-len, ==, 1);
-
-  event = (ZeitgeistEvent*) results-pdata[0];
-  g_assert_cmpuint (zeitgeist_event_get_id (event), ==, event_id);
-
-  ZeitgeistSubject *subject = (ZeitgeistSubject*)
-g_ptr_array_index (zeitgeist_event_get_subjects (event), 0);
-  g_assert_cmpstr (zeitgeist_subject_get_text (subject), ==, text);
+  assert_nth_result_has_id (results, 0, event_id);
+  assert_nth_result_has_text (results, 0, text);
 }
 
 static void
@@ -328,7 +341,6 @@
 test_simple_with_filter (Fixture *fix, gconstpointer data)
 {
   guint matches;
-  guint event_id;
   ZeitgeistEvent* event;
 
   // add test events to DBs
@@ -387,25 +399,19 @@
 
   g_assert_cmpuint (matches, , 0);
   g_assert_cmpuint (results-len, ==, 1);
-
-  event = (ZeitgeistEvent*) results-pdata[0];
-  g_assert_cmpuint (zeitgeist_event_get_id (event), ==, event_id);
-
-  subject = (ZeitgeistSubject*)
-g_ptr_array_index (zeitgeist_event_get_subjects (event), 0);
-  g_assert_cmpstr (zeitgeist_subject_get_text (subject), ==, text);
+  assert_nth_result_has_id (results, 0, event_id);
+  assert_nth_result_has_text (results, 0, text);
 }
 
 static void
 test_simple_negation (Fixture *fix, gconstpointer data)
 {
   guint matches;
-  guint event_id;
   ZeitgeistEvent* event;
   ZeitgeistSubject *subject;
 
   // add test events to DBs
-  event_id = index_event (fix, create_test_event1 ());
+  index_event (fix, create_test_event1 ());
   index_event (fix, create_test_event2 ());
 
   GPtrArray *filters = g_ptr_array_new_with_free_func (g_object_unref);
@@ -434,12 +440,11 @@
 test_simple_noexpand (Fixture *fix, gconstpointer data)
 {
   guint matches;
-  guint 

[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 429: FTS++: Change to current_uri in some more places. Add random test cases.

2012-03-16 Thread noreply

revno: 429
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Fri 2012-03-16 18:08:43 +0100
message:
  FTS++: Change to current_uri in some more places. Add random test cases.
modified:
  extensions/fts++/indexer.cpp
  extensions/fts++/test/test-indexer.cpp
  test/dbus/engine-test.py


--
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-15 13:39:43 +
+++ extensions/fts++/indexer.cpp	2012-03-16 17:08:43 +
@@ -262,7 +262,10 @@
 for (unsigned j = 0; j  subjects-len; j++)
 {
   ZeitgeistSubject *subject = (ZeitgeistSubject*) g_ptr_array_index (subjects, j);
+  // For backwards compatibility, we still check URI
   val = zeitgeist_subject_get_uri (subject);
+  if (!val || val[0] == '\0')
+  val = zeitgeist_subject_get_current_uri (subject);
   if (val  val[0] != '\0')
 tmpl.push_back (zgsu: + StringUtils::MangleUri (val));
 
@@ -344,7 +347,7 @@
   for (unsigned j = 0; j  subjects-len; j++)
   {
 ZeitgeistSubject *subject = (ZeitgeistSubject*) g_ptr_array_index (subjects, j);
-val = zeitgeist_subject_get_uri (subject);
+val = zeitgeist_subject_get_current_uri (subject);
 if (val  val[0] != '\0')
   doc.add_boolean_term (StringUtils::Truncate (FILTER_PREFIX_SUBJECT_URI + StringUtils::MangleUri (val)));
 
@@ -928,12 +931,13 @@
   if (subjects == NULL) continue;
   for (unsigned j = 0; j  subjects-len; j++)
   {
-const gchar *subj_uri = zeitgeist_subject_get_uri ((ZeitgeistSubject*) subjects-pdata[j]);
+const gchar *subj_uri = zeitgeist_subject_get_current_uri (
+(ZeitgeistSubject*) subjects-pdata[j]);
 if (subj_uri == NULL) continue;
 remapper[subj_uri] = event_id;
 ZeitgeistEvent *event = zeitgeist_event_new ();
 ZeitgeistSubject *subject = zeitgeist_subject_new ();
-zeitgeist_subject_set_uri (subject, subj_uri);
+zeitgeist_subject_set_current_uri (subject, subj_uri);
 zeitgeist_event_add_subject (event, subject); // FIXME: leaks?
 g_ptr_array_add (event_templates, event);
   }
@@ -976,7 +980,8 @@
   if (subjects == NULL) continue;
   for (unsigned j = 0; j  subjects-len; j++)
   {
-const gchar *subj_uri = zeitgeist_subject_get_uri ((ZeitgeistSubject*) subjects-pdata[j]);
+const gchar *subj_uri = zeitgeist_subject_get_current_uri (
+(ZeitgeistSubject*) subjects-pdata[j]);
 if (subj_uri == NULL) continue;
 relevancy_map[event_id] = relevancy_map[remapper[subj_uri]];
   }

=== modified file 'extensions/fts++/test/test-indexer.cpp'
--- extensions/fts++/test/test-indexer.cpp	2012-03-15 13:39:43 +
+++ extensions/fts++/test/test-indexer.cpp	2012-03-16 17:08:43 +
@@ -293,6 +293,38 @@
 }
 
 static void
+test_simple_query_empty_database (Fixture *fix, gconstpointer data)
+{
+  guint matches;
+
+  GPtrArray *results =
+zeitgeist_indexer_search (fix-indexer,
+  NothingWillEverMatchThisMwhahahaha,
+  zeitgeist_time_range_new_anytime (),
+  g_ptr_array_new (),
+  0,
+  10,
+  ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS,
+  matches,
+  NULL);
+
+  g_assert_cmpuint (matches, ==, 0);
+  g_assert_cmpuint (results-len, ==, 0);
+}
+
+static void
+test_simple_query_no_results (Fixture *fix, gconstpointer data)
+{
+  // add test events to DBs
+  index_event (fix, create_test_event1 ());
+  index_event (fix, create_test_event2 ());
+  index_event (fix, create_test_event3 ());
+  index_event (fix, create_test_event4 ());
+
+  test_simple_query_empty_database (fix, data);
+}
+
+static void
 test_simple_with_filter (Fixture *fix, gconstpointer data)
 {
   guint matches;
@@ -889,6 +921,37 @@
   g_assert_cmpuint (zeitgeist_event_get_id (event), ==, event_id);
 }
 
+static void
+test_simple_least_recent (Fixture *fix, gconstpointer data)
+{
+  guint matches;
+  guint event_id1, event_id2, event_id3, event_id4;
+  ZeitgeistEvent* event;
+ 
+  // add test events to DBs
+  event_id1 = index_event (fix, create_test_event1 ());
+  event_id2 = index_event (fix, create_test_event2 ());
+  event_id3 = index_event (fix, create_test_event3 ());
+  event_id4 = index_event (fix, create_test_event4 ());
+
+  GPtrArray *results =
+zeitgeist_indexer_search (fix-indexer,
+  ,
+  zeitgeist_time_range_new_anytime (),
+ 

[Zeitgeist] [Merge] lp:~rainct/zeitgeist/fts-current-uri into lp:zeitgeist

2012-03-16 Thread noreply
The proposal to merge lp:~rainct/zeitgeist/fts-current-uri into lp:zeitgeist 
has been updated.

Status: Approved = Merged

For more details, see:
https://code.launchpad.net/~rainct/zeitgeist/fts-current-uri/+merge/97655
-- 
https://code.launchpad.net/~rainct/zeitgeist/fts-current-uri/+merge/97655
Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist.

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 432: FTS++: More test cases. These expose two bugs! ZOMG! :)

2012-03-16 Thread noreply

revno: 432
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Fri 2012-03-16 21:03:05 +0100
message:
  FTS++: More test cases. These expose two bugs! ZOMG! :)
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-16 17:08:43 +
+++ extensions/fts++/indexer.cpp	2012-03-16 20:03:05 +
@@ -738,6 +738,7 @@
   return query_string;
 }
 
+// FIXME: this is missing the Storage State parameter
 GPtrArray* Indexer::Search (const gchar *search,
 ZeitgeistTimeRange *time_range,
 GPtrArray *templates,

=== modified file 'extensions/fts++/test/test-indexer.cpp'
--- extensions/fts++/test/test-indexer.cpp	2012-03-16 18:41:52 +
+++ extensions/fts++/test/test-indexer.cpp	2012-03-16 20:03:05 +
@@ -248,6 +248,26 @@
   return event;
 }
 
+static ZeitgeistEvent* create_test_event_simple (const char *uri, const char *text)
+{
+  ZeitgeistEvent *event = zeitgeist_event_new ();
+  ZeitgeistSubject *subject = zeitgeist_subject_new ();
+  
+  zeitgeist_subject_set_interpretation (subject, ZEITGEIST_NFO_DOCUMENT);
+  zeitgeist_subject_set_manifestation (subject, ZEITGEIST_NFO_FILE_DATA_OBJECT);
+  zeitgeist_subject_set_uri (subject, uri);
+  zeitgeist_subject_set_text (subject, text);
+  zeitgeist_subject_set_mimetype (subject, text/plain);
+
+  zeitgeist_event_set_interpretation (event, ZEITGEIST_ZG_ACCESS_EVENT);
+  zeitgeist_event_set_manifestation (event, ZEITGEIST_ZG_USER_ACTIVITY);
+  zeitgeist_event_set_actor (event, application://random.desktop);
+  zeitgeist_event_add_subject (event, subject);
+
+  g_object_unref (subject);
+  return event;
+}
+
 // Steals the event, ref it if you want to keep it
 static guint
 index_event (Fixture *fix, ZeitgeistEvent *event)
@@ -278,6 +298,10 @@
 zeitgeist_indexer_process_task (fix-indexer);
   }
 
+  // sleep for 1 msec to make sure the next event will have a
+  // different timestamp
+  g_usleep (1000);
+
   return event_id;
 }
 
@@ -298,6 +322,23 @@
 }
 
 static GPtrArray*
+search_with_count (Fixture *fix, const char *text, GPtrArray *templates,
+ZeitgeistResultType result_type, guint offset, guint count,
+guint *matches)
+{
+  if (!templates) templates = g_ptr_array_new ();
+  return zeitgeist_indexer_search (fix-indexer,
+text,
+zeitgeist_time_range_new_anytime (),
+templates,
+offset,
+count,
+result_type,
+matches,
+NULL);
+}
+
+static GPtrArray*
 search_with_relevancies_simple (Fixture *fix, const char *text,
 GPtrArray *templates, ZeitgeistResultType result_type,
 gdouble **relevancies, gint *relevancies_size, guint *matches)
@@ -322,7 +363,6 @@
 {
   guint matches;
   guint event_id;
-  ZeitgeistEvent* event;
  
   // add test events to DBs
   event_id = index_event (fix, create_test_event1 ());
@@ -365,6 +405,23 @@
 }
 
 static void
+test_simple_recognize_schemas (Fixture *fix, gconstpointer data)
+{
+  guint matches;
+
+  // add test events to DBs
+  index_event (fix, create_test_event_simple (file://a.ok, getme1));
+  index_event (fix, create_test_event_simple (ubuntuone://a.bad, getme2));
+
+  GPtrArray *results = search_simple (fix, getme*, NULL,
+  ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS, matches);
+
+  g_assert_cmpuint (matches, , 0);
+  g_assert_cmpuint (results-len, ==, 1);
+  assert_nth_result_has_text (results, 0, getme1);
+}
+
+static void
 test_simple_with_filter (Fixture *fix, gconstpointer data)
 {
   guint matches;
@@ -788,7 +845,7 @@
 }
 
 static void
-test_simple_most_recent (Fixture *fix, gconstpointer data)
+test_query_most_recent (Fixture *fix, gconstpointer data)
 {
   guint matches;
   guint event_id1, event_id2, event_id3, event_id4;
@@ -840,7 +897,7 @@
 }
 
 static void
-test_simple_least_recent (Fixture *fix, gconstpointer data)
+test_query_least_recent (Fixture *fix, gconstpointer data)
 {
   guint matches;
   guint event_id1, event_id2, event_id3, event_id4;
@@ -891,6 +948,95 @@
   }
 }
 
+static void
+test_query_sort_order (Fixture *fix, gconstpointer data)
+{
+  guint matches;
+  guint event_id1, event_id2, event_id3, event_id4;
+  ZeitgeistEvent* event;
+  GPtrArray* results;
+ 
+  // add test events to DBs
+  event_id1 = index_event (fix, create_test_event_simple (file://uri1, !sort));
+  event_id2 = index_event (fix, 

[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 427: Fix signature of the blacklist signals

2012-03-15 Thread noreply

revno: 427
committer: Michal Hruby michal@gmail.com
branch nick: zeitgeist
timestamp: Thu 2012-03-15 10:25:01 +0100
message:
  Fix signature of the blacklist signals
modified:
  extensions/blacklist.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/blacklist.vala'
--- extensions/blacklist.vala	2012-03-01 15:04:19 +
+++ extensions/blacklist.vala	2012-03-15 09:25:01 +
@@ -37,9 +37,9 @@
 throws Error;
 
 public signal void template_added (string template_id,
-[DBus (signature = s(asaasay))] Variant event_template);
+[DBus (signature = (asaasay))] Variant event_template);
 public signal void template_removed (string template_id,
-[DBus (signature = s(asassay))] Variant event_template);
+[DBus (signature = (asassay))] Variant event_template);
 }
 
 namespace BlacklistTemplates

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


[Zeitgeist] [Merge] lp:~dhananjaysathe/zeitgeist-explorer/zeitgeist-explorer into lp:zeitgeist-explorer

2012-03-15 Thread noreply
The proposal to merge lp:~dhananjaysathe/zeitgeist-explorer/zeitgeist-explorer 
into lp:zeitgeist-explorer has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~dhananjaysathe/zeitgeist-explorer/zeitgeist-explorer/+merge/97531
-- 
https://code.launchpad.net/~dhananjaysathe/zeitgeist-explorer/zeitgeist-explorer/+merge/97531
Your team Zeitgeist Framework Team is subscribed to branch 
lp:zeitgeist-explorer.

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


[Zeitgeist] [Merge] lp:~tdfischer/zeitgeist-explorer/latest-gi into lp:zeitgeist-explorer

2012-03-15 Thread noreply
The proposal to merge lp:~tdfischer/zeitgeist-explorer/latest-gi into 
lp:zeitgeist-explorer has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~tdfischer/zeitgeist-explorer/latest-gi/+merge/97719
-- 
https://code.launchpad.net/~tdfischer/zeitgeist-explorer/latest-gi/+merge/97719
Your team Zeitgeist Framework Team is subscribed to branch 
lp:zeitgeist-explorer.

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 423: Merge lp:~mhr3/zeitgeist/fts-secondary-sorting

2012-03-14 Thread noreply
Merge authors:
  Michal Hruby (mhr3)
Related merge proposals:
  https://code.launchpad.net/~mhr3/zeitgeist/fts-secondary-sorting/+merge/96479
  proposed by: Michal Hruby (mhr3)
  review: Approve - Siegfried Gevatter (rainct)

revno: 423 [merge]
committer: Michal Hruby michal@gmail.com
branch nick: zeitgeist
timestamp: Wed 2012-03-14 13:34:10 +0100
message:
  Merge lp:~mhr3/zeitgeist/fts-secondary-sorting
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-12 14:22:16 +
+++ extensions/fts++/indexer.cpp	2012-03-14 12:31:51 +
@@ -824,7 +824,6 @@
 
   if (event_templates-len  0)
   {
-ZeitgeistTimeRange *time_range = zeitgeist_time_range_new_anytime ();
 results = zeitgeist_db_reader_find_events (zg_reader,
time_range,
event_templates,
@@ -833,8 +832,6 @@
result_type,
NULL,
error);
-
-g_object_unref (time_range);
   }
   else
   {
@@ -861,6 +858,208 @@
   return results;
 }
 
+static guint32*
+find_event_ids_for_combined_template (ZeitgeistDbReader *zg_reader,
+  ZeitgeistWhereClause *query_clause, // steals
+  GPtrArray *event_templates, // steals
+  guint count,
+  ZeitgeistResultType result_type,
+  gint *event_ids_length,
+  GError **error)
+{
+  g_return_val_if_fail (error == NULL || (error  *error == NULL), NULL);
+
+  ZeitgeistWhereClause *uri_where;
+  uri_where = zeitgeist_db_reader_get_where_clause_from_event_templates (
+  zg_reader, event_templates, error);
+  g_ptr_array_unref (event_templates);
+
+  zeitgeist_where_clause_extend (query_clause, uri_where);
+  g_object_unref (G_OBJECT (uri_where));
+
+  guint32 *event_ids;
+  event_ids = zeitgeist_db_reader_find_event_ids_for_clause (zg_reader,
+  query_clause, count, result_type, event_ids_length, error);
+
+  g_object_unref (query_clause);
+
+  return event_ids;
+}
+
+static GPtrArray*
+find_events_for_result_type_and_ids (ZeitgeistDbReader *zg_reader,
+ ZeitgeistTimeRange *time_range,
+ GPtrArray *templates,
+ ZeitgeistStorageState storage_state,
+ unsigned count,
+ ZeitgeistResultType result_type,
+ std::vectorunsigned const event_ids,
+ std::mapunsigned, gdouble relevancy_map,
+ GError **error)
+{
+  GPtrArray *results = NULL;
+  results = zeitgeist_db_reader_get_events (zg_reader,
+const_castunsigned*(event_ids[0]),
+event_ids.size (),
+NULL,
+error);
+
+  if (error  *error) return NULL;
+
+  if (result_type == ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS ||
+  result_type == ZEITGEIST_RESULT_TYPE_LEAST_RECENT_EVENTS)
+return results;
+
+  if (result_type == ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECTS ||
+  result_type == ZEITGEIST_RESULT_TYPE_LEAST_RECENT_SUBJECTS ||
+  result_type == ZEITGEIST_RESULT_TYPE_MOST_POPULAR_SUBJECTS ||
+  result_type == ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_SUBJECTS)
+  {
+// need to get the uris from the events and do another find_events call
+GPtrArray *event_templates;
+event_templates = g_ptr_array_new_with_free_func (g_object_unref);
+std::mapstd::string, unsigned remapper;
+
+for (unsigned i = 0; i  results-len; i++)
+{
+  ZeitgeistEvent* original_event = (ZeitgeistEvent*) results-pdata[i];
+  unsigned event_id = zeitgeist_event_get_id (original_event);
+  GPtrArray *subjects = zeitgeist_event_get_subjects (original_event);
+  if (subjects == NULL) continue;
+  for (unsigned j = 0; j  subjects-len; j++)
+  {
+const gchar *subj_uri = zeitgeist_subject_get_uri ((ZeitgeistSubject*) subjects-pdata[j]);
+if (subj_uri == NULL) continue;
+remapper[subj_uri] = event_id;
+ZeitgeistEvent *event = 

[Zeitgeist] [Merge] lp:~mhr3/zeitgeist/fts-secondary-sorting into lp:zeitgeist

2012-03-14 Thread noreply
The proposal to merge lp:~mhr3/zeitgeist/fts-secondary-sorting into 
lp:zeitgeist has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~mhr3/zeitgeist/fts-secondary-sorting/+merge/96479
-- 
https://code.launchpad.net/~mhr3/zeitgeist/fts-secondary-sorting/+merge/96479
Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist.

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 424: Make sure we mangle dashes

2012-03-14 Thread noreply

revno: 424
committer: Michal Hruby michal@gmail.com
branch nick: zeitgeist
timestamp: Wed 2012-03-14 13:50:33 +0100
message:
  Make sure we mangle dashes
modified:
  extensions/fts++/stringutils.cpp
  extensions/fts++/test/test-indexer.cpp
  extensions/fts++/test/test-stringutils.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++/stringutils.cpp'
--- extensions/fts++/stringutils.cpp	2012-02-14 16:56:04 +
+++ extensions/fts++/stringutils.cpp	2012-03-14 12:50:33 +
@@ -71,7 +71,7 @@
 {
   string s(orig);
   size_t pos = 0;
-  while ((pos = s.find_first_of (: /, pos)) != string::npos)
+  while ((pos = s.find_first_of (: /-, pos)) != string::npos)
   {
 s.replace (pos, 1, 1, '_');
 pos++;

=== modified file 'extensions/fts++/test/test-indexer.cpp'
--- extensions/fts++/test/test-indexer.cpp	2012-03-11 18:58:01 +
+++ extensions/fts++/test/test-indexer.cpp	2012-03-14 12:50:33 +
@@ -183,6 +183,26 @@
   return event;
 }
 
+static ZeitgeistEvent* create_test_event7 (void)
+{
+  ZeitgeistEvent *event = zeitgeist_event_new ();
+  ZeitgeistSubject *subject = zeitgeist_subject_new ();
+  
+  zeitgeist_subject_set_interpretation (subject, ZEITGEIST_NFO_PRESENTATION);
+  zeitgeist_subject_set_manifestation (subject, ZEITGEIST_NFO_FILE_DATA_OBJECT);
+  zeitgeist_subject_set_uri (subject, file:///home/username/directory-with-dashes/CamelCasePresentation.pdf);
+  zeitgeist_subject_set_text (subject, NULL);
+  zeitgeist_subject_set_mimetype (subject, application/pdf);
+
+  zeitgeist_event_set_interpretation (event, ZEITGEIST_ZG_MODIFY_EVENT);
+  zeitgeist_event_set_manifestation (event, ZEITGEIST_ZG_USER_ACTIVITY);
+  zeitgeist_event_set_actor (event, application://libreoffice-impress.desktop);
+  zeitgeist_event_add_subject (event, subject);
+
+  g_object_unref (subject);
+  return event;
+}
+
 // Steals the event, ref it if you want to keep it
 static guint
 index_event (Fixture *fix, ZeitgeistEvent *event)
@@ -539,6 +559,49 @@
 }
 
 static void
+test_simple_dashes_prefix (Fixture *fix, gconstpointer data)
+{
+  guint matches;
+  guint event_id;
+  ZeitgeistEvent* event;
+  ZeitgeistSubject *subject;
+
+  // add test events to DBs
+  index_event (fix, create_test_event1 ());
+  index_event (fix, create_test_event2 ());
+  index_event (fix, create_test_event3 ());
+  index_event (fix, create_test_event4 ());
+  index_event (fix, create_test_event5 ());
+  index_event (fix, create_test_event6 ());
+  event_id = index_event (fix, create_test_event7 ());
+
+  GPtrArray *event_template = g_ptr_array_new ();
+  event = zeitgeist_event_new ();
+  subject = zeitgeist_subject_new ();
+  zeitgeist_subject_set_uri (subject,
+  file:///home/username/directory-with-dashes/*);
+  zeitgeist_event_add_subject (event, subject);
+  g_ptr_array_add (event_template, event);
+
+  GPtrArray *results =
+zeitgeist_indexer_search (fix-indexer,
+  pdf,
+  zeitgeist_time_range_new_anytime (),
+  event_template,
+  0,
+  10,
+  ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS,
+  matches,
+  NULL);
+
+  g_assert_cmpuint (matches, , 0);
+  g_assert_cmpuint (results-len, ==, 1);
+
+  event = (ZeitgeistEvent*) results-pdata[0];
+  g_assert_cmpuint (zeitgeist_event_get_id (event), ==, event_id);
+}
+
+static void
 test_simple_cjk (Fixture *fix, gconstpointer data)
 {
   guint matches;
@@ -716,6 +779,8 @@
   setup, test_simple_underscores, teardown);
   g_test_add (/Zeitgeist/FTS/Indexer/SimpleCamelcase, Fixture, 0,
   setup, test_simple_camelcase, teardown);
+  g_test_add (/Zeitgeist/FTS/Indexer/PrefixWithDashes, Fixture, 0,
+  setup, test_simple_dashes_prefix, teardown);
   g_test_add (/Zeitgeist/FTS/Indexer/URLUnescape, Fixture, 0,
   setup, test_simple_url_unescape, teardown);
   g_test_add (/Zeitgeist/FTS/Indexer/IDNSupport, Fixture, 0,

=== modified file 'extensions/fts++/test/test-stringutils.cpp'
--- extensions/fts++/test/test-stringutils.cpp	2012-02-14 16:56:04 +
+++ extensions/fts++/test/test-stringutils.cpp	2012-03-14 12:50:33 +
@@ -76,7 +76,7 @@
 
   g_assert_cmpstr (file, ==, StringUtils::MangleUri(file).c_str ());
   g_assert_cmpstr (file___, ==, StringUtils::MangleUri(file://).c_str ());
-  g_assert_cmpstr (http___www.zeitgeist-project.com, ==,
+  g_assert_cmpstr (http___www.zeitgeist_project.com, ==,
   StringUtils::MangleUri(http://www.zeitgeist-project.com;).c_str ());
 
   g_assert_cmpstr (scheme_no_spaces_in_uris, ==,


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 425: Make sure we mangle dots

2012-03-14 Thread noreply

revno: 425
committer: Michal Hruby michal@gmail.com
branch nick: zeitgeist
timestamp: Wed 2012-03-14 13:58:22 +0100
message:
  Make sure we mangle dots
modified:
  extensions/fts++/stringutils.cpp
  extensions/fts++/test/test-indexer.cpp
  extensions/fts++/test/test-stringutils.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++/stringutils.cpp'
--- extensions/fts++/stringutils.cpp	2012-03-14 12:50:33 +
+++ extensions/fts++/stringutils.cpp	2012-03-14 12:58:22 +
@@ -71,7 +71,7 @@
 {
   string s(orig);
   size_t pos = 0;
-  while ((pos = s.find_first_of (: /-, pos)) != string::npos)
+  while ((pos = s.find_first_of (: /-., pos)) != string::npos)
   {
 s.replace (pos, 1, 1, '_');
 pos++;

=== modified file 'extensions/fts++/test/test-indexer.cpp'
--- extensions/fts++/test/test-indexer.cpp	2012-03-14 12:50:33 +
+++ extensions/fts++/test/test-indexer.cpp	2012-03-14 12:58:22 +
@@ -190,7 +190,7 @@
   
   zeitgeist_subject_set_interpretation (subject, ZEITGEIST_NFO_PRESENTATION);
   zeitgeist_subject_set_manifestation (subject, ZEITGEIST_NFO_FILE_DATA_OBJECT);
-  zeitgeist_subject_set_uri (subject, file:///home/username/directory-with-dashes/CamelCasePresentation.pdf);
+  zeitgeist_subject_set_uri (subject, file:///home/username/directory-with-dashes/and.dot/CamelCasePresentation.pdf);
   zeitgeist_subject_set_text (subject, NULL);
   zeitgeist_subject_set_mimetype (subject, application/pdf);
 
@@ -602,6 +602,49 @@
 }
 
 static void
+test_simple_dots_prefix (Fixture *fix, gconstpointer data)
+{
+  guint matches;
+  guint event_id;
+  ZeitgeistEvent* event;
+  ZeitgeistSubject *subject;
+
+  // add test events to DBs
+  index_event (fix, create_test_event1 ());
+  index_event (fix, create_test_event2 ());
+  index_event (fix, create_test_event3 ());
+  index_event (fix, create_test_event4 ());
+  index_event (fix, create_test_event5 ());
+  index_event (fix, create_test_event6 ());
+  event_id = index_event (fix, create_test_event7 ());
+
+  GPtrArray *event_template = g_ptr_array_new ();
+  event = zeitgeist_event_new ();
+  subject = zeitgeist_subject_new ();
+  zeitgeist_subject_set_uri (subject,
+  file:///home/username/directory-with-dashes/and.dot/*);
+  zeitgeist_event_add_subject (event, subject);
+  g_ptr_array_add (event_template, event);
+
+  GPtrArray *results =
+zeitgeist_indexer_search (fix-indexer,
+  pdf,
+  zeitgeist_time_range_new_anytime (),
+  event_template,
+  0,
+  10,
+  ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS,
+  matches,
+  NULL);
+
+  g_assert_cmpuint (matches, , 0);
+  g_assert_cmpuint (results-len, ==, 1);
+
+  event = (ZeitgeistEvent*) results-pdata[0];
+  g_assert_cmpuint (zeitgeist_event_get_id (event), ==, event_id);
+}
+
+static void
 test_simple_cjk (Fixture *fix, gconstpointer data)
 {
   guint matches;
@@ -781,6 +824,8 @@
   setup, test_simple_camelcase, teardown);
   g_test_add (/Zeitgeist/FTS/Indexer/PrefixWithDashes, Fixture, 0,
   setup, test_simple_dashes_prefix, teardown);
+  g_test_add (/Zeitgeist/FTS/Indexer/PrefixWithDots, Fixture, 0,
+  setup, test_simple_dots_prefix, teardown);
   g_test_add (/Zeitgeist/FTS/Indexer/URLUnescape, Fixture, 0,
   setup, test_simple_url_unescape, teardown);
   g_test_add (/Zeitgeist/FTS/Indexer/IDNSupport, Fixture, 0,

=== modified file 'extensions/fts++/test/test-stringutils.cpp'
--- extensions/fts++/test/test-stringutils.cpp	2012-03-14 12:50:33 +
+++ extensions/fts++/test/test-stringutils.cpp	2012-03-14 12:58:22 +
@@ -76,7 +76,7 @@
 
   g_assert_cmpstr (file, ==, StringUtils::MangleUri(file).c_str ());
   g_assert_cmpstr (file___, ==, StringUtils::MangleUri(file://).c_str ());
-  g_assert_cmpstr (http___www.zeitgeist_project.com, ==,
+  g_assert_cmpstr (http___www_zeitgeist_project_com, ==,
   StringUtils::MangleUri(http://www.zeitgeist-project.com;).c_str ());
 
   g_assert_cmpstr (scheme_no_spaces_in_uris, ==,

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 426: Make sure that mangling works with capital letters as well

2012-03-14 Thread noreply

revno: 426
committer: Michal Hruby michal@gmail.com
branch nick: zeitgeist
timestamp: Wed 2012-03-14 16:47:20 +0100
message:
  Make sure that mangling works with capital letters as well
modified:
  extensions/fts++/stringutils.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++/stringutils.cpp'
--- extensions/fts++/stringutils.cpp	2012-03-14 12:58:22 +
+++ extensions/fts++/stringutils.cpp	2012-03-14 15:47:20 +
@@ -69,9 +69,13 @@
  */
 string MangleUri (string const orig)
 {
-  string s(orig);
+  // the input is supposed to be a uri, so no utf8 characters
+  gchar *casefolded = g_ascii_strdown (orig.c_str (), orig.size ());
+
+  string s(casefolded);
+  g_free (casefolded);
   size_t pos = 0;
-  while ((pos = s.find_first_of (: /-., pos)) != string::npos)
+  while ((pos = s.find_first_of (: /-.%, pos)) != string::npos)
   {
 s.replace (pos, 1, 1, '_');
 pos++;

=== modified file 'extensions/fts++/test/test-indexer.cpp'
--- extensions/fts++/test/test-indexer.cpp	2012-03-14 12:58:22 +
+++ extensions/fts++/test/test-indexer.cpp	2012-03-14 15:47:20 +
@@ -190,7 +190,7 @@
   
   zeitgeist_subject_set_interpretation (subject, ZEITGEIST_NFO_PRESENTATION);
   zeitgeist_subject_set_manifestation (subject, ZEITGEIST_NFO_FILE_DATA_OBJECT);
-  zeitgeist_subject_set_uri (subject, file:///home/username/directory-with-dashes/and.dot/CamelCasePresentation.pdf);
+  zeitgeist_subject_set_uri (subject, file:///home/username/directory-with-dashes/and.dot/%C4%8C%20some-intl/CamelCasePresentation.pdf);
   zeitgeist_subject_set_text (subject, NULL);
   zeitgeist_subject_set_mimetype (subject, application/pdf);
 
@@ -645,6 +645,49 @@
 }
 
 static void
+test_simple_intl_prefix (Fixture *fix, gconstpointer data)
+{
+  guint matches;
+  guint event_id;
+  ZeitgeistEvent* event;
+  ZeitgeistSubject *subject;
+
+  // add test events to DBs
+  index_event (fix, create_test_event1 ());
+  index_event (fix, create_test_event2 ());
+  index_event (fix, create_test_event3 ());
+  index_event (fix, create_test_event4 ());
+  index_event (fix, create_test_event5 ());
+  index_event (fix, create_test_event6 ());
+  event_id = index_event (fix, create_test_event7 ());
+
+  GPtrArray *event_template = g_ptr_array_new ();
+  event = zeitgeist_event_new ();
+  subject = zeitgeist_subject_new ();
+  zeitgeist_subject_set_uri (subject,
+  file:///home/username/directory-with-dashes/and.dot/%C4%8C*);
+  zeitgeist_event_add_subject (event, subject);
+  g_ptr_array_add (event_template, event);
+
+  GPtrArray *results =
+zeitgeist_indexer_search (fix-indexer,
+  pdf,
+  zeitgeist_time_range_new_anytime (),
+  event_template,
+  0,
+  10,
+  ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS,
+  matches,
+  NULL);
+
+  g_assert_cmpuint (matches, , 0);
+  g_assert_cmpuint (results-len, ==, 1);
+
+  event = (ZeitgeistEvent*) results-pdata[0];
+  g_assert_cmpuint (zeitgeist_event_get_id (event), ==, event_id);
+}
+
+static void
 test_simple_cjk (Fixture *fix, gconstpointer data)
 {
   guint matches;
@@ -826,6 +869,8 @@
   setup, test_simple_dashes_prefix, teardown);
   g_test_add (/Zeitgeist/FTS/Indexer/PrefixWithDots, Fixture, 0,
   setup, test_simple_dots_prefix, teardown);
+  g_test_add (/Zeitgeist/FTS/Indexer/PrefixWithIntlChars, Fixture, 0,
+  setup, test_simple_intl_prefix, teardown);
   g_test_add (/Zeitgeist/FTS/Indexer/URLUnescape, Fixture, 0,
   setup, test_simple_url_unescape, teardown);
   g_test_add (/Zeitgeist/FTS/Indexer/IDNSupport, Fixture, 0,

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 422: Merge: Split find_event_ids into _for_clause and _for_query

2012-03-13 Thread noreply
Merge authors:
  Trever Fischer (tdfischer)
Related merge proposals:
  
https://code.launchpad.net/~tdfischer/zeitgeist/timerange-deletion-api/+merge/97272
  proposed by: Trever Fischer (tdfischer)
  https://code.launchpad.net/~tdfischer/zeitgeist/common-where/+merge/97270
  proposed by: Trever Fischer (tdfischer)
  review: Approve - Siegfried Gevatter (rainct)

revno: 422 [merge]
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Tue 2012-03-13 20:12:59 +0100
message:
  Merge: Split find_event_ids into _for_clause and _for_query
modified:
  src/db-reader.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 'src/db-reader.vala'
--- src/db-reader.vala	2012-02-05 14:52:13 +
+++ src/db-reader.vala	2012-03-13 18:53:17 +
@@ -160,47 +160,9 @@
 return results;
 }
 
-public uint32[] find_event_ids (TimeRange time_range,
-GenericArrayEvent event_templates,
-uint storage_state, uint max_events, uint result_type,
-BusName? sender=null) throws EngineError
+public uint32[] find_event_ids_for_clause (WhereClause where,
+uint max_events, uint result_type) throws EngineError
 {
-
-WhereClause where = new WhereClause (WhereClause.Type.AND);
-
-/**
- * We are using the unary operator here to tell SQLite to not use
- * the index on the timestamp column at the first place. This is a
- * fix for (LP: #672965) based on some benchmarks, which suggest
- * a performance win, but we might not oversee all implications.
- * (See http://www.sqlite.org/optoverview.html, section 6.0).
- *-- Markus Korn, 29/11/2010
- */
-if (time_range.start != 0)
-where.add ((+timestamp = % + int64.FORMAT).printf(
-time_range.start));
-if (time_range.end != 0)
-where.add ((+timestamp = % + int64.FORMAT).printf(
-time_range.end));
-
-if (storage_state == StorageState.AVAILABLE ||
-storage_state == StorageState.NOT_AVAILABLE)
-{
-where.add ((subj_storage_state=? OR subj_storage_state IS NULL),
-storage_state.to_string ());
-}
-else if (storage_state != StorageState.ANY)
-{
-throw new EngineError.INVALID_ARGUMENT(
-Unknown storage state '%u'.printf(storage_state));
-}
-
-WhereClause tpl_conditions = get_where_clause_from_event_templates (
-event_templates);
-where.extend (tpl_conditions);
-//if (!where.may_have_results ())
-//return new uint32[0];
-
 string sql = SELECT id FROM event_view ;
 string where_sql = ;
 if (!where.is_empty ())
@@ -352,6 +314,20 @@
 return event_ids;
 }
 
+public uint32[] find_event_ids (TimeRange time_range,
+GenericArrayEvent event_templates,
+uint storage_state, uint max_events, uint result_type,
+BusName? sender=null) throws EngineError
+{
+WhereClause where = get_where_clause_for_query (time_range,
+event_templates, storage_state);
+
+//if (!where.may_have_results ())
+//return new uint32[0];
+
+return find_event_ids_for_clause (where, max_events, result_type);
+}
+
 public GenericArrayEvent? find_events (TimeRange time_range,
 GenericArrayEvent event_templates,
 uint storage_state, uint max_events, uint result_type,
@@ -361,6 +337,45 @@
 storage_state, max_events, result_type));
 }
 
+public WhereClause get_where_clause_for_query (TimeRange time_range,
+GenericArrayEvent event_templates, uint storage_state) throws EngineError
+{
+WhereClause where = new WhereClause (WhereClause.Type.AND);
+
+/**
+ * We are using the unary operator here to tell SQLite to not use
+ * the index on the timestamp column at the first place. This is a
+ * fix for (LP: #672965) based on some benchmarks, which suggest
+ * a performance win, but we might not oversee all implications.
+ * (See http://www.sqlite.org/optoverview.html, section 6.0).
+ *-- Markus Korn, 29/11/2010
+ */
+if (time_range.start != 0)
+where.add ((+timestamp = % + int64.FORMAT).printf(
+time_range.start));
+if (time_range.end != 0)
+where.add ((+timestamp = % + int64.FORMAT).printf(
+time_range.end));
+
+if (storage_state == StorageState.AVAILABLE ||
+storage_state == StorageState.NOT_AVAILABLE)
+{
+where.add 

[Zeitgeist] [Merge] lp:~tdfischer/zeitgeist/timerange-deletion-api into lp:zeitgeist

2012-03-13 Thread noreply
The proposal to merge lp:~tdfischer/zeitgeist/timerange-deletion-api into 
lp:zeitgeist has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~tdfischer/zeitgeist/timerange-deletion-api/+merge/97272
-- 
https://code.launchpad.net/~tdfischer/zeitgeist/timerange-deletion-api/+merge/97272
Your team Zeitgeist Framework Team is requested to review the proposed merge of 
lp:~tdfischer/zeitgeist/timerange-deletion-api into lp:zeitgeist.

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


[Zeitgeist] [Merge] lp:~tdfischer/zeitgeist/common-where into lp:zeitgeist

2012-03-13 Thread noreply
The proposal to merge lp:~tdfischer/zeitgeist/common-where into lp:zeitgeist 
has been updated.

Status: Approved = Merged

For more details, see:
https://code.launchpad.net/~tdfischer/zeitgeist/common-where/+merge/97270
-- 
https://code.launchpad.net/~tdfischer/zeitgeist/common-where/+merge/97270
Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist.

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 419: fix to make zeitgeist compatible with vala 0.16

2012-03-12 Thread noreply

revno: 419
committer: Seif Lotfy s...@lotfy.com
branch nick: zeitgeist
timestamp: Mon 2012-03-12 14:41:16 +0100
message:
  fix to make zeitgeist compatible with vala 0.16
modified:
  extensions/ds-registry.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/ds-registry.vala'
--- extensions/ds-registry.vala	2011-09-28 12:51:08 +
+++ extensions/ds-registry.vala	2012-03-12 13:41:16 +
@@ -144,7 +144,7 @@
 return registry;
 }
 
-public static Variant to_variant (
+private static Variant to_variant (
 HashTablestring, DataSource sources)
 {
 var vb = new VariantBuilder (new VariantType (SIG_DATASOURCES));

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 420: Index only recognized uri schemes

2012-03-12 Thread noreply

revno: 420
committer: Michal Hruby michal@gmail.com
branch nick: zeitgeist
timestamp: Mon 2012-03-12 15:22:16 +0100
message:
  Index only recognized uri schemes
modified:
  extensions/fts++/indexer.cpp
  extensions/fts++/indexer.h


--
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-07 16:08:26 +
+++ extensions/fts++/indexer.cpp	2012-03-12 14:22:16 +
@@ -106,9 +106,17 @@
 
 g_assert (g_checksum_type_get_length (G_CHECKSUM_MD5) == HASH_LENGTH);
 this-checksum = g_checksum_new (G_CHECKSUM_MD5);
-if (!this-checksum)
-g_critical (GChecksum initialization failed.);
-
+if (!this-checksum) g_critical (GChecksum initialization failed.);
+
+GError *error = NULL;
+/* we need to be careful with what we log, for example ubuntuone logs its
+ * weird uids and that screws up the index */
+this-uri_schemes_regex = g_regex_new (
+(file|http[s]?|[s]?ftp|ssh|smb|dav[s]?|application)$, G_REGEX_OPTIMIZE,
+(GRegexMatchFlags) 0, error);
+
+if (error)
+  g_critical (Unable to initialize uri scheme regex: %s, error-message);
   }
   catch (const Xapian::Error xp_error)
   {
@@ -399,7 +407,7 @@
   tokenizer-index_text (StringUtils::AsciiFold (text), 5);
 }
 
-void Indexer::IndexUri (std::string const uri, std::string const origin)
+bool Indexer::IndexUri (std::string const uri, std::string const origin)
 {
   GFile *f = g_file_new_for_uri (uri.c_str ());
 
@@ -407,12 +415,21 @@
   if (scheme == NULL)
   {
 g_warning (Invalid URI: %s, uri.c_str ());
-return;
+g_object_unref (f);
+return false;
   }
 
   std::string scheme_str(scheme);
   g_free (scheme);
 
+  // do we support this scheme?
+  if (!g_regex_match (uri_schemes_regex, scheme_str.c_str (),
+(GRegexMatchFlags) 0, NULL))
+  {
+g_object_unref (f);
+return false;
+  }
+
   if (scheme_str == file)
   {
 // FIXME: special case some typical filenames (like photos)
@@ -462,7 +479,7 @@
 weight_index  G_N_ELEMENTS (path_weights))
 {
   // if this is already home directory we don't want it
-  if (path_component == home_dir_path) return;
+  if (path_component == home_dir_path) break;
 
   gchar *name = g_path_get_basename (path_component.c_str ());
 
@@ -481,10 +498,11 @@
 // mailto:usern...@server.com
 size_t scheme_len = scheme_str.length () + 1;
 size_t at_pos = uri.find ('@', scheme_len);
-if (at_pos == std::string::npos) return;
-
-tokenizer-index_text (uri.substr (scheme_len, at_pos - scheme_len), 5);
-tokenizer-index_text (uri.substr (at_pos + 1), 1);
+if (at_pos != std::string::npos)
+{
+  tokenizer-index_text (uri.substr (scheme_len, at_pos - scheme_len), 5);
+  tokenizer-index_text (uri.substr (at_pos + 1), 1);
+}
   }
   else if (scheme_str.compare (0, 4, http) == 0)
   {
@@ -578,6 +596,8 @@
   }
 
   g_object_unref (f);
+
+  return true;
 }
 
 bool Indexer::IndexActor (std::string const actor, bool is_subject)
@@ -1035,15 +1055,11 @@
 if (!IndexActor (uri, true))
   IndexUri (uri, origin);
   }
-  else if (uri.compare (0, 10, ubuntuone:) == 0)
+  else if (!IndexUri (uri, origin))
   {
-// U1 logs its uids, we don't want to index those
+// unsupported uri scheme
 return;
   }
-  else
-  {
-IndexUri (uri, origin);
-  }
 }
 
 AddDocFilters (event, doc);

=== modified file 'extensions/fts++/indexer.h'
--- extensions/fts++/indexer.h	2012-03-07 16:08:26 +
+++ extensions/fts++/indexer.h	2012-03-12 14:22:16 +
@@ -57,6 +57,7 @@
 if (query_parser) delete query_parser;
 if (db) delete db;
 if (checksum) g_checksum_free (checksum);
+if (uri_schemes_regex) g_regex_unref (uri_schemes_regex);
 
 for (AppInfoMap::iterator it = app_info_cache.begin ();
  it != app_info_cache.end (); ++it)
@@ -111,7 +112,7 @@
 
   void AddDocFilters (ZeitgeistEvent *event, Xapian::Document doc);
   void IndexText (std::string const text);
-  void IndexUri (std::string const uri, std::string const origin);
+  bool IndexUri (std::string const uri, std::string const origin);
   bool IndexActor (std::string const actor, bool is_subject);
 
   gboolean ClearFailedLookupsCb ();
@@ -123,7 +124,8 @@
   Xapian::TermGenerator*tokenizer;
   AppInfoMapapp_info_cache;
   ApplicationSetfailed_lookups;
-  GChecksum *checksum;
+  GChecksum*checksum;
+  GRegex   *uri_schemes_regex; 
 
   guint clear_failed_id;
   std::string   home_dir_path;


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 414: Use a const int for relevancy result type

2012-03-07 Thread noreply

revno: 414
committer: Michal Hruby michal@gmail.com
branch nick: zeitgeist
timestamp: Wed 2012-03-07 16:56:30 +0100
message:
  Use a const int for relevancy result type
modified:
  extensions/fts++/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-06 22:03:17 +
+++ extensions/fts++/indexer.cpp	2012-03-07 15:56:30 +
@@ -49,6 +49,7 @@
   Xapian::QueryParser::FLAG_WILDCARD
 
 const std::string FTS_MAIN_DIR = fts.index;
+const int RELEVANCY_RESULT_TYPE = 100;
 
 void Indexer::Initialize (GError **error)
 {
@@ -725,7 +726,7 @@
 // from the Xapian index because the final result set will be coalesced
 // on some property of the event
 guint maxhits;
-if (result_type == 100 ||
+if (result_type == RELEVANCY_RESULT_TYPE ||
 result_type == ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS ||
 result_type == ZEITGEIST_RESULT_TYPE_LEAST_RECENT_EVENTS)
 {
@@ -736,7 +737,7 @@
   maxhits = count * 3;
 }
 
-if (result_type == 100)
+if (result_type == RELEVANCY_RESULT_TYPE)
 {
   enquire-set_sort_by_relevance ();
 }
@@ -750,7 +751,7 @@
 Xapian::MSet hits (enquire-get_mset (offset, maxhits));
 Xapian::doccount hitcount = hits.get_matches_estimated ();
 
-if (result_type == 100)
+if (result_type == RELEVANCY_RESULT_TYPE)
 {
   std::vectorunsigned event_ids;
   for (Xapian::MSetIterator iter = hits.begin (); iter != hits.end (); ++iter)
@@ -840,7 +841,7 @@
 
 guint maxhits = count;
 
-if (result_type == 100)
+if (result_type == RELEVANCY_RESULT_TYPE)
 {
   enquire-set_sort_by_relevance ();
 }
@@ -863,7 +864,7 @@
 Xapian::MSet hits (enquire-get_mset (offset, maxhits));
 Xapian::doccount hitcount = hits.get_matches_estimated ();
 
-if (result_type == 100)
+if (result_type == RELEVANCY_RESULT_TYPE)
 {
   std::vectorunsigned event_ids;
   std::vectorgdouble relevancy_arr;

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 415: FTS++: Save hashes of URIs and use Xapian's collapse option to group by them

2012-03-07 Thread noreply

revno: 415
author: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
committer: Michal Hruby michal@gmail.com
branch nick: bluebird
timestamp: Mon 2012-03-05 21:40:24 +0100
message:
  FTS++: Save hashes of URIs and use Xapian's collapse option to group by them
 when querying with *_SUBJECT result types.
modified:
  extensions/fts++/indexer.cpp
  extensions/fts++/indexer.h


--
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-07 15:56:30 +
+++ extensions/fts++/indexer.cpp	2012-03-05 20:40:24 +
@@ -23,6 +23,7 @@
 #include xapian.h
 #include queue
 #include vector
+#include cassert
 
 #include gio/gio.h
 #include gio/gdesktopappinfo.h
@@ -42,6 +43,7 @@
 
 const Xapian::valueno VALUE_EVENT_ID = 0;
 const Xapian::valueno VALUE_TIMESTAMP = 1;
+const Xapian::valueno VALUE_URI_HASH = 2;
 
 #define QUERY_PARSER_FLAGS \
   Xapian::QueryParser::FLAG_PHRASE | Xapian::QueryParser::FLAG_BOOLEAN | \
@@ -101,6 +103,11 @@
 this-query_parser-set_database (*this-db);
 
 this-enquire = new Xapian::Enquire (*this-db);
+
+assert (g_checksum_type_get_length (G_CHECKSUM_MD5) == 16);
+this-checksum = g_checksum_new (G_CHECKSUM_MD5);
+if (!this-checksum)
+g_critical (GChecksum initialization failed.);
 
   }
   catch (const Xapian::Error xp_error)
@@ -728,7 +735,11 @@
 guint maxhits;
 if (result_type == RELEVANCY_RESULT_TYPE ||
 result_type == ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS ||
-result_type == ZEITGEIST_RESULT_TYPE_LEAST_RECENT_EVENTS)
+result_type == ZEITGEIST_RESULT_TYPE_LEAST_RECENT_EVENTS ||
+result_type == ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECTS ||
+result_type == ZEITGEIST_RESULT_TYPE_LEAST_RECENT_SUBJECTS ||
+result_type == ZEITGEIST_RESULT_TYPE_MOST_POPULAR_SUBJECTS ||
+result_type == ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_SUBJECTS)
 {
   maxhits = count;
 }
@@ -746,6 +757,14 @@
   enquire-set_sort_by_value (VALUE_TIMESTAMP, true);
 }
 
+if (result_type == ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECTS ||
+result_type == ZEITGEIST_RESULT_TYPE_LEAST_RECENT_SUBJECTS ||
+result_type == ZEITGEIST_RESULT_TYPE_MOST_POPULAR_SUBJECTS ||
+result_type == ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_SUBJECTS)
+{
+enquire-set_collapse_key (VALUE_URI_HASH);
+}
+
 Xapian::Query q(query_parser-parse_query (query_string, QUERY_PARSER_FLAGS));
 enquire-set_query (q);
 Xapian::MSet hits (enquire-get_mset (offset, maxhits));
@@ -989,6 +1008,19 @@
 return; // ignore this event completely...
   }
 
+  // We need the subject URI so we can use Xapian's collapse key feature
+  // for *_SUBJECT grouping. However, to save space, we'll just save a hash.
+  // A better option would be using URI's id, but for that we'd need a SQL
+  // query that'd be subject to races.
+  // FIXME(?): This doesn't work for events with multiple subjects.
+  g_checksum_update (checksum, (guchar *) uri.c_str (), -1);
+  guint8 uri_hash[17];
+  gsize hash_size = 16;
+  g_checksum_get_digest (checksum, uri_hash, hash_size);
+  assert (hash_size == 16);
+  doc.add_value (VALUE_URI_HASH, std::string((char *) uri_hash, 16));
+  g_checksum_reset (checksum);
+
   val = zeitgeist_subject_get_text (subject);
   if (val  val[0] != '\0')
   {

=== modified file 'extensions/fts++/indexer.h'
--- extensions/fts++/indexer.h	2012-02-14 16:56:04 +
+++ extensions/fts++/indexer.h	2012-03-05 20:40:24 +
@@ -21,6 +21,7 @@
 #define _ZGFTS_INDEXER_H_
 
 #include glib-object.h
+#include glib/gchecksum.h
 #include gio/gio.h
 #include xapian.h
 
@@ -42,6 +43,7 @@
 , query_parser (NULL)
 , enquire (NULL)
 , tokenizer (NULL)
+, checksum (NULL)
 , clear_failed_id (0)
   {
 const gchar *home_dir = g_get_home_dir ();
@@ -54,6 +56,7 @@
 if (enquire) delete enquire;
 if (query_parser) delete query_parser;
 if (db) delete db;
+if (checksum) { g_checksum_free (checksum); checksum = NULL; }
 
 for (AppInfoMap::iterator it = app_info_cache.begin ();
  it != app_info_cache.end (); ++it)
@@ -120,6 +123,7 @@
   Xapian::TermGenerator*tokenizer;
   AppInfoMapapp_info_cache;
   ApplicationSetfailed_lookups;
+  GChecksum *checksum;
 
   guint clear_failed_id;
   std::string   home_dir_path;

___
Mailing list: https://launchpad.net/~zeitgeist
Post to : zeitgeist@lists.launchpad.net
Unsubscribe : 

[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 417: Add talis to tools

2012-03-07 Thread noreply

revno: 417
committer: Michal Hruby michal@gmail.com
branch nick: zeitgeist
timestamp: Wed 2012-03-07 21:25:20 +0100
message:
  Add talis to tools
added:
  tools/talis


--
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
=== added file 'tools/talis'
--- tools/talis	1970-01-01 00:00:00 +
+++ tools/talis	2012-03-07 20:25:20 +
@@ -0,0 +1,79 @@
+#! /usr/bin/python
+
+import sys, os
+from zeitgeist.datamodel import Event, Subject, ResultType, TimeRange
+from zeitgeist.client import ZeitgeistDBusInterface
+
+USAGE = \
+Talis is a command line tool to search your history.
+USAGE:
+	talis [options] enter search terms here
+
+OPTIONS:
+	--mode=, -m=   MODE
+	--offset=, -o= Offset into result set
+	--hits=, -h=   Max number of hits to return
+
+MODES:
+	LeastPopularActor
+	LeastPopularSubjects
+	LeastRecentActor
+	LeastRecentEvents
+	LeastRecentSubjects
+	MostPopularActor
+	MostPopularSubjects
+	MostRecentActor
+	MostRecentEvents
+	MostRecentSubjects
+	Relevancy (default)
+
+
+if len(sys.argv) = 1:
+	print USAGE
+	raise SystemExit(1)
+
+offset = 0
+maxhits = 10
+mode = 100
+mode_string = Relevancy
+query = 
+relevancy_mode = False
+for i in range(1, len(sys.argv)):
+	if sys.argv[i].startswith(--mode=) or sys.argv[i].startswith(-m=):
+		mode_string = sys.argv[1].replace(--mode=, ).replace(-m=, ).strip()
+		if mode_string == Relevancy:
+			mode = 100
+		else:
+			mode = getattr(ResultType, mode_string)
+	elif sys.argv[i].startswith(--offset=) or sys.argv[i].startswith(-o=):
+		offset = int(sys.argv[i].replace(--offset=, ).replace(-o=, ).strip())
+	elif sys.argv[i].startswith(--hits=) or sys.argv[i].startswith(-h=):
+		maxhits = int(sys.argv[i].replace(--hits=, ).replace(-h=, ).strip())
+	elif sys.argv[i] in [--relevancies, -r]:
+		relevancy_mode = True
+	else:
+		query +=   + sys.argv[i]
+		
+query = query.strip()
+
+fts = ZeitgeistDBusInterface().get_extension(Index, index/activity)
+if relevancy_mode:
+	results, relevancies, count = fts.SearchWithRelevancies(query, TimeRange.always(), [], 2, offset, maxhits, mode)
+else:
+	results, count = fts.Search(query, TimeRange.always(), [], offset, maxhits, mode)
+
+if len(results) == 0:
+print No hits for '%s' % query
+raise SystemExit(0)
+
+print %s-%s of %s hits for '%s'. Sorted by '%s': % (offset+1, len(results)+offset, count, query, Relevancy+ + mode_string if relevancy_mode else mode_string)
+
+i = offset+1
+events = map(Event, results)
+for event in events:
+	for subject in event.subjects:
+		if relevancy_mode:
+			print  %s. %s\t(%.2f) % (i, subject.uri, relevancies[i-1])
+		else:
+			print  %s. %s % (i, subject.uri)
+		i += 1

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 413: Don't index ubuntuone's uids

2012-03-06 Thread noreply

revno: 413
committer: Michal Hruby michal@gmail.com
branch nick: zeitgeist
timestamp: Tue 2012-03-06 23:03:17 +0100
message:
  Don't index ubuntuone's uids
modified:
  extensions/fts++/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-02-14 16:56:04 +
+++ extensions/fts++/indexer.cpp	2012-03-06 22:03:17 +
@@ -1002,6 +1002,11 @@
 if (!IndexActor (uri, true))
   IndexUri (uri, origin);
   }
+  else if (uri.compare (0, 10, ubuntuone:) == 0)
+  {
+// U1 logs its uids, we don't want to index those
+return;
+  }
   else
   {
 IndexUri (uri, origin);

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


[Zeitgeist] [Merge] lp:~kelemeng/activity-log-manager/i18n-fixes into lp:activity-log-manager

2012-03-02 Thread noreply
The proposal to merge lp:~kelemeng/activity-log-manager/i18n-fixes into 
lp:activity-log-manager has been updated.

Status: Needs review = Merged

For more details, see:
https://code.launchpad.net/~kelemeng/activity-log-manager/i18n-fixes/+merge/95472
-- 
https://code.launchpad.net/~kelemeng/activity-log-manager/i18n-fixes/+merge/95472
Your team Activity Log Manager is requested to review the proposed merge of 
lp:~kelemeng/activity-log-manager/i18n-fixes into lp:activity-log-manager.

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 408: Make sure we clean up transactions properly

2012-02-21 Thread noreply

revno: 408
fixes bug: https://launchpad.net/bugs/937991
committer: Michal Hruby michal@gmail.com
branch nick: bluebird
timestamp: Tue 2012-02-21 19:17:16 +0100
message:
  Make sure we clean up transactions properly
modified:
  src/engine.vala
  src/sql.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 'src/engine.vala'
--- src/engine.vala	2012-02-10 13:35:02 +
+++ src/engine.vala	2012-02-21 18:17:16 +
@@ -72,13 +72,24 @@
 
 extension_collection.call_pre_insert_events (events, sender);
 uint32[] event_ids = new uint32[events.length];
+EngineError? err = null;
 database.begin_transaction ();
-for (int i = 0; i  events.length; ++i)
-{
-if (events[i] != null)
-event_ids[i] = insert_event (events[i]);
-}
-database.end_transaction ();
+try
+{
+for (int i = 0; i  events.length; ++i)
+{
+if (events[i] != null)
+event_ids[i] = insert_event (events[i]);
+}
+database.end_transaction ();
+}
+catch (EngineError e)
+{
+err = e;
+database.abort_transaction ();
+}
+if (err != null) throw err;
+
 extension_collection.call_post_insert_events (events, sender);
 return event_ids;
 }

=== modified file 'src/sql.vala'
--- src/sql.vala	2012-02-10 11:28:05 +
+++ src/sql.vala	2012-02-21 18:17:16 +
@@ -277,6 +277,12 @@
 assert_query_success (rc, Can't commit transaction);
 }
 
+public void abort_transaction () throws EngineError
+{
+int rc = database.exec (ROLLBACK);
+assert_query_success (rc, Can't rollback transaction);
+}
+
 public void close ()
 {
 // SQLite connection is implicitly closed upon destruction

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 407: Move logging code from zeitgeist-daemon to a new logging.vala and install

2012-02-20 Thread noreply
Merge authors:
  Siegfried Gevatter (rainct)

revno: 407 [merge]
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Sun 2012-02-19 21:47:38 +0100
message:
  Move logging code from zeitgeist-daemon to a new logging.vala and install
  a custom log handler (adding color and timestamps).
added:
  src/logging.vala
modified:
  src/Makefile.am
  src/zeitgeist-daemon.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 'src/Makefile.am'
--- src/Makefile.am	2012-02-02 18:57:35 +
+++ src/Makefile.am	2012-02-15 19:55:59 +
@@ -37,6 +37,7 @@
 	extension.vala \
 	extension-collection.vala \
 	extension-store.vala \
+	logging.vala \
 	notify.vala \
 	sql.vala \
 	utils.vala \

=== added file 'src/logging.vala'
--- src/logging.vala	1970-01-01 00:00:00 +
+++ src/logging.vala	2012-02-19 20:47:38 +
@@ -0,0 +1,140 @@
+/* logging.vala
+ *
+ * Copyright © 2012 Canonical Ltd.
+ * By Siegfried-A. Gevatter siegfried.gevat...@collabora.co.uk
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program.  If not, see http://www.gnu.org/licenses/.
+ *
+ */
+
+namespace Zeitgeist
+{
+namespace Logging
+{
+
+private const string BLUE = \x1b[34m;
+private const string GREEN = \x1b[32m;
+private const string RED = \x1b[31m;
+private const string YELLOW = \x1b[33m;
+private const string RESET = \x1b[0m;
+
+private string get_log_level_string (LogLevelFlags log_levels,
+out string color)
+{
+string log_level;
+
+if ((log_levels  LogLevelFlags.LEVEL_ERROR) != 0)
+{
+log_level = ERROR;
+color = RED;
+}
+else if ((log_levels  LogLevelFlags.LEVEL_CRITICAL) != 0)
+{
+log_level = CRITICAL;
+color = RED;
+}
+else if ((log_levels  LogLevelFlags.LEVEL_WARNING) != 0)
+{
+log_level = WARNING;
+color = RED;
+}
+else if ((log_levels  LogLevelFlags.LEVEL_MESSAGE) != 0)
+{
+log_level = MESSAGE;
+color = BLUE;
+}
+else if ((log_levels  LogLevelFlags.LEVEL_INFO) != 0)
+{
+log_level = INFO;
+color = BLUE;
+}
+else if ((log_levels  LogLevelFlags.LEVEL_DEBUG) != 0)
+{
+log_level = DEBUG;
+color = GREEN;
+}
+else
+{
+log_level = UNKNOWN;
+color = BLUE;
+}
+
+return log_level;
+}
+
+private void log_handler (string? log_domain, LogLevelFlags log_levels,
+string message)
+{
+string color;
+string log_level = get_log_level_string (log_levels, out color);
+string timestamp = TimeVal ().to_iso8601 ().substring (11, 15);
+//string datestamp = new DateTime.now_local ().format (
+//%Y-%m-%d %H:%M:%S);
+// FIXME: get PID
+
+unowned FileStream output;
+if (log_levels = LogLevelFlags.LEVEL_MESSAGE)
+output = stdout; // MESSAGE, INFO or DEBUG
+else
+output = stderr;
+
+// Print to console
+output.printf (%s[%s %s]%s %s\n, color, timestamp,
+log_level, RESET, message);
+
+// Log to file
+// FIXME:
+//printf ([%s] - %s - %s\n, datestamp, log_level, message);
+}
+
+public void setup_logging (string? log_level)
+{
+LogLevelFlags discarded = LogLevelFlags.LEVEL_DEBUG;
+if (log_level != null)
+{
+var ld = LogLevelFlags.LEVEL_DEBUG;
+var li = LogLevelFlags.LEVEL_INFO;
+var lm = LogLevelFlags.LEVEL_MESSAGE;
+var lw = LogLevelFlags.LEVEL_WARNING;
+var lc = LogLevelFlags.LEVEL_CRITICAL;
+

[Zeitgeist] [Merge] lp:~rainct/zeitgeist/custom-log-handler into lp:zeitgeist

2012-02-20 Thread noreply
The proposal to merge lp:~rainct/zeitgeist/custom-log-handler into lp:zeitgeist 
has been updated.

Status: Approved = Merged

For more details, see:
https://code.launchpad.net/~rainct/zeitgeist/custom-log-handler/+merge/93289
-- 
https://code.launchpad.net/~rainct/zeitgeist/custom-log-handler/+merge/93289
Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist.

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 404: Add missing throws to Events.from_Variant, add missing distclean rule

2012-02-18 Thread noreply

revno: 404
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Wed 2012-02-15 19:27:21 +0100
message:
  Add missing throws to Events.from_Variant, add missing distclean rule
  to extensions/Makefile.am and update POTFILES.skip.
modified:
  extensions/Makefile.am
  po/POTFILES.skip
  src/datamodel.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/Makefile.am'
--- extensions/Makefile.am	2012-02-08 18:54:58 +
+++ extensions/Makefile.am	2012-02-15 18:27:21 +
@@ -70,3 +70,6 @@
 benchmark_la_LIBADD = \
 	$(ZEITGEIST_LIBS) \
 	$(NULL)
+
+distclean-local:
+	rm -f *.c *.o *.stamp *.~[0-9]~

=== modified file 'po/POTFILES.skip'
--- po/POTFILES.skip	2011-07-25 23:24:14 +
+++ po/POTFILES.skip	2012-02-15 18:27:21 +
@@ -1,1 +1,2 @@
 src/main.c
+tools/gtk/zeitgeist-data-sources-gtk.py

=== modified file 'src/datamodel.vala'
--- src/datamodel.vala	2012-02-07 14:51:50 +
+++ src/datamodel.vala	2012-02-15 18:27:21 +
@@ -509,6 +509,7 @@
 {
 
 public static GenericArrayEvent from_variant (Variant vevents)
+throws EngineError
 {
 GenericArrayEvent events = new GenericArrayEvent ();
 

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 406: Leave va_list there but don't use it.

2012-02-18 Thread noreply

revno: 406
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: matches-template
timestamp: Sat 2012-02-18 22:33:57 +0100
message:
  Leave va_list there but don't use it.
modified:
  src/datamodel.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 'src/datamodel.vala'
--- src/datamodel.vala	2012-02-15 18:55:42 +
+++ src/datamodel.vala	2012-02-18 21:33:57 +
@@ -348,21 +348,16 @@
 subjects.add (subject);
 }
 
-// FIXME: change this to va_list once Vala bug #647097 is fixed
 public Event.full (string? interpretation=null,
 string? manifestation=null, string? actor=null,
-string? origin=null, GenericArraySubject? subjects=null)
+string? origin=null, ...)
 {
 this.interpretation = interpretation;
 this.manifestation = manifestation;
 this.actor = actor;
 this.origin = origin;
 
-if (subjects != null)
-this.subjects = subjects;
-else
-this.subjects = new GenericArraySubject ();
-
+// FIXME: We can't use this until Vala bug #647097 is fixed
 /*
 var subjects = va_list ();
 unowned Subject subject;

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 405: - Update Event/Subject to reflect that their properties may be NULL

2012-02-18 Thread noreply

revno: 405
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Wed 2012-02-15 19:55:42 +0100
message:
   - Update Event/Subject to reflect that their properties may be NULL
   - Give Event/Subject a constructor (other than from_variant)
   - Add initial test case for matches_template
added:
  test/direct/datamodel-test.vala
modified:
  src/datamodel.vala
  test/direct/Makefile.am


--
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 'src/datamodel.vala'
--- src/datamodel.vala	2012-02-15 18:27:21 +
+++ src/datamodel.vala	2012-02-15 18:55:42 +
@@ -4,6 +4,8 @@
  * By Seif Lotfy s...@lotfy.com
  * By Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
  * Copyright © 2011 Manish Sinha manishsi...@ubuntu.com
+ * Copyright © 2012 Canonical Ltd.
+ * By Siegfried-A. Gevatter siegfried.gevat...@collabora.co.uk
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -262,15 +264,18 @@
 ANY = 2  // The event subjects may or may not be available
 }
 
-private bool check_field_match (string property,
-string template_property, bool is_symbol = false,
+private bool check_field_match (string? property,
+string? template_property, bool is_symbol = false,
 bool can_wildcard = false)
 {
 var matches = false;
+var is_negated = false;
 var parsed = template_property;
-var is_negated = Utils.parse_negation (ref parsed);
-
-if (parsed == )
+
+if (parsed != null)
+is_negated = Utils.parse_negation (ref parsed);
+
+if (Utils.is_empty_string (parsed))
 {
 return true;
 }
@@ -278,14 +283,15 @@
 {
 matches = true;
 }
-else if (is_symbol 
+else if (is_symbol  property != null 
 Symbol.get_all_parents (property).find_custom (parsed, strcmp) != null)
 {
 matches = true;
 }
 else if (can_wildcard  Utils.parse_wildcard (ref parsed))
 {
-if (property.has_prefix (parsed)) matches = true;
+if (property != null  property.has_prefix (parsed))
+matches = true;
 }
 
 return (is_negated) ? !matches : matches;
@@ -297,27 +303,27 @@
 
 public uint32id { get; set; }
 public int64 timestamp { get; set; }
-public stringorigin { get; set; }
+public string?   origin { get; set; }
 
-public string actor
+public string? actor
 {
 get { return _actor; }
-set { _actor = url_store.insert_const (value); }
+set { _actor = (value != null) ? url_store.insert_const (value) : null; }
 }
-public string interpretation
+public string? interpretation
 {
 get { return _interpretation; }
-set { _interpretation = url_store.insert_const (value); }
+set { _interpretation = (value != null) ? url_store.insert_const (value) : null; }
 }
-public string manifestation
+public string? manifestation
 {
 get { return _manifestation; }
-set { _manifestation = url_store.insert_const (value); }
+set { _manifestation = (value != null) ? url_store.insert_const (value) : null; }
 }
 
-private unowned string _actor;
-private unowned string _interpretation;
-private unowned string _manifestation;
+private unowned string? _actor;
+private unowned string? _interpretation;
+private unowned string? _manifestation;
 
 public GenericArraySubject subjects { get; set; }
 public ByteArray? payload { get; set; }
@@ -342,6 +348,29 @@
 subjects.add (subject);
 }
 
+// FIXME: change this to va_list once Vala bug #647097 is fixed
+public Event.full (string? interpretation=null,
+string? manifestation=null, string? actor=null,
+string? origin=null, GenericArraySubject? subjects=null)
+{
+this.interpretation = interpretation;
+this.manifestation = manifestation;
+this.actor = actor;
+this.origin = origin;
+
+if (subjects != null)
+this.subjects = subjects;
+else
+this.subjects = new GenericArraySubject ();
+
+/*
+var subjects = va_list ();
+unowned Subject subject;
+while ((subject = 

[Zeitgeist] [Merge] lp:~rainct/zeitgeist/matches-template into lp:zeitgeist

2012-02-18 Thread noreply
The proposal to merge lp:~rainct/zeitgeist/matches-template into lp:zeitgeist 
has been updated.

Status: Approved = Merged

For more details, see:
https://code.launchpad.net/~rainct/zeitgeist/matches-template/+merge/93279
-- 
https://code.launchpad.net/~rainct/zeitgeist/matches-template/+merge/93279
Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist.

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


[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 401: Prepare TableLookup.get_value in the constructor, and add a test

2012-02-14 Thread noreply

revno: 401
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Mon 2012-02-13 21:14:41 +0100
message:
  Prepare TableLookup.get_value in the constructor, and add a test
  to verify that it's working.
modified:
  src/table-lookup.vala
  test/direct/table-lookup-test.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 'src/table-lookup.vala'
--- src/table-lookup.vala	2012-02-10 11:28:05 +
+++ src/table-lookup.vala	2012-02-13 20:14:41 +
@@ -33,6 +33,7 @@
 private HashTableint, string id_to_value;
 private HashTablestring, int value_to_id;
 private Sqlite.Statement insertion_stmt;
+private Sqlite.Statement retrieval_stmt;
 
 public TableLookup (Database database, string table_name)
 {
@@ -42,6 +43,7 @@
 value_to_id = new HashTablestring, int(str_hash, str_equal);
 
 int rc;
+string sql;
 
 rc = db.exec (SELECT id, value FROM  + table,
 (n_columns, values, column_names) =
@@ -56,10 +58,19 @@
 rc, db.errmsg ());
 }
 
-string sql = INSERT INTO  + table +  (value) VALUES (?);
+sql = INSERT INTO  + table +  (value) VALUES (?);
 rc = db.prepare_v2 (sql, -1, out insertion_stmt);
 if (rc != Sqlite.OK)
 {
+// FIXME: throw exception and propagate it up to
+//zeitgeist-daemon to abort with DB error?
+critical (SQL error: %d, %s\n, rc, db.errmsg ());
+}
+
+sql = SELECT value FROM  + table +  WHERE id=?;
+rc = db.prepare_v2 (sql, -1, out retrieval_stmt);
+if (rc != Sqlite.OK)
+{
 critical (SQL error: %d, %s\n, rc, db.errmsg ());
 }
 }
@@ -93,23 +104,27 @@
 unowned string val = id_to_value.lookup (id);
 if (val != null) return val;
 
-// The above statement isn't exactly true. If this is a standalone
-// reader in a separate process, the values won't be kept updated
-// so we need to query the DB if we don't find it.
+// Unless this is a standalone reader in a separate process, in
+// which case the values won't be kept updated, so we need to
+// query the DB if we don't find it.
 int rc;
+string? text = null;
 
-rc = db.exec (SELECT value FROM %s WHERE id=%d.printf (table, id),
-(n_columns, values, column_names) =
-{
-id_to_value.insert (id, values[0]);
-value_to_id.insert (values[0], id);
-return 0;
-}, null);
-if (rc != Sqlite.OK)
-{
-critical (Can't get data from table %s: %d, %s\n, table,
+retrieval_stmt.reset ();
+retrieval_stmt.bind_int64 (1, id);
+if ((rc = retrieval_stmt.step()) == Sqlite.ROW)
+{
+text = retrieval_stmt.column_text (0);
+id_to_value.insert (id, text);
+value_to_id.insert (text, id);
+rc = retrieval_stmt.step ();
+}
+if (rc != Sqlite.DONE || text == null)
+{
+critical (Error getting data from table: %d, %s\n,
 rc, db.errmsg ());
 }
+
 return id_to_value.lookup (id);
 }
 

=== modified file 'test/direct/table-lookup-test.vala'
--- test/direct/table-lookup-test.vala	2012-02-13 19:43:15 +
+++ test/direct/table-lookup-test.vala	2012-02-13 20:14:41 +
@@ -38,6 +38,7 @@
 
 Test.add_func (/WhereClause/basic, basic_test);
 Test.add_func (/WhereClause/delete_hook, engine_test);
+Test.add_func (/WhereClause/get_value_query, get_value_with_query_test);
 
 return Test.run ();
 }
@@ -68,6 +69,18 @@
 assert_cmpint (table_lookup.get_id (1st-actor), OperatorType.EQUAL, id+2);
 }
 
+public void get_value_with_query_test ()
+{
+Database database = new Zeitgeist.SQLite.Database ();
+unowned Sqlite.Database db = database.database;
+TableLookup table_lookup = new TableLookup (database, actor);
+
+int rc = db.exec (INSERT INTO actor (id, value) VALUES (100, 'new-actor'));
+assert (rc == Sqlite.OK);
+
+assert_cmpstr (table_lookup.get_value (100), OperatorType.EQUAL, new-actor);
+}
+
 public void engine_test ()
 {
 PublicEngine engine = new PublicEngine ();

___
Mailing list: https://launchpad.net/~zeitgeist
Post to : 

[Zeitgeist] [Branch ~zeitgeist/zeitgeist/bluebird] Rev 400: Fix TableLookup test after schema changes, and sort Makefile.am

2012-02-14 Thread noreply

revno: 400
committer: Siegfried-Angel Gevatter Pujals siegfr...@gevatter.com
branch nick: bluebird
timestamp: Mon 2012-02-13 20:43:15 +0100
message:
  Fix TableLookup test after schema changes, and sort Makefile.am
  alfabetically while we're at it.
modified:
  test/direct/Makefile.am
  test/direct/table-lookup-test.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 'test/direct/Makefile.am'
--- test/direct/Makefile.am	2012-02-05 14:52:13 +
+++ test/direct/Makefile.am	2012-02-13 19:43:15 +
@@ -10,10 +10,10 @@
 
 TESTS = \
 	marshalling-test \
+	mimetype-test \
 	query-operators-test \
+	table-lookup-test \
 	where-clause-test \
-	table-lookup-test \
-	mimetype-test \
 	$(NULL)
 
 SRC_FILES = \
@@ -56,19 +56,19 @@
 
 DISTCLEANFILES = \
 	marshalling-test \
+	mimetype-test \
 	query-operators-test \
+	table-lookup-test \
 	where-clause-test \
-	table-lookup-test \
-	mimetype-test \
 	$(NULL)
 
 EXTRA_DIST = \
+	assertions.vapi \
 	marshalling-test.vala \
+	mimetype-test.vala \
 	query-operators-test.vala \
+	table-lookup-test.vala \
 	where-clause-test.vala \
-	table-lookup-test.vala \
-	mimetype-test.vala \
-	assertions.vapi \
 	$(NULL)
 
 VALA_V = $(VALA_V_$(V))

=== modified file 'test/direct/table-lookup-test.vala'
--- test/direct/table-lookup-test.vala	2012-02-05 14:52:13 +
+++ test/direct/table-lookup-test.vala	2012-02-13 19:43:15 +
@@ -56,16 +56,16 @@
 unowned Sqlite.Database db = database.database;
 TableLookup table_lookup = new TableLookup (database, actor);
 
-assert_cmpint (table_lookup.get_id (1st-actor), OperatorType.EQUAL, 1);
-assert_cmpint (table_lookup.get_id (2nd-actor), OperatorType.EQUAL, 2);
-assert_cmpint (table_lookup.get_id (1st-actor), OperatorType.EQUAL, 1);
+int id = table_lookup.get_id (1st-actor);
+assert_cmpint (table_lookup.get_id (2nd-actor), OperatorType.EQUAL, id+1);
+assert_cmpint (table_lookup.get_id (1st-actor), OperatorType.EQUAL, id);
 
 int rc = db.exec (DELETE FROM actor WHERE value='1st-actor');
 assert (rc == Sqlite.OK);
 
 table_lookup.remove (1);
-assert_cmpint (table_lookup.get_id (2nd-actor), OperatorType.EQUAL, 2);
-assert_cmpint (table_lookup.get_id (1st-actor), OperatorType.EQUAL, 3);
+assert_cmpint (table_lookup.get_id (2nd-actor), OperatorType.EQUAL, id+1);
+assert_cmpint (table_lookup.get_id (1st-actor), OperatorType.EQUAL, id+2);
 }
 
 public void engine_test ()
@@ -82,8 +82,6 @@
 int rc = db.exec (DELETE FROM actor WHERE value='something');
 assert (rc == Sqlite.OK);
 
-assert_cmpint (
-table_lookup.get_id (sqlite-reuses-the-id), OperatorType.EQUAL, 1);
 assert_cmpint (table_lookup.get_id (something), OperatorType.EQUAL, 2);
 }
 

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


  1   2   3   4   >