aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-08-25 06:50:14 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-08-25 06:50:14 +0800
commitbebd05b36a996b31f001a592c700ea76a5726929 (patch)
tree73842d40d4d7c6e4abd60ec381ac9e8ef5c5cb28 /shell
parente00591f0081d57618d709e59f6d4a4d671fc2fb0 (diff)
downloadgsoc2013-evolution-bebd05b36a996b31f001a592c700ea76a5726929.tar.gz
gsoc2013-evolution-bebd05b36a996b31f001a592c700ea76a5726929.tar.zst
gsoc2013-evolution-bebd05b36a996b31f001a592c700ea76a5726929.zip
Change the `selected_row_path' to be non-const. (destroy): Free it.
* e-storage-set-view.c: Change the `selected_row_path' to be non-const. (destroy): Free it. (e_storage_set_view_set_current_folder): Set the selected_row_path to be this path. (tree_drag_begin): Free the selected_row_path and strdup() the value we assign. svn path=/trunk/; revision=12463
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog10
-rw-r--r--shell/e-storage-set-view.c16
2 files changed, 21 insertions, 5 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index ea482e762e..560fbd5db0 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,15 @@
2001-08-24 Ettore Perazzoli <ettore@ximian.com>
+ * e-storage-set-view.c: Change the `selected_row_path' to be
+ non-const.
+ (destroy): Free it.
+ (e_storage_set_view_set_current_folder): Set the selected_row_path
+ to be this path.
+ (tree_drag_begin): Free the selected_row_path and strdup() the
+ value we assign.
+
+2001-08-24 Ettore Perazzoli <ettore@ximian.com>
+
* e-shell-view.c (e_shell_view_remove_control_for_uri): Ooops.
Save the pointer to the control for use after the view struct is
freed.
diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c
index b94a8f98a6..928ebfaf9c 100644
--- a/shell/e-storage-set-view.c
+++ b/shell/e-storage-set-view.c
@@ -83,7 +83,7 @@ struct _EStorageSetViewPrivate {
GHashTable *type_name_to_pixbuf;
/* Path of the row selected by the latest "cursor_activated" signal. */
- const char *selected_row_path;
+ char *selected_row_path;
gboolean show_folders;
@@ -778,6 +778,8 @@ destroy (GtkObject *object)
if (priv->drag_corba_data != NULL)
CORBA_free (priv->drag_corba_data);
+ g_free (priv->selected_row_path);
+
g_free (priv);
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
@@ -887,7 +889,8 @@ tree_drag_begin (ETree *etree,
priv = storage_set_view->priv;
g_print ("%s -- %d\n", __FUNCTION__, row);
- priv->selected_row_path = e_tree_memory_node_get_data (E_TREE_MEMORY(priv->etree_model), path);
+ g_free (priv->selected_row_path);
+ priv->selected_row_path = g_strdup (e_tree_memory_node_get_data (E_TREE_MEMORY(priv->etree_model), path));
g_assert (priv->drag_corba_source_interface == CORBA_OBJECT_NIL);
@@ -1337,7 +1340,8 @@ cursor_activated (ETree *tree,
priv = storage_set_view->priv;
- priv->selected_row_path = e_tree_memory_node_get_data (E_TREE_MEMORY (priv->etree_model), path);
+ g_free (priv->selected_row_path);
+ priv->selected_row_path = g_strdup (e_tree_memory_node_get_data (E_TREE_MEMORY (priv->etree_model), path));
if (e_tree_model_node_depth (priv->etree_model, path) >= 2) {
/* it was a folder */
@@ -2021,13 +2025,15 @@ e_storage_set_view_set_current_folder (EStorageSetView *storage_set_view,
priv = storage_set_view->priv;
node = g_hash_table_lookup (priv->path_to_etree_node, path);
- if (node == NULL) {
+ if (node == NULL)
return;
- }
e_tree_show_node (E_TREE (storage_set_view), node);
e_tree_set_cursor (E_TREE (storage_set_view), node);
+ g_free (priv->selected_row_path);
+ priv->selected_row_path = g_strdup (path);
+
gtk_signal_emit (GTK_OBJECT (storage_set_view), signals[FOLDER_SELECTED], path);
}