aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--shell/ChangeLog24
-rw-r--r--shell/e-folder-tree.c2
-rw-r--r--shell/e-local-storage.c30
-rw-r--r--shell/e-shell-view.c6
-rw-r--r--shell/evolution-storage-listener.c24
-rw-r--r--shell/evolution-storage-listener.h10
-rw-r--r--shell/evolution-storage.c21
7 files changed, 103 insertions, 14 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index aca74fb3b8..40faf055e1 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,29 @@
2000-09-11 Ettore Perazzoli <ettore@helixcode.com>
+ * evolution-storage.c (evolution_storage_new_folder): If
+ description is NULL, use the empty string instead.
+
+ * e-local-storage.c (new_folder): New utility function to add a
+ new folder by keeping both the Bonobo interface and the EStorage
+ up-to-date.
+ (load_folders): Use it here instead of just
+ `e_storage_new_folder()'.
+ (component_async_create_folder_callback): Likewise.
+
+ * e-shell-view.c (update_for_current_uri): Prevent an
+ EStorageSetView warning if the path is NULL.
+
+ * evolution-storage.c (impl_Storage_add_listener): New,
+ implementation for `Evolution::Storage::add_listener'.
+ (evolution_storage_get_epv): Install it.
+
+ * evolution-storage-listener.c
+ (evolution_storage_listener_corba_objref): New.
+ (create_servant): Create the servant with `g_new0()' instead of
+ `g_new()'.
+
+2000-09-11 Ettore Perazzoli <ettore@helixcode.com>
+
* evolution-storage-listener.c
(evolution_storage_listener_construct): Unset the `GTK_FLOATING'
flag as `EvolutionStorageListener' is self-owned.
diff --git a/shell/e-folder-tree.c b/shell/e-folder-tree.c
index 0c719ca9a4..9962fa508f 100644
--- a/shell/e-folder-tree.c
+++ b/shell/e-folder-tree.c
@@ -372,7 +372,7 @@ e_folder_tree_foreach (EFolderTree *folder_tree,
root_node = g_hash_table_lookup (folder_tree->path_to_folder,
G_DIR_SEPARATOR_S);
if (root_node == NULL) {
- g_warning ("%s -- What?! No root node!?", __FUNCTION__);
+ g_warning ("e_folder_tree_foreach -- What?! No root node!?");
return;
}
diff --git a/shell/e-local-storage.c b/shell/e-local-storage.c
index 7a8a1de8e2..43c433a1ee 100644
--- a/shell/e-local-storage.c
+++ b/shell/e-local-storage.c
@@ -28,6 +28,9 @@
* - If the LocalStorage is destroyed and an async operation on a shell component is
* pending, we get a callback on a bogus object. We need support for cancelling
* operations on the shell component.
+ *
+ * - The tree is kept both in the EStorage and the EvolutionStorage. Very
+ * bad design.
*/
#ifdef HAVE_CONFIG_H
@@ -151,6 +154,27 @@ get_physical_path (ELocalStorage *local_storage,
return real_path;
}
+static void
+new_folder (ELocalStorage *local_storage,
+ const char *path,
+ EFolder *folder)
+{
+ ELocalStoragePrivate *priv;
+
+ priv = local_storage->priv;
+
+ g_print ("%s:%s -- %s\n", __FILE__, __FUNCTION__, path);
+
+ e_storage_new_folder (E_STORAGE (local_storage), path, folder);
+
+ evolution_storage_new_folder (EVOLUTION_STORAGE (priv->bonobo_interface),
+ path,
+ e_folder_get_name (folder),
+ e_folder_get_type_string (folder),
+ e_folder_get_physical_uri (folder),
+ e_folder_get_description (folder));
+}
+
static gboolean
load_folders (ELocalStorage *local_storage,
const char *parent_path,
@@ -174,7 +198,7 @@ load_folders (ELocalStorage *local_storage,
if (folder == NULL)
return FALSE;
- e_storage_new_folder (E_STORAGE (local_storage), path, folder);
+ new_folder (E_STORAGE (local_storage), path, folder);
subfolder_directory_path = g_concat_dir_and_file (physical_path, SUBFOLDER_DIR_NAME);
}
@@ -334,9 +358,7 @@ component_async_create_folder_callback (EvolutionShellComponentClient *shell_com
e_folder_set_physical_uri (folder, callback_data->physical_uri);
if (e_local_folder_save (E_LOCAL_FOLDER (folder))) {
- e_storage_new_folder (callback_data->storage,
- callback_data->path,
- folder);
+ new_folder (callback_data->storage, callback_data->path, folder);
} else {
rmdir (callback_data->physical_path);
gtk_object_unref (GTK_OBJECT (folder));
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 2863fc34a7..0269db569b 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -951,8 +951,10 @@ update_for_current_uri (EShellView *shell_view)
gtk_signal_handler_block_by_func (GTK_OBJECT (priv->storage_set_view),
GTK_SIGNAL_FUNC (folder_selected_cb),
shell_view);
- e_storage_set_view_set_current_folder (E_STORAGE_SET_VIEW (priv->storage_set_view),
- path);
+
+ if (path != NULL)
+ e_storage_set_view_set_current_folder (E_STORAGE_SET_VIEW (priv->storage_set_view), path);
+
gtk_signal_handler_unblock_by_func (GTK_OBJECT (priv->storage_set_view),
GTK_SIGNAL_FUNC (folder_selected_cb),
shell_view);
diff --git a/shell/evolution-storage-listener.c b/shell/evolution-storage-listener.c
index 7f1e64e70f..e059fd72b6 100644
--- a/shell/evolution-storage-listener.c
+++ b/shell/evolution-storage-listener.c
@@ -115,7 +115,7 @@ create_servant (EvolutionStorageListener *listener)
CORBA_exception_init (&ev);
- servant = g_new (EvolutionStorageListenerServant, 1);
+ servant = g_new0 (EvolutionStorageListenerServant, 1);
corba_servant = (POA_Evolution_StorageListener *) servant;
corba_servant->vepv = &my_Evolution_StorageListener_vepv;
@@ -302,5 +302,27 @@ evolution_storage_listener_new (void)
}
+/**
+ * evolution_storage_listener_corba_objref:
+ * @listener: A pointer to an EvolutionStorageListener
+ *
+ * Get the CORBA object reference for the interface embedded in this GTK+
+ * object wrapper.
+ *
+ * Return value: A pointer to the CORBA object reference.
+ **/
+Evolution_StorageListener
+evolution_storage_listener_corba_objref (EvolutionStorageListener *listener)
+{
+ EvolutionStorageListenerPrivate *priv;
+
+ g_return_val_if_fail (listener != NULL, CORBA_OBJECT_NIL);
+ g_return_val_if_fail (EVOLUTION_IS_STORAGE_LISTENER (listener), CORBA_OBJECT_NIL);
+
+ priv = listener->priv;
+ return priv->corba_objref;
+}
+
+
E_MAKE_TYPE (evolution_storage_listener, "EvolutionStorageListener", EvolutionStorageListener,
class_init, init, PARENT_TYPE)
diff --git a/shell/evolution-storage-listener.h b/shell/evolution-storage-listener.h
index 3ac48f0803..2ac6ddd5d4 100644
--- a/shell/evolution-storage-listener.h
+++ b/shell/evolution-storage-listener.h
@@ -74,10 +74,12 @@ struct _EvolutionStorageListenerServant {
typedef struct _EvolutionStorageListenerServant EvolutionStorageListenerServant;
-GtkType evolution_storage_listener_get_type (void);
-void evolution_storage_listener_construct (EvolutionStorageListener *listener,
- Evolution_StorageListener corba_objref);
-EvolutionStorageListener *evolution_storage_listener_new (void);
+GtkType evolution_storage_listener_get_type (void);
+void evolution_storage_listener_construct (EvolutionStorageListener *listener,
+ Evolution_StorageListener corba_objref);
+EvolutionStorageListener *evolution_storage_listener_new (void);
+
+Evolution_StorageListener evolution_storage_listener_corba_objref (EvolutionStorageListener *listener);
#ifdef __cplusplus
}
diff --git a/shell/evolution-storage.c b/shell/evolution-storage.c
index ec68cf31a2..90ca36f397 100644
--- a/shell/evolution-storage.c
+++ b/shell/evolution-storage.c
@@ -172,6 +172,20 @@ impl_Storage__get_name (PortableServer_Servant servant,
return CORBA_string_dup (priv->name);
}
+static void
+impl_Storage_add_listener (PortableServer_Servant servant,
+ const Evolution_StorageListener listener,
+ CORBA_Environment *ev)
+{
+ BonoboObject *bonobo_object;
+ EvolutionStorage *storage;
+
+ bonobo_object = bonobo_object_from_servant (servant);
+ storage = EVOLUTION_STORAGE (bonobo_object);
+
+ add_listener (storage, listener);
+}
+
/* GtkObject methods. */
@@ -264,7 +278,8 @@ evolution_storage_get_epv (void)
POA_Evolution_Storage__epv *epv;
epv = g_new0 (POA_Evolution_Storage__epv, 1);
- epv->_get_name = impl_Storage__get_name;
+ epv->_get_name = impl_Storage__get_name;
+ epv->add_listener = impl_Storage_add_listener;
return epv;
}
@@ -411,10 +426,12 @@ evolution_storage_new_folder (EvolutionStorage *evolution_storage,
EVOLUTION_STORAGE_ERROR_INVALIDPARAMETER);
g_return_val_if_fail (path != NULL, EVOLUTION_STORAGE_ERROR_INVALIDPARAMETER);
g_return_val_if_fail (g_path_is_absolute (path), EVOLUTION_STORAGE_ERROR_INVALIDPARAMETER);
- g_return_val_if_fail (description != NULL, EVOLUTION_STORAGE_ERROR_INVALIDPARAMETER);
g_return_val_if_fail (type != NULL, EVOLUTION_STORAGE_ERROR_INVALIDPARAMETER);
g_return_val_if_fail (physical_uri != NULL, EVOLUTION_STORAGE_ERROR_INVALIDPARAMETER);
+ if (description == NULL)
+ description = "";
+
priv = evolution_storage->priv;
CORBA_exception_init (&ev);