From 9288ec2e2c8ae08e2fd27f6a55e45440156344c0 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Fri, 25 May 2001 18:35:40 +0000 Subject: Added ETSPECDIR. Added e-storage-set-view.etspec to get installed. 2001-05-21 Christopher James Lahey * Makefile.am (INCLUDES): Added ETSPECDIR. Added e-storage-set-view.etspec to get installed. * e-local-storage.c (remove_folder_directory): Commented out this function since it is unused. * e-shell-folder-commands.c (folder_selection_dialog_folder_selected_callback), e-shell-view.c (update_offline_toggle_status): Fixed warnings here by adding a return; after the g_assert_not_reached();. * e-shell-importer.c (start_import): Got rid of real_folderpath here and just reused folderpath (It was causing uninitialized variable warnings.) * e-shell.c (impl_Shell_getLocalStorage): Use bonobo_object_dup_ref here. It makes things simpler. * e-storage-set-view.c: Removed ETREE_SPEC since it's no longer needed. (convert_corba_drag_action_set_to_gdk, folder_context_menu_activate_cb, remove_cb, folder_context_menu_remove_cb): Commented out these functions since they're unused. (new_storage_cb, new_folder_cb, insert_folders, insert_storages): Don't bother using insert_id here since it no longer does anything. (new_storage_cb, removed_storage_cb, removed_folder_cb): Don't free the data returned from e_tree_memory_node_remove. (e_storage_set_view_construct): Set the destroy func here so that memory will automatically get freed when nodes are destroyed. g_strdup the root node string here. Use e_tree_construct_from_spec_file here to use an external file. (e_storage_set_view_set_show_folders): g_strdup the root node string here. * e-storage-set-view.etspec: New etspec file. * evolution-shell-component-client.c (free_ShellComponentListener_servant): Added a prototype here. svn path=/trunk/; revision=9989 --- shell/ChangeLog | 43 +++++++++++++++++++++++++++ shell/Makefile.am | 6 +++- shell/e-local-storage.c | 2 ++ shell/e-shell-folder-commands.c | 1 + shell/e-shell-importer.c | 5 ++-- shell/e-shell-view.c | 1 + shell/e-shell.c | 6 ++-- shell/e-storage-set-view.c | 50 ++++++++++++-------------------- shell/e-storage-set-view.etspec | 7 +++++ shell/evolution-shell-component-client.c | 3 ++ 10 files changed, 85 insertions(+), 39 deletions(-) create mode 100644 shell/e-storage-set-view.etspec diff --git a/shell/ChangeLog b/shell/ChangeLog index 386f08f046..ab1f215fe5 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,46 @@ +2001-05-21 Christopher James Lahey + + * Makefile.am (INCLUDES): Added ETSPECDIR. Added + e-storage-set-view.etspec to get installed. + + * e-local-storage.c (remove_folder_directory): Commented out this + function since it is unused. + + * e-shell-folder-commands.c + (folder_selection_dialog_folder_selected_callback), e-shell-view.c + (update_offline_toggle_status): Fixed warnings here by adding a + return; after the g_assert_not_reached();. + + * e-shell-importer.c (start_import): Got rid of real_folderpath + here and just reused folderpath (It was causing uninitialized + variable warnings.) + + * e-shell.c (impl_Shell_getLocalStorage): Use + bonobo_object_dup_ref here. It makes things simpler. + + * e-storage-set-view.c: Removed ETREE_SPEC since it's no longer + needed. + (convert_corba_drag_action_set_to_gdk, + folder_context_menu_activate_cb, remove_cb, + folder_context_menu_remove_cb): Commented out these functions + since they're unused. + (new_storage_cb, new_folder_cb, insert_folders, insert_storages): + Don't bother using insert_id here since it no longer does + anything. + (new_storage_cb, removed_storage_cb, removed_folder_cb): Don't + free the data returned from e_tree_memory_node_remove. + (e_storage_set_view_construct): Set the destroy func here so that + memory will automatically get freed when nodes are destroyed. + g_strdup the root node string here. Use + e_tree_construct_from_spec_file here to use an external file. + (e_storage_set_view_set_show_folders): g_strdup the root node + string here. + + * e-storage-set-view.etspec: New etspec file. + + * evolution-shell-component-client.c + (free_ShellComponentListener_servant): Added a prototype here. + 2001-05-23 Chris Toshok * evolution-shell-component.h diff --git a/shell/Makefile.am b/shell/Makefile.am index 0f2e1731c2..8cd1c9c3ef 100644 --- a/shell/Makefile.am +++ b/shell/Makefile.am @@ -10,6 +10,7 @@ INCLUDES = \ -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \ -DEVOLUTION_DATADIR=\""$(datadir)"\" \ -DEVOLUTION_GLADEDIR=\"$(datadir)/evolution/glade\" \ + -DEVOLUTION_ETSPECDIR=\"$(datadir)/evolution/etspec\" \ -DG_LOG_DOMAIN=\"evolution-shell\" # CORBA stuff @@ -150,9 +151,12 @@ oafdir = $(datadir)/oaf oaf_in_files = GNOME_Evolution_Shell.oaf.in oaf_DATA = $(oaf_in_files:.oaf.in=.oaf) +etspecdir = $(datadir)/evolution/etspec/ +etspec_DATA = e-storage-set-view.etspec + @XML_I18N_MERGE_OAF_RULE@ -EXTRA_DIST = $(IDLS) $(oaf_in_files) $(oaf_DATA) +EXTRA_DIST = $(IDLS) $(oaf_in_files) $(oaf_DATA) $(etspec_DATA) # Purify support diff --git a/shell/e-local-storage.c b/shell/e-local-storage.c index 361f2e2044..1cc856e70a 100644 --- a/shell/e-local-storage.c +++ b/shell/e-local-storage.c @@ -394,6 +394,7 @@ create_folder (ELocalStorage *local_storage, callback_data); } +#if 0 static EStorageResult remove_folder_directory (ELocalStorage *local_storage, const char *path) @@ -432,6 +433,7 @@ remove_folder_directory (ELocalStorage *local_storage, g_free (physical_path); return E_STORAGE_OK; } +#endif /* GtkObject methods. */ diff --git a/shell/e-shell-folder-commands.c b/shell/e-shell-folder-commands.c index ab5c22ed0a..7621294609 100644 --- a/shell/e-shell-folder-commands.c +++ b/shell/e-shell-folder-commands.c @@ -143,6 +143,7 @@ folder_selection_dialog_folder_selected_callback (EShellFolderSelectionDialog *f break; default: g_assert_not_reached (); + return; } storage_set = e_shell_get_storage_set (folder_command_data->shell); diff --git a/shell/e-shell-importer.c b/shell/e-shell-importer.c index c8ab15aadf..b04fd78c10 100644 --- a/shell/e-shell-importer.c +++ b/shell/e-shell-importer.c @@ -336,7 +336,6 @@ start_import (const char *folderpath, ImporterComponentData *icd; char *label; char *real_iid; - char *real_folderpath; if (iid == NULL || strcmp (iid, "Automatic") == 0) { /* Work out the component to use */ @@ -397,10 +396,10 @@ start_import (const char *folderpath, /* NULL for folderpath means use Inbox */ g_warning ("Folderpath: %s", folderpath); if (*folderpath == '/') { - real_folderpath = strchr (folderpath + 1, '/'); + folderpath = strchr (folderpath + 1, '/'); } - if (evolution_importer_client_load_file (icd->client, filename, real_folderpath) == FALSE) { + if (evolution_importer_client_load_file (icd->client, filename, folderpath) == FALSE) { label = g_strdup_printf (_("Error loading %s"), filename); gtk_label_set_text (GTK_LABEL (icd->contents), label); g_free (label); diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 930088b842..d90f81f5fd 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -1372,6 +1372,7 @@ update_offline_toggle_status (EShellView *shell_view) break; default: g_assert_not_reached (); + return; } gtk_pixmap_set (GTK_PIXMAP (priv->offline_toggle_pixmap), icon_pixmap, icon_mask); diff --git a/shell/e-shell.c b/shell/e-shell.c index d09ceca1ad..3682373350 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -299,7 +299,6 @@ impl_Shell_getLocalStorage (PortableServer_Servant servant, { BonoboObject *bonobo_object; GNOME_Evolution_LocalStorage local_storage_interface; - GNOME_Evolution_LocalStorage copy_of_local_storage_interface; EShell *shell; EShellPrivate *priv; @@ -309,10 +308,9 @@ impl_Shell_getLocalStorage (PortableServer_Servant servant, local_storage_interface = e_local_storage_get_corba_interface (priv->local_storage); - copy_of_local_storage_interface = CORBA_Object_duplicate (local_storage_interface, ev); - Bonobo_Unknown_ref (copy_of_local_storage_interface, ev); + bonobo_object_dup_ref (local_storage_interface, ev); - return copy_of_local_storage_interface; + return local_storage_interface; } static Bonobo_Control diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c index de5bc21671..6750a699ec 100644 --- a/shell/e-storage-set-view.c +++ b/shell/e-storage-set-view.c @@ -43,11 +43,6 @@ #include "e-shell-constants.h" #include "e-local-storage.h" -#ifdef JUST_FOR_TRANSLATORS -static char *list [] = { - N_("Folder"), -}; -#endif /*#define DEBUG_XML*/ @@ -55,14 +50,6 @@ static char *list [] = { * well, and there is no way for us to use the * same value as it's not exported. */ -#define ETREE_SPEC " \ - \ - \ - \ - \ - \ -" - /* This is used on the source side to define the two basic types that we always export. */ @@ -353,6 +340,7 @@ convert_gdk_drag_action_set_to_corba (GdkDragAction action) return retval; } +#if 0 static GdkDragAction convert_corba_drag_action_set_to_gdk (GNOME_Evolution_ShellComponentDnd_ActionSet action) { @@ -371,6 +359,7 @@ convert_corba_drag_action_set_to_gdk (GNOME_Evolution_ShellComponentDnd_ActionSe return retval; } +#endif static GNOME_Evolution_ShellComponentDnd_ActionSet @@ -666,6 +655,7 @@ folder_xfer_callback (EStorageSet *storage_set, /* FIXME: This should be moved somewhere else, so that also the shortcut code can share it. */ +#if 0 static void folder_context_menu_activate_cb (BonoboUIComponent *uih, void *data, @@ -701,6 +691,7 @@ folder_context_menu_remove_cb (BonoboUIComponent *uih, e_storage_set_async_remove_folder (priv->storage_set, priv->selected_row_path, remove_cb, storage_set_view); } +#endif static void popup_folder_menu (EStorageSetView *storage_set_view, @@ -1513,15 +1504,14 @@ new_storage_cb (EStorageSet *storage_set, path = g_strconcat (G_DIR_SEPARATOR_S, e_storage_get_name (storage), NULL); - node = e_tree_memory_node_insert_id (E_TREE_MEMORY(priv->etree_model), - priv->root_node, - -1, path, path); + node = e_tree_memory_node_insert (E_TREE_MEMORY(priv->etree_model), + priv->root_node, + -1, path); e_tree_memory_sort_node(E_TREE_MEMORY(priv->etree_model), priv->root_node, storage_sort_callback, storage_set_view); e_tree_node_set_expanded (E_TREE(storage_set), node, TRUE); if (! add_node_to_hash (storage_set_view, path, node)) { - g_free (path); e_tree_memory_node_remove (E_TREE_MEMORY(priv->etree_model), node); return; } @@ -1537,7 +1527,6 @@ removed_storage_cb (EStorageSet *storage_set, ETreeModel *etree; ETreePath node; char *path; - char *node_data; storage_set_view = E_STORAGE_SET_VIEW (data); priv = storage_set_view->priv; @@ -1547,8 +1536,7 @@ removed_storage_cb (EStorageSet *storage_set, node = remove_node_from_hash (storage_set_view, path); g_free (path); - node_data = e_tree_memory_node_remove (E_TREE_MEMORY(etree), node); - g_free (node_data); + e_tree_memory_node_remove (E_TREE_MEMORY(etree), node); } static void @@ -1585,7 +1573,7 @@ new_folder_cb (EStorageSet *storage_set, g_free (parent_path); copy_of_path = g_strdup (path); - new_node = e_tree_memory_node_insert_id (E_TREE_MEMORY(etree), parent_node, -1, copy_of_path, copy_of_path); + new_node = e_tree_memory_node_insert (E_TREE_MEMORY(etree), parent_node, -1, copy_of_path); e_tree_memory_sort_node(E_TREE_MEMORY(etree), parent_node, folder_sort_callback, storage_set_view); if (! add_node_to_hash (storage_set_view, path, new_node)) { @@ -1621,15 +1609,13 @@ removed_folder_cb (EStorageSet *storage_set, EStorageSetViewPrivate *priv; ETreeModel *etree; ETreePath node; - char *node_data; storage_set_view = E_STORAGE_SET_VIEW (data); priv = storage_set_view->priv; etree = priv->etree_model; node = remove_node_from_hash (storage_set_view, path); - node_data = e_tree_memory_node_remove (E_TREE_MEMORY(etree), node); - g_free (node_data); + e_tree_memory_node_remove (E_TREE_MEMORY(etree), node); } @@ -1797,7 +1783,7 @@ insert_folders (EStorageSetView *storage_set_view, folder_name = e_folder_get_name (folder); full_path = g_strconcat ("/", storage_name, folder_path, NULL); - node = e_tree_memory_node_insert_id (E_TREE_MEMORY(etree), parent, -1, (void *) full_path, full_path); + node = e_tree_memory_node_insert (E_TREE_MEMORY(etree), parent, -1, (void *) full_path); e_tree_memory_sort_node(E_TREE_MEMORY(etree), parent, folder_sort_callback, storage_set_view); add_node_to_hash (storage_set_view, full_path, node); @@ -1842,8 +1828,8 @@ insert_storages (EStorageSetView *storage_set_view) name = e_storage_get_name (storage); path = g_strconcat ("/", name, NULL); - parent = e_tree_memory_node_insert_id (E_TREE_MEMORY(priv->etree_model), priv->root_node, - -1, path, path); + parent = e_tree_memory_node_insert (E_TREE_MEMORY(priv->etree_model), priv->root_node, + -1, path); e_tree_memory_sort_node(E_TREE_MEMORY(priv->etree_model), priv->root_node, storage_sort_callback, storage_set_view); e_tree_node_set_expanded (E_TREE(storage_set_view), parent, TRUE); @@ -1895,7 +1881,9 @@ e_storage_set_view_construct (EStorageSetView *storage_set_view, storage_set_view); - priv->root_node = e_tree_memory_node_insert (E_TREE_MEMORY(priv->etree_model), NULL, -1, "/Root Node"); + e_tree_memory_set_node_destroy_func (E_TREE_MEMORY (priv->etree_model), (GFunc) g_free, NULL); + + priv->root_node = e_tree_memory_node_insert (E_TREE_MEMORY(priv->etree_model), NULL, -1, g_strdup ("/Root Node")); extras = e_table_extras_new (); cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); @@ -1903,8 +1891,8 @@ e_storage_set_view_construct (EStorageSetView *storage_set_view, e_table_extras_add_cell (extras, "render_tree", e_cell_tree_new (NULL, NULL, TRUE, cell)); - e_tree_construct (E_TREE (storage_set_view), priv->etree_model, extras, - ETREE_SPEC, NULL); + e_tree_construct_from_spec_file (E_TREE (storage_set_view), priv->etree_model, extras, + EVOLUTION_ETSPECDIR "/e-storage-set-view.etspec", NULL); e_tree_root_node_set_visible (E_TREE(storage_set_view), FALSE); @@ -2018,7 +2006,7 @@ e_storage_set_view_set_show_folders (EStorageSetView *storage_set_view, g_hash_table_foreach (priv->path_to_etree_node, path_free_func, NULL); /* now re-add the root node */ - priv->root_node = e_tree_memory_node_insert (E_TREE_MEMORY(priv->etree_model), NULL, -1, "/Root Node"); + priv->root_node = e_tree_memory_node_insert (E_TREE_MEMORY(priv->etree_model), NULL, -1, g_strdup ("/Root Node")); /* then reinsert the storages after setting the "show_folders" flag. insert_storages will call insert_folders if diff --git a/shell/e-storage-set-view.etspec b/shell/e-storage-set-view.etspec new file mode 100644 index 0000000000..5ee19975df --- /dev/null +++ b/shell/e-storage-set-view.etspec @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/shell/evolution-shell-component-client.c b/shell/evolution-shell-component-client.c index 02a2fc7400..7a7b44ccc8 100644 --- a/shell/evolution-shell-component-client.c +++ b/shell/evolution-shell-component-client.c @@ -38,6 +38,9 @@ #include "evolution-shell-component-client.h" +static void +free_ShellComponentListener_servant (PortableServer_Servant servant); + char *evolution_debug_log; -- cgit