Evolution Addressbook Backend
- From: Matt Jones <mattharrison sbcglobal net>
- To: dashboard-hackers gnome org
- Subject: Evolution Addressbook Backend
- Date: Thu, 19 Feb 2004 17:30:36 -0800
Hi -
I have the Evolution Addressbook 2.0 backend compiling again, but I'm
running into some problems with queries. No matter what I stick into the
query (or what type of query I'm running), I get no contacts back. I'm
using cvs HEAD (+ FullName support) of evolution# and evolution cvs from
about a week ago (around the ninth, i think). I've attached the patches
for both evolution sharp and EvolutionAddressbookBackend.cs in case
anyone else wants to test out the code (I'm not definite that everything
is finished yet - and the new code is very rough, still contains some
debugging stuff).
Also, how should evolution# respond to attempts to set the FullName
variable? Right now I just call SetProperty("full_name" ...), but this
will probably return an error if its called. Should I just ignore this,
or write code to parse the full name and split it into Given and Family
names and then set those?
-- Matt Jones
Index: backends/EvolutionAddressbookBackend.cs
===================================================================
RCS file: /cvs/gnome/dashboard/backends/EvolutionAddressbookBackend.cs,v
retrieving revision 1.9
diff -r1.9 EvolutionAddressbookBackend.cs
64c64
< return resultset;
---
> return result;
69a70
> ArrayList resultset = new ArrayList();
78c79
< GenerateCluesForContact (resultpoiewjfoiewjfoiewjfoiewjfoiewjfoiewjf this is broken FIXME
---
> GenerateCluesForContact ( resultset, contact, m );
80c81
< GenerateClues (resultset, contacts, c);
---
> GenerateClues (result, contacts, c);
91,93c92,94
< private void GenerateResult (BackendResult result, ArrayList contacts, Clue c)
< {
< }
---
> // private void GenerateResult (BackendResult result, ArrayList contacts, Clue c)
> // {
> // }
100c101,104
< GenerateCluesForContact (clues, contact, c);
---
> {
> Match m = GenerateMatchForContact(contact, c);
> GenerateCluesForContact (clues, contact, m);
> }
107,108c111,112
< AddClue (clues, c, contact.FullName, "full_name");
< AddClue (clues, c, contact.Email1, "email");
---
> AddClue (clues, triggering_match, contact.FullName, "full_name");
> AddClue (clues, triggering_match, contact.Email1, "email");
111c115
< AddClue (clues, c, contact.ImAim [0], "aim_name");
---
> AddClue (clues, triggering_match, contact.ImAim [0], "aim_name");
114c118
< AddClue (clues, c, contact.ImMsn [0], "msn_name");
---
> AddClue (clues, triggering_match, contact.ImMsn [0], "msn_name");
117c121
< AddClue (clues, c, contact.ImIcq [0], "icq_name");
---
> AddClue (clues, triggering_match, contact.ImIcq [0], "icq_name");
120c124
< AddClue (clues, c, contact.ImJabber [0], "jabber_name");
---
> AddClue (clues, triggering_match, contact.ImJabber [0], "jabber_name");
123c127
< AddClue (clues, c, contact.ImYahoo [0], "yahoo_name");
---
> AddClue (clues, triggering_match, contact.ImYahoo [0], "yahoo_name");
125,126c129,130
< AddClue (clues, c, contact.HomepageUrl, "url");
< AddClue (clues, c, contact.BlogUrl, "rss");
---
> AddClue (clues, triggering_match, contact.HomepageUrl, "url");
> AddClue (clues, triggering_match, contact.BlogUrl, "rss");
135c139
< private BackendMatch GenerateMatchForContact (Contact contact)
---
> private Match GenerateMatchForContact (Contact contact, Clue c)
137c141
< BackendMatch result = new BackendMatch ();
---
> Match result = new Match ( "Addressbook", c );
140c144
< result.AddItem (new BackendMatchItem ("Name", contact.FullName, "text", "xml"));
---
> result["Name"] = contact.FullName;
143c147,150
< result.AddItem (new BackendMatchItem ("EMail", contact.Email1, "text", "xml"));
---
> {
> result["EMail"] = contact.Email1;
> Console.WriteLine( contact.Email1 );
> }
146c153,156
< result.AddItem (new BackendMatchItem ("Phone", contact.PrimaryPhone, "text", "xml"));
---
> {
> result["Phone"] = contact.PrimaryPhone;
> Console.WriteLine( contact.PrimaryPhone );
> }
153,154c163,164
< if (c.Type == "*" || c.Type == "keyword")
< return BookQuery.AnyFieldContains (c.Text);
---
> if (c.Type == "*" || c.Type == "keyword" || c.Type == "email") // FIXME: frontend should be passing in a wildcard clue type, not an email clue type
> return BookQuery.AnyFieldContains ("Robb" );//c.Text);
Index: evolution/Contact.custom
===================================================================
RCS file: /cvs/gnome/evolution-sharp/evolution/Contact.custom,v
retrieving revision 1.2
diff -r1.2 Contact.custom
32a33,42
> public string FullName {
> get {
> string ret = GivenName + " " +FamilyName;
> return ret;
> }
> set {
> SetProperty("full_name", new GLib.Value(value));
> }
> }
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]