From 1ad5f19df9e41efd06107dc04802c69eae7ca386 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Tue, 3 Oct 2000 01:29:43 +0000 Subject: fix typo. (impl_StorageSetView_remove_listener): same. 2000-10-02 Chris Toshok * evolution-storage-set-view.c (impl_StorageSetView_add_listener): fix typo. (impl_StorageSetView_remove_listener): same. (impl_StorageSetView__get_show_folders): implementation of getter for show_folders. (impl_StorageSetView__set_show_folders): implementation of setter for show_folders. (corba_class_init): install _set_show_folders and _get_show_folders. * Evolution-StorageSetView.idl: add show_folders attribute to StorageSetView. * e-storage-set-view.h: add prototypes for e_storage_set_view_{get,set}_show_folders. * e-storage-set-view.c (insert_storages): split this code out from e_storage_set_view_construct so we can call it when "show_folders" has been changed. (e_storage_set_view_construct): remove the code to insert storages. (e_storage_set_view_set_show_folders): new function. tears down existing tree and node/path hashtable and calls insert_storages. (e_storage_set_view_get_show_folders): new function, retrieves current show_folders state. svn path=/trunk/; revision=5684 --- shell/evolution-storage-set-view.c | 40 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) (limited to 'shell/evolution-storage-set-view.c') diff --git a/shell/evolution-storage-set-view.c b/shell/evolution-storage-set-view.c index e0401c5efc..2e320c9ee5 100644 --- a/shell/evolution-storage-set-view.c +++ b/shell/evolution-storage-set-view.c @@ -184,7 +184,7 @@ impl_StorageSetView_add_listener (PortableServer_Servant servant, EvolutionStorageSetView *storage_set_view; bonobo_object = bonobo_object_from_servant (servant); - storage_set_view = EVOLUTION_STORAGE_SET_VIEW (servant); + storage_set_view = EVOLUTION_STORAGE_SET_VIEW (bonobo_object); if (! add_listener (storage_set_view, listener)) CORBA_exception_set (ev, CORBA_USER_EXCEPTION, @@ -200,13 +200,47 @@ impl_StorageSetView_remove_listener (PortableServer_Servant servant, EvolutionStorageSetView *storage_set_view; bonobo_object = bonobo_object_from_servant (servant); - storage_set_view = EVOLUTION_STORAGE_SET_VIEW (servant); + storage_set_view = EVOLUTION_STORAGE_SET_VIEW (bonobo_object); if (! remove_listener (storage_set_view, listener)) CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_Evolution_StorageSetView_NotFound, NULL); } +static CORBA_boolean +impl_StorageSetView__get_show_folders (PortableServer_Servant servant, + CORBA_Environment * ev) +{ + BonoboObject *bonobo_object; + EvolutionStorageSetView *storage_set_view; + EvolutionStorageSetViewPrivate *priv; + + bonobo_object = bonobo_object_from_servant (servant); + storage_set_view = EVOLUTION_STORAGE_SET_VIEW (bonobo_object); + priv = storage_set_view->priv; + + return (CORBA_boolean)e_storage_set_view_get_show_folders ( + E_STORAGE_SET_VIEW(priv->storage_set_view_widget)); +} + +static void +impl_StorageSetView__set_show_folders (PortableServer_Servant servant, + const CORBA_boolean value, + CORBA_Environment * ev) +{ + BonoboObject *bonobo_object; + EvolutionStorageSetView *storage_set_view; + EvolutionStorageSetViewPrivate *priv; + + bonobo_object = bonobo_object_from_servant (servant); + storage_set_view = EVOLUTION_STORAGE_SET_VIEW (bonobo_object); + priv = storage_set_view->priv; + + e_storage_set_view_set_show_folders ( + E_STORAGE_SET_VIEW(priv->storage_set_view_widget), + (gboolean)value); +} + /* GtkObject methods. */ @@ -254,6 +288,8 @@ corba_class_init (void) epv = g_new0 (POA_Evolution_StorageSetView__epv, 1); epv->add_listener = impl_StorageSetView_add_listener; epv->remove_listener = impl_StorageSetView_remove_listener; + epv->_set_show_folders = impl_StorageSetView__set_show_folders; + epv->_get_show_folders = impl_StorageSetView__get_show_folders; vepv = &StorageSetView_vepv; vepv->_base_epv = base_epv; -- cgit