Re: [Tracker] Qt Front End



Dnia Mon, Nov 20, 2006 at 03:56:44PM +0100, napisale(a)s: 
Hi,
I'm writing a qt front-end for tracker  with python  it use  the dbus
interface for
search files,I want to implement a text extract like gnome tracker 's gui...

I think to use this dbus function:
files_iface.SearchTextContens(filepath,key,lenght)
but I have error message because this function it's not implemented!!!

How do that the gnome front-end?

Is a good idea this qt front-end?


Hi! I'm doing a similar project with PyGTK.
I must say that dbus-monitor proved a very good tool.
You can use it to see how things are done.

For this particular thing it shows:

 method call sender=:1.17 -> dest=org.freedesktop.Tracker
 path=/org/freedesktop/tracker; interface=org.freedesktop.Tracker.Search;
 member=GetSnippet
    string "Files"
    string "/home/sheep/sample.txt"
    string "searchterm"

This means you can use something like this:

 search_iface.GetSnippet(service, file_path, hightlighted_word)

and it will return a snippet of pango markup with the word
highlighted. 

One problem I find is that it often contains unescaped < and > and &
from the original file, especiall if the tag was cut in half by the
snippet-making function.

I remedy this by replacing all occurences of '<!--' with '&lt;--' and
all occurences of pattern '<(?=[^>]+)$' with '&lt;'.

-- 
Radomir `The Sheep' Dopieralski



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]