aboutsummaryrefslogtreecommitdiffstats
path: root/shell/evolution-storage.c
diff options
context:
space:
mode:
authorJacob Leach <jleach@src.gnome.org>2001-06-22 00:03:26 +0800
committerJacob Leach <jleach@src.gnome.org>2001-06-22 00:03:26 +0800
commit09b9a3a4da1d8827a39fc2a7aad3402ff25250bf (patch)
tree8b0702aa552ef06bc35031eb7682af07e8bcb38a /shell/evolution-storage.c
parent6138aaf220f0de9222574436e10fa9c56a6e1f39 (diff)
downloadgsoc2013-evolution-09b9a3a4da1d8827a39fc2a7aad3402ff25250bf.tar
gsoc2013-evolution-09b9a3a4da1d8827a39fc2a7aad3402ff25250bf.tar.gz
gsoc2013-evolution-09b9a3a4da1d8827a39fc2a7aad3402ff25250bf.tar.bz2
gsoc2013-evolution-09b9a3a4da1d8827a39fc2a7aad3402ff25250bf.tar.lz
gsoc2013-evolution-09b9a3a4da1d8827a39fc2a7aad3402ff25250bf.tar.xz
gsoc2013-evolution-09b9a3a4da1d8827a39fc2a7aad3402ff25250bf.tar.zst
gsoc2013-evolution-09b9a3a4da1d8827a39fc2a7aad3402ff25250bf.zip
Fix bug #3409: Removing an EvolutionStorage from the shell's folder
tree. svn path=/trunk/; revision=10362
Diffstat (limited to 'shell/evolution-storage.c')
-rw-r--r--shell/evolution-storage.c60
1 files changed, 57 insertions, 3 deletions
diff --git a/shell/evolution-storage.c b/shell/evolution-storage.c
index 517993fa79..ee6d446cb9 100644
--- a/shell/evolution-storage.c
+++ b/shell/evolution-storage.c
@@ -650,8 +650,8 @@ evolution_storage_register_on_shell (EvolutionStorage *evolution_storage,
CORBA_exception_init (&ev);
corba_storage_registry = Bonobo_Unknown_queryInterface (corba_shell,
- "IDL:GNOME/Evolution/StorageRegistry:1.0",
- &ev);
+ "IDL:GNOME/Evolution/StorageRegistry:1.0",
+ &ev);
if (corba_storage_registry == CORBA_OBJECT_NIL || ev._major != CORBA_NO_EXCEPTION) {
CORBA_exception_free (&ev);
return EVOLUTION_STORAGE_ERROR_NOREGISTRY;
@@ -668,6 +668,60 @@ evolution_storage_register_on_shell (EvolutionStorage *evolution_storage,
}
EvolutionStorageResult
+evolution_storage_deregister_on_shell (EvolutionStorage *evolution_storage,
+ GNOME_Evolution_Shell corba_shell)
+{
+ GNOME_Evolution_StorageRegistry corba_storage_registry;
+ EvolutionStorageResult result;
+ EvolutionStoragePrivate *priv;
+ CORBA_Environment ev;
+
+ g_return_val_if_fail (evolution_storage != NULL,
+ EVOLUTION_STORAGE_ERROR_INVALIDPARAMETER);
+ g_return_val_if_fail (EVOLUTION_IS_STORAGE (evolution_storage),
+ EVOLUTION_STORAGE_ERROR_INVALIDPARAMETER);
+ g_return_val_if_fail (corba_shell != CORBA_OBJECT_NIL,
+ EVOLUTION_STORAGE_ERROR_INVALIDPARAMETER);
+
+ priv = evolution_storage->priv;
+
+ CORBA_exception_init (&ev);
+
+ corba_storage_registry = Bonobo_Unknown_queryInterface (corba_shell,
+ "IDL:GNOME/Evolution/StorageRegistry:1.0",
+ &ev);
+ if (corba_storage_registry == CORBA_OBJECT_NIL || ev._major != CORBA_NO_EXCEPTION) {
+ CORBA_exception_free (&ev);
+ return EVOLUTION_STORAGE_ERROR_NOREGISTRY;
+ }
+
+ GNOME_Evolution_StorageRegistry_removeStorageByName (corba_storage_registry,
+ priv->name,
+ &ev);
+
+ if (ev._major = CORBA_NO_EXCEPTION)
+ result = EVOLUTION_STORAGE_OK;
+ else {
+ if (ev._major != CORBA_USER_EXCEPTION)
+ result = EVOLUTION_STORAGE_ERROR_CORBA;
+ else if (strcmp (CORBA_exception_id (&ev), ex_GNOME_Evolution_StorageRegistry_NotFound) == 0)
+ result = EVOLUTION_STORAGE_ERROR_EXISTS;
+ else
+ result = EVOLUTION_STORAGE_ERROR_GENERIC;
+ }
+
+ /* Now unref the EvolutionStorage */
+ bonobo_object_unref (BONOBO_OBJECT (evolution_storage));
+
+ Bonobo_Unknown_unref (corba_storage_registry, &ev);
+ CORBA_Object_release (corba_storage_registry, &ev);
+
+ CORBA_exception_free (&ev);
+
+ return result;
+}
+
+EvolutionStorageResult
evolution_storage_new_folder (EvolutionStorage *evolution_storage,
const char *path,
const char *display_name,
@@ -861,7 +915,7 @@ evolution_storage_removed_folder (EvolutionStorage *evolution_storage,
listener = p->data;
GNOME_Evolution_StorageListener_notifyFolderRemoved (listener, path, &ev);
-
+
if (ev._major != CORBA_NO_EXCEPTION)
continue;