Re: [Evolution-hackers] [Tracker] Crossover projects (Was: Metadata and Evolution)



On Tue, 2008-12-23 at 13:25 +0100, Philip Van Hoof wrote:

Hi evos and trakkies,

> > On Fri, 2008-12-19 at 10:55 +0100, Philip Van Hoof wrote:
> > 
> > > I will be tracking a patch that is related to the Evolution metadata
> > > proposal (x) at this bug in GNOME's bugzilla.
> > > 
> > > http://bugzilla.gnome.org/show_bug.cgi?id=565082
> > > 
> > > It contains a patch that Evolution's most recent Camel needs in order to
> > > support the EPlugin that will be written to implement (x).
> > > 
> > > 
> > > #x http://live.gnome.org/Evolution/Metadata
> 
> I attached two new patches. One for Tracker and one for Evolution's data
> server. The one for Tracker is highly unfinished and untested but has
> most of the skeleton that I mentioned before now implemented.

The version I attached this time has a few things that are already
working.

It starts to make sense to review this one, Srag. Although it's a patch
for Tracker, the Evolution plugin could or might some day be ported to
be generic and usable in the repo of Evolution itself (the only thing
that would have to be changed is a little bit of build-environment and
rename tracker to evolution in two or three symbols).

The EPlugin is 

src/tracker-evolution-plugin/tracker-evolution-plugin.h and
src/tracker-evolution-plugin/tracker-evolution-plugin.c

And of course

src/tracker-evolution-plugin/liborg-freedesktop-Tracker-evolution-plugin.eplug.xml

The tracker-evolution-registrar.c (which is unfinished, as I'm testing
with a Vala sample as client - attached too -) is what will run in
Tracker's processes.


-- 
Philip Van Hoof, freelance software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://pvanhoof.be/blog
http://codeminded.be

Attachment: tracker-evo-plugin.diff.gz
Description: GNU Zip compressed data

using DBus;

// [DBus (name = "org.gnome.evolution.metadata.Manager")]
// public interface Manager : GLib.Object {
//    public abstract void Register (DBus.ObjectPath registrar_path, int last_checkout);
// }

[DBus (name = "org.gnome.evolution.metadata.Registrar")]
public class Registrar: GLib.Object {

    public void Set (string subject, string[] predicates, string[] values) {
	message ("set:" + subject + "\n");
    }

    public void Cleanup () {
	message ("cleanup\n");
    }

    public void SetMany (string[] subjects, string[][] predicates, string[][] values) {

	message ("setmany\n");

	foreach (weak string subject in subjects) {
		message ("setmany:" + subject + "\n");
	}
    }

    public void UnsetMany (string[] subjects) {
	message ("unsetmany\n");

	foreach (weak string subject in subjects) {
		message ("unsetmany:" + subject + "\n");
	}
    }

    public void Unset (string subject) {
	message ("unset:" + subject + "\n");
    }
}

public class MyApplication : GLib.Object {

    private DBus.Connection conn;
    private Registrar registrar;

    private void on_reply (GLib.Error e) {
      message ("done");
    }

    public void setup () throws DBus.Error, GLib.Error {

	dynamic DBus.Object obj;
	DBus.ObjectPath path;
	int stored_time = 0;

        conn = DBus.Bus.get (DBus.BusType.SESSION);

	registrar = new Registrar ();
	path = new DBus.ObjectPath ("/my/application/evolution_registrar");

	obj = conn.get_object ("org.gnome.evolution",
                               "/org/gnome/evolution/metadata/Manager",
                               "org.gnome.evolution.metadata.Manager");

	conn.register_object (path, registrar);

	obj.Register (path, stored_time, on_reply);

    }

    static int main (string[] args) {
        var loop = new MainLoop (null, false);

        var app = new MyApplication ();

        try {

            app.setup ();

        } catch (DBus.Error e) {
            stderr.printf ("Failed to initialise");
            return 1;
        } catch {
            stderr.printf ("Dynamic method failure");
            return 1;
        }

        loop.run ();

        return 0;
    }
}


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