Re: [Evolution-hackers] [PATCH 1/2] e_cal_new_system_foo() should create corresponding source in GConf

2011-05-27 Thread Christophe Dumez

On 05/10/2011 01:43 PM, David Woodhouse wrote:

On Tue, 2011-05-10 at 11:40 +0100, Dumez, Christophe wrote:

I have tested the patch but it does not seem to help. I don't know
what the reason is yet.

It may depend on earlier fixes? Can you show your patch?


This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

Please don't post to public mailing lists with this unenforceable
nonsense. If you file a ticket with the helpdesk, they will remove it
for your outbound mail. (And if they refuse, get a name and contact me
in private).


I have attached the correct patches for libebook to bug:
https://bugzilla.gnome.org/show_bug.cgi?id=651226

I would appreciate if you could review them and apply them to gnome-3-32 
and master.


Kr,

--
Dr. Christophe Dumez
Linux Software Engineer
Intel Finland Oy - Open Source Technology Center

___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers


Re: [Evolution-hackers] [PATCH 1/2] e_cal_new_system_foo() should create corresponding source in GConf

2011-05-11 Thread Christophe Dumez
Hi,

No, I'm definitely not working on this (EDS), I thought you were :)
I actually followed Patrick's advice and I executed Evolution once so that it 
created the system addressbook. This way I can work around the bug and keep on 
working on the QtContacts backend for EDS. I don't have time to look into EDS 
code for now (I'm not familiar enough with EDS internals to do a quick fix).

Kr,
Christophe Dumez.

-Original Message-
From: David Woodhouse [mailto:dw...@infradead.org] 
Sent: Wednesday, May 11, 2011 2:26 PM
To: Dumez, Christophe
Cc: Patrick Ohly; Evolution Hackers; r...@burtonini.com
Subject: RE: [PATCH 1/2] e_cal_new_system_foo() should create corresponding 
source in GConf

On Tue, 2011-05-10 at 11:40 +0100, Dumez, Christophe wrote:
> I have tested the patch but it does not seem to help. I don't know
> what the reason is yet.

I'm going to assume you're still happily working on this and don't need
my assistance, until such time as you turn up on the #evolution IRC
channel and bug me about it. OK? :)

-- 
dwmw2


___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers


Re: [Evolution-hackers] [PATCH 1/2] e_cal_new_system_foo() should create corresponding source in GConf

2011-05-11 Thread David Woodhouse
On Tue, 2011-05-10 at 11:40 +0100, Dumez, Christophe wrote:
> I have tested the patch but it does not seem to help. I don't know
> what the reason is yet.

I'm going to assume you're still happily working on this and don't need
my assistance, until such time as you turn up on the #evolution IRC
channel and bug me about it. OK? :)

-- 
dwmw2

___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers


Re: [Evolution-hackers] [PATCH 1/2] e_cal_new_system_foo() should create corresponding source in GConf

2011-05-10 Thread David Woodhouse
On Tue, 2011-05-10 at 10:19 +0200, Patrick Ohly wrote:
> It seems that a similar problem exists in libebook if no address books
> were created already by Evolution. Chris is seeing such an issue with
> 2.32.3 in MeeGo.

Oh, tits. I hate the fact that all this code is so *gratuitously*
separate. Because my patch ended up calling get_local_source() three
times (for cal/tasks/memos) I was tricked into thinking I'd already
covered everything; the fact that that was all still just *calendar* and
I hadn't handled the addressbook side had temporarily eluded my feeble
mind.

> We probably need to add the "create GConf entry for local:system" part
> to libebook in the gnome-2-32 branch. Is that something that is still
> of interest for Trunk, given that EClient API will obsolete it for
> 3.2?

It's still relevant for now, so let's do it. We *could* make a case for
not bothering, and just fixing it in 3.0 and 2.32 instead. But our
policy is to backport only fixes from master, and I prefer not to set a
counter-precedent unless I absolutely have to. It doesn't *hurt* to fix
it in master first.

Do you have a patch?

-- 
David WoodhouseOpen Source Technology Centre
david.woodho...@intel.com  Intel Corporation

___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers


Re: [Evolution-hackers] [PATCH 1/2] e_cal_new_system_foo() should create corresponding source in GConf

2011-05-10 Thread David Woodhouse
On Tue, 2011-05-10 at 11:40 +0100, Dumez, Christophe wrote:
> 
> I have tested the patch but it does not seem to help. I don't know
> what the reason is yet.

It may depend on earlier fixes? Can you show your patch?

> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.

Please don't post to public mailing lists with this unenforceable
nonsense. If you file a ticket with the helpdesk, they will remove it
for your outbound mail. (And if they refuse, get a name and contact me
in private).

-- 
dwmw2

___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers


Re: [Evolution-hackers] [PATCH 1/2] e_cal_new_system_foo() should create corresponding source in GConf

2011-05-10 Thread Patrick Ohly
On Di, 2011-05-10 at 09:34 +0100, David Woodhouse wrote:
> On Tue, 2011-05-10 at 10:19 +0200, Patrick Ohly wrote:
> > It seems that a similar problem exists in libebook if no address books
> > were created already by Evolution. Chris is seeing such an issue with
> > 2.32.3 in MeeGo.
> 
> Oh, tits. I hate the fact that all this code is so *gratuitously*
> separate.

Yeah, me too. 3.2 will be better, but will still have separate
libebook/libecal libraries.

