GNOME Bugzilla – Bug 514553
Implementing GetTextContents method
Last modified: 2008-03-27 09:41:50 UTC
Please describe the problem: The method "GetTextContents" in the dbus interface is unusable. It is not completely implemented. Steps to reproduce: 1. Start tracker indexing some text files 2. Call the method GetTextContents For example: "dbus-send --dest='org.freedesktop.Tracker' --type=method_call --print-reply /org/freedesktop/tracker org.freedesktop.Tracker.Files.GetTextContents string:/home/xxxxx/test/yyyy.rtf int32:0 int32:100"" Actual results: There is no answer, and a message in the log: ERROR: prepared query GetFileContents not found ERROR: incorrect no of parameters 4 supplied to GetFileContents ERROR: parameter 0 could not be bound to GetFileContents ERROR: parameter 1 could not be bound to GetFileContents ERROR: parameter 2 could not be bound to GetFileContents ERROR: parameter 3 could not be bound to GetFileContent Expected results: It must return the first 100 characters of the contents of the file Does this happen every time? Yes Other information: I have a patch which I will attach here that fixes this.
Created attachment 104487 [details] [review] Implements the GetTextContents method This patch adds a new stored procedure (GetFileContents), and adds the required logic to use it in tracker-dbus-files.c
service_id = tracker_db_get_id (db_con, "Documents", uri); i think the above line should be : service_id = tracker_db_get_id (db_con, "Files" uri); that should work for all files objects if service_id < 1 then replace files with "Emails" Other than that it should be fine. Reattach patch once above is fixed - thanks
Created attachment 105493 [details] [review] Implementation of the GetTextContents method (new version) New version using "Files" (and "Emails" in a second try) instead of "Documents" to obtain the service id.
Committed!