[Evolution-hackers] Creation of the original address books

Not Zed notzed@ximian.com
Fri, 11 Jun 2004 08:32:24 +0800


--=-12A7JbSSZSvChFvFj6WA
Content-Type: multipart/alternative; boundary="=-wn1MMreToFvZTnmT3Vo/"


--=-wn1MMreToFvZTnmT3Vo/
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

On Thu, 2004-06-10 at 22:33 +0200, Damien Sandras wrote:

> Hello,
> 
> GnomeMeeting CVS has full support for the E-D-S for the local contacts,
> but the first users have started complaining. Actually, a few of them
> are not using Evolution at all, which means there is no ~/.evolution/
> addressbook/ directory for those users.
> 
> I have to init the address book some way.
> 
> I was thinking to do this :
> 
> /* Look for the "On This Computer" Source Group */
> source_group =
>     gnomemeeting_addressbook_get_local_source_group (&source_list);
>                                                                                 
>   if (!source_group) {
>                                                                                 
>     on_this_computer =
>       e_source_group_new ("On This Computer",
>                           "file://~/.evolution/addressbook/local/
> system/");

FWIW this url isn't correct, it needs three ///'s and don't use ~.

use e.g.
uri = g_strdup_printf("file:///%s/.evolution/addressbook/local",
g_get_home_dir());

although that assumes the home dir path is url safe.

no idea if this has any bearing on the issue, i doubt it.


>     e_source_list_add_group (source_list, on_this_computer, -1);
>     source = e_source_new ("Personal", "system");
>     e_source_group_add_source (on_this_computer, source, -1);
>                                                                                 
>     e_source_list_sync (source_list, NULL);
>   }
> 
> It works, except that after that I can not add contacts to the newly
> created address book... I don't know why.

readonly perhaps?  dunno i'm only guessing, i'm really only mail.

> One other thing disturbs me. Am I forced to hardcode the evolution
> directory to have something working? What if you decide to change the
> directory?

I doubt it matters where it is (i could be wrong though).  Just so long
as people know where it is, so when they do backups they grab it.

Actually making it in evolution's location, if evolution didn't do it,
may not be the way to go.
-- 

Michael Zucchi <notzed@ximian.com>

Ximian Evolution and Free Software
Developer

--=-wn1MMreToFvZTnmT3Vo/
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.1.16">
</HEAD>
<BODY>
On Thu, 2004-06-10 at 22:33 +0200, Damien Sandras wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hello,</FONT>

<FONT COLOR="#000000">GnomeMeeting CVS has full support for the E-D-S for the local contacts,</FONT>
<FONT COLOR="#000000">but the first users have started complaining. Actually, a few of them</FONT>
<FONT COLOR="#000000">are not using Evolution at all, which means there is no ~/.evolution/</FONT>
<FONT COLOR="#000000">addressbook/ directory for those users.</FONT>

<FONT COLOR="#000000">I have to init the address book some way.</FONT>

<FONT COLOR="#000000">I was thinking to do this :</FONT>

<FONT COLOR="#000000">/* Look for the &quot;On This Computer&quot; Source Group */</FONT>
<FONT COLOR="#000000">source_group =</FONT>
<FONT COLOR="#000000">    gnomemeeting_addressbook_get_local_source_group (&amp;source_list);</FONT>
<FONT COLOR="#000000">                                                                                </FONT>
<FONT COLOR="#000000">  if (!source_group) {</FONT>
<FONT COLOR="#000000">                                                                                </FONT>
<FONT COLOR="#000000">    on_this_computer =</FONT>
<FONT COLOR="#000000">      e_source_group_new (&quot;On This Computer&quot;,</FONT>
<FONT COLOR="#000000">                          &quot;<A HREF="file://~/.evolution/addressbook/local/">file://~/.evolution/addressbook/local/</A></FONT>
<FONT COLOR="#000000">system/&quot;);</FONT>
</PRE>
</BLOCKQUOTE>
FWIW this url isn't correct, it needs three ///'s and don't use ~.<BR>
<BR>
use e.g.<BR>
uri = g_strdup_printf(&quot;file:///%s/.evolution/addressbook/local&quot;, g_get_home_dir());<BR>
<BR>
although that assumes the home dir path is url safe.<BR>
<BR>
no idea if this has any bearing on the issue, i doubt it.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">    e_source_list_add_group (source_list, on_this_computer, -1);</FONT>
<FONT COLOR="#000000">    source = e_source_new (&quot;Personal&quot;, &quot;system&quot;);</FONT>
<FONT COLOR="#000000">    e_source_group_add_source (on_this_computer, source, -1);</FONT>
<FONT COLOR="#000000">                                                                                </FONT>
<FONT COLOR="#000000">    e_source_list_sync (source_list, NULL);</FONT>
<FONT COLOR="#000000">  }</FONT>

<FONT COLOR="#000000">It works, except that after that I can not add contacts to the newly</FONT>
<FONT COLOR="#000000">created address book... I don't know why.</FONT>
</PRE>
</BLOCKQUOTE>
readonly perhaps?&nbsp; dunno i'm only guessing, i'm really only mail.
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">One other thing disturbs me. Am I forced to hardcode the evolution</FONT>
<FONT COLOR="#000000">directory to have something working? What if you decide to change the</FONT>
<FONT COLOR="#000000">directory?</FONT>
</PRE>
</BLOCKQUOTE>
I doubt it matters where it is (i could be wrong though).&nbsp; Just so long as people know where it is, so when they do backups they grab it.<BR>
<BR>
Actually making it in evolution's location, if evolution didn't do it, may not be the way to go.<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
-- <BR>
<TABLE CELLSPACING="6">
<TR>
<TD>
<IMG SRC="cid:1086913779.5528.115.camel@lostzed.mmc.com.au" WIDTH="48" HEIGHT="48" ALIGN="top" ALT="" BORDER="0">
</TD>
<TD>
<B>Michael Zucchi</B> &lt;<A HREF="mailto:notzed@ximian.com">notzed@ximian.com</A>&gt;<BR>
<BR>
<I><A HREF="http://codeblogs.ximian.com/blogs/evolution/">Ximian Evolution</A> and <A HREF="http://www.gnu.org/philosophy/free-sw.html">Free Software</A> Developer</I>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>

--=-wn1MMreToFvZTnmT3Vo/--

--=-12A7JbSSZSvChFvFj6WA
Content-ID: <1086913779.5528.115.camel@lostzed.mmc.com.au>
Content-Disposition: attachment; filename=zed-48.small.jpg
Content-Type: application/octet-stream; name=zed-48.small.jpg
Content-Transfer-Encoding: base64

/9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