Re: [Evolution-hackers] Re: Strange console messages when accessing e-d-s through the libecal C API



> > 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í



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