Hi everybody,

This is my first post on this list, and I want to tell you that you're doing
a great work.

About my problem, I develop some software that does synchronization of
Evolution but not from within the shell. It must be an external application.
If I want to remove a folder I use 2 approaches:
        1. If Evolution is running (I use OAF to get the running instance with
"_active") I get the CORBA interface and call �getLocalStorage�. On this I
call �asyncRemoveFolder� and that call actually crashes Evolution not my
program. Please note that the same scenario applies for adding a folder
which works great.

        2. If Evolution is stoped I simply remove the folder.

So where am I doing wrong, can some one help me?

Below are samples of the code that I'm talking abbout:

bool evolution_shell_up(CORBA_Object *obj) {
        CORBA_Environment ev;
        CORBA_exception_init (&ev);
        *obj = oaf_activate ("repo_ids.has ('IDL:GNOME/Evolution/Shell:1.0')
AND _active", NULL, 0, NULL, &ev);
        if (BONOBO_EX (&ev)) {
                        return false;
        }
                return true;
}

/* This is the callback that is registered with the async functions. It is
never triggered */
void bonobo_list_cb(BonoboListener *listener,char *event_name,
                                        CORBA_any *any,CORBA_Environment *ev,gpointer 
user_data)
{
        puts("Callback hit");
}

void use_shell_delete(GNOME_Evolution_Shell ev_shell,PTreeEntry ev_node) {
        puts("Delete with Shell");

        CORBA_Environment ev;
        CORBA_exception_init (&ev);

        GNOME_Evolution_Storage
local_storage=GNOME_Evolution_Shell_getLocalStorage(ev_shell,&ev);
        if (BONOBO_EX (&ev)) {
                        puts("Error getting local storage");
                        CORBA_exception_free(&ev);
                        return;
        }

/* I try to delete some folders that I know they are there. If this
particular case doesn't work how can the general could? */

        char *path= strdup ("/test1/test2");
        char *physical=strdup ("file:///root/evolution/local/test2");

        Bonobo_Listener corba_listener;
        BonoboListener* bonobo_listener;

        bonobo_listener=bonobo_listener_new(NULL,NULL);
        gtk_signal_connect (GTK_OBJECT (bonobo_listener), "event-notify",
                                                GTK_SIGNAL_FUNC (bonobo_list_cb),
                                                NULL);

        corba_listener=bonobo_object_corba_objref(BONOBO_OBJECT(bonobo_listener));

        GNOME_Evolution_Storage_asyncRemoveFolder (local_storage,
                                               path,physical,
                                               corba_listener, &ev);
        CORBA_exception_free (&ev);
        // Cleanup
        .....
}

void delete_folder_impl(/*args*/) {

        CORBA_Object evo_shel;
        if (evolution_shell_up(&evo_shel)) use_shell_delete(evo_shel,sub_item);
                                                                  else 
use_hard_delete(sub_item);
}


Best Regards


_______________________________________________
evolution-hackers maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/evolution-hackers

Reply via email to