> > We probably need to add the "create GConf entry for local:system" part
> > to libebook in the gnome-2-32 branch. Is that something that is still
> > of interest for Trunk, given that EClient API will obsolete it for
> > 3.2?
> 
> It's still relevant for now, so let's do it. We *could* make a case for
> not bothering, and just fixing it in 3.0 and 2.32 instead. But our
> policy is to backport only fixes from master, and I prefer not to set a
> counter-precedent unless I absolutely have to. It doesn't *hurt* to fix
> it in master first.
> 
> Do you have a patch?

Sorry, no. And no time either :-/

-- 
Bye, Patrick Ohly
--  
patrick.o...@gmx.de
http://www.estamos.de/


___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers


Re: [Evolution-hackers] [PATCH 1/2] e_cal_new_system_foo() should create corresponding source in GConf

2011-05-10 Thread Patrick Ohly
Hello!

It seems that a similar problem exists in libebook if no address books
were created already by Evolution. Chris is seeing such an issue with
2.32.3 in MeeGo.

We probably need to add the "create GConf entry for local:system" part
to libebook in the gnome-2-32 branch. Is that something that is still of
interest for Trunk, given that EClient API will obsolete it for 3.2?

-- 
Bye, Patrick Ohly
--  
patrick.o...@gmx.de
http://www.estamos.de/


___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers


Re: [Evolution-hackers] [PATCH 1/2] e_cal_new_system_foo() should create corresponding source in GConf

2011-05-10 Thread Patrick Ohly
On Di, 2011-05-10 at 11:40 +0100, Dumez, Christophe wrote:
> I have tested the patch but it does not seem to help. I don't know what the 
> reason is yet.

If you have never run Evolution, there will be no gconf entries for
addressbook. The second part of the fix was to have libecal create this
entry when creating a new system address book.

-- 
Bye, Patrick Ohly
--  
patrick.o...@gmx.de
http://www.estamos.de/


___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers


[Evolution-hackers] [PATCH 1/2] e_cal_new_system_foo() should create corresponding source in GConf

2011-04-15 Thread David Woodhouse
---
 calendar/libecal/e-cal.c |   56 +++--
 1 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/calendar/libecal/e-cal.c b/calendar/libecal/e-cal.c
index 6835d45..69ff9c7 100644
--- a/calendar/libecal/e-cal.c
+++ b/calendar/libecal/e-cal.c
@@ -1023,6 +1023,56 @@ e_cal_new_from_uri (const gchar *uri, ECalSourceType 
type)
return cal;
 }
 
+static ECal *
+get_local_source (ECalSourceType type)
+{
+   ESourceList *sources;
+   ESourceGroup *on_this_computer;
+   GSList *local_sources, *iter;
+   gchar *source_uri = NULL;
+   ECal *ecal;
+
+   if (!e_cal_get_sources (&sources, type, NULL)) {
+   g_warning ("Could not get task sources from GConf!");
+   goto out;
+   }
+
+   on_this_computer = e_source_list_ensure_group (sources,
+  _("On This Computer"),
+  "local:", TRUE);
+   if (!on_this_computer) {
+   g_object_unref (sources);
+   goto out;
+   }
+
+   local_sources = e_source_group_peek_sources (on_this_computer);
+   for (iter = local_sources; !source_uri && iter != NULL; iter = 
iter->next) {
+   ESource *source = iter->data;
+   gchar *uri;
+
+   uri = e_source_get_uri (source);
+   if (g_strcmp0 (uri, "local:system") == 0)
+   source_uri = uri;
+   else
+   g_free (uri);
+   }
+   if (!source_uri) {
+   ESource *source;
+   source = e_source_new (_("Personal"), "system");
+   e_source_set_color_spec (source, "#BECEDD");
+   e_source_group_add_source (on_this_computer, source, -1);
+   g_object_unref (source);
+
+   if (!e_source_list_sync (sources, NULL))
+   g_warning ("Cannot add system source to GConf!");
+   }
+   g_object_unref (on_this_computer);
+   g_object_unref (sources);
+ out:
+   ecal = e_cal_new_from_uri (source_uri?:"local:system", type);
+   g_free (source_uri);
+   return ecal;
+}
 /**
  * e_cal_new_system_calendar:
  *
@@ -1036,7 +1086,7 @@ e_cal_new_from_uri (const gchar *uri, ECalSourceType type)
 ECal *
 e_cal_new_system_calendar (void)
 {
-   return e_cal_new_from_uri ("local:system", E_CAL_SOURCE_TYPE_EVENT);
+   return get_local_source (E_CAL_SOURCE_TYPE_EVENT);
 }
 
 /**
@@ -1052,7 +1102,7 @@ e_cal_new_system_calendar (void)
 ECal *
 e_cal_new_system_tasks (void)
 {
-   return e_cal_new_from_uri ("local:system", E_CAL_SOURCE_TYPE_TODO);
+   return get_local_source (E_CAL_SOURCE_TYPE_TODO);
 }
 
 /**
@@ -1068,7 +1118,7 @@ e_cal_new_system_tasks (void)
 ECal *
 e_cal_new_system_memos (void)
 {
-   return e_cal_new_from_uri ("local:system", E_CAL_SOURCE_TYPE_JOURNAL);
+   return get_local_source (E_CAL_SOURCE_TYPE_JOURNAL);
 }
 
 /**
-- 
1.7.4.2



___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers