Re: [Evolution-hackers] Re: Strange console messages when accessing e-d-s through the libecal C API
- From: Not Zed <notzed ximian com>
- To: vseguip gmail com
- Cc: evolution-hackers lists ximian com, michael meeks novell com
- Subject: Re: [Evolution-hackers] Re: Strange console messages when accessing e-d-s through the libecal C API
- Date: Wed, 24 Aug 2005 15:51:30 +0800
Duh, of course. You can't just 'run it once'. It has to keep running.
i.e. all your code has to run *under* that stack point, or if not, that
stack point has to keep running whilst you run things in other threads.
You don't have a choice of 'not using listeners', they are used
internally by the e-* api's.
It may be possible to run the main loop in another thread though, i
guess; that would just be used as the return-invocation. I'm not sure
how reliable that would be with ruby though (or with the eds api's for
that matter).
(to be honest, i'm the wrong person to ask, I had nothing whatsoever to
do with the nasty shitty eds internal corba api's, and i think they need
throwing out and rewriting; although even then you will still need
return-calls, so you've still got the same problem).
On Wed, 2005-08-24 at 08:47 +0200, vseguip gmail com wrote:
> > > My original reply said this was probably because the code isn't running
> > > in a main loop. It therefore has no proper way to handle idle-processed
> > > return corba calls if they come in after an invocation returns. I think
> > > the eds objects use idle-return processing for its calls, not threads.
>
> Hi Not, I've just tried adding the bonobo_main loop but I still get
> the message. The code below produces the following output:
>
> Init (pid 10680)
> I'm idle!
>
> ** (process:10680): WARNING **: FIXME: wait for completion unimplemented
> Not init!
>
> Commenting out the explicit bonobo_debug_shutdown will produce the
> following output:
>
> Init (pid 10744)
> I'm idle!
>
> ** (process:10744): WARNING **: FIXME: wait for completion unimplemented
>
>
>
>
> Code:
> ----------
> #include <stdio.h>
> #include <unistd.h>
> #include <libebook/e-book.h>
> #include <libebook/e-contact.h>
> #include <libecal/e-cal.h>
> #include <libecal/e-cal-time-util.h>
> #include <libbonobo-2.0/libbonobo.h>
>
>
>
> ECal* open_calendar() {
> ECal* cal;
> GError* error = 0;
> cal = e_cal_new_system_calendar();
> e_cal_open(cal, FALSE, &error);
> if (error)
> printf("ERROR!");
> return cal;
> }
>
> static void get_all_appointments() {
> GError* error = 0;
> GList* appts, *l;
> ECal* cal = open_calendar();
> e_cal_get_object_list_as_comp(cal, "#t", &appts, &error);
> if((error)||( e_cal_get_load_state (cal) != E_CAL_LOAD_LOADED))
> printf("ERROR\n");
> for (l = appts; l;l = l->next) {
> ECalComponent *ev_appt = E_CAL_COMPONENT(l->data);
> g_object_unref(ev_appt);
> }
> g_list_free(appts);
> g_object_unref(cal);
> }
>
> gboolean cb_shutdown(void *data)
> {
> bonobo_main_quit();
> printf("I'm idle!\n");
> return FALSE;
> }
>
>
> int main(int argc, char** argv) {
>
> bonobo_init(&argc,argv);
> bonobo_activate();
> g_type_init();
> get_all_appointments();
> if(bonobo_is_initialized())
> printf("Init (pid %i)\n", getpid());
> g_idle_add(cb_shutdown, NULL);
> bonobo_main();
> if(g_main_pending())
> printf("Events still pending!\n") ;
> bonobo_debug_shutdown();
> if(!bonobo_is_initialized())
> printf("Not init!\n");
> return 0;
> }
>
>
> Yours,
> V. Seguí
--
adfa(evolution-2.4:20087): gtkhtml-WARNING **: cannot find icon:
'stock_insert-url' in gnome
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]