Commit e91afc85 authored by Darin Adler's avatar Darin Adler

eel_signal_connect_while_alive -> g_object_add_weak_pointer.

	* components/throbber/nautilus-throbber.c:
	(nautilus_throbber_instance_init): eel_signal_connect_while_alive
	-> g_object_add_weak_pointer.
	(nautilus_throbber_finalize), (nautilus_throbber_class_init):
	Switch to finalize instead of destroy.

	* components/tree/nautilus-tree-expansion-state.c: Remove.
	* components/tree/nautilus-tree-expansion-state.h: Remove.
	* components/tree/nautilus-tree-node-private.h: Remove.
	* components/tree/nautilus-tree-node.c: Remove.
	* components/tree/nautilus-tree-node.h: Remove.

	* components/tree/nautilus-tree-model.h:
	* components/tree/nautilus-tree-model.c:
	Rewrite, based on Anders's first cut.

	* components/tree/nautilus-tree-view.h: Tweaks.
	* components/tree/nautilus-tree-view.c: (create_tree): Get rid of
	the header.
	(nautilus_tree_view_finalize), (nautilus_tree_view_class_init):
	Added a missing finalize so that we don't leak.

	* libnautilus-private/nautilus-directory.h:
	* libnautilus-private/nautilus-directory.c:
	(nautilus_directory_get_for_file): New.

	* libnautilus-private/nautilus-file.h:
	* libnautilus-private/nautilus-file.c:
	(finalize): Change to finalize from destroy.
	(nautilus_file_get_parent): Make public, simplify implementation
	by using nautilus_directory_get_corresponding_file.

	* src/file-manager/fm-desktop-icon-view.c:
	(fm_desktop_icon_view_init):
	* src/nautilus-sidebar.c: (nautilus_sidebar_update_buttons):
	* src/nautilus-view-frame.c: (nautilus_view_frame_init),
	(attach_view):
	* src/nautilus-window-menus.c:
	(nautilus_window_initialize_bookmarks_menu),
	(nautilus_window_initialize_go_menu):
	Use g_signal_connect-object instead of eel_signal_connect_while_alive.
parent 4285ceae
2002-02-06 Darin Adler <darin@bentspoon.com>
* components/throbber/nautilus-throbber.c:
(nautilus_throbber_instance_init): eel_signal_connect_while_alive
-> g_object_add_weak_pointer.
(nautilus_throbber_finalize), (nautilus_throbber_class_init):
Switch to finalize instead of destroy.
* components/tree/nautilus-tree-expansion-state.c: Remove.
* components/tree/nautilus-tree-expansion-state.h: Remove.
* components/tree/nautilus-tree-node-private.h: Remove.
* components/tree/nautilus-tree-node.c: Remove.
* components/tree/nautilus-tree-node.h: Remove.
* components/tree/nautilus-tree-model.h:
* components/tree/nautilus-tree-model.c:
Rewrite, based on Anders's first cut.
* components/tree/nautilus-tree-view.h: Tweaks.
* components/tree/nautilus-tree-view.c: (create_tree): Get rid of
the header.
(nautilus_tree_view_finalize), (nautilus_tree_view_class_init):
Added a missing finalize so that we don't leak.
* libnautilus-private/nautilus-directory.h:
* libnautilus-private/nautilus-directory.c:
(nautilus_directory_get_for_file): New.
* libnautilus-private/nautilus-file.h:
* libnautilus-private/nautilus-file.c:
(finalize): Change to finalize from destroy.
(nautilus_file_get_parent): Make public, simplify implementation
by using nautilus_directory_get_corresponding_file.
* src/file-manager/fm-desktop-icon-view.c:
(fm_desktop_icon_view_init):
* src/nautilus-sidebar.c: (nautilus_sidebar_update_buttons):
* src/nautilus-view-frame.c: (nautilus_view_frame_init),
(attach_view):
* src/nautilus-window-menus.c:
(nautilus_window_initialize_bookmarks_menu),
(nautilus_window_initialize_go_menu):
Use g_signal_connect-object instead of eel_signal_connect_while_alive.
2002-02-06 Dave Camp <dave@ximian.com>
* components/news/nautilus-news.c: Make this component build with
......
......@@ -29,7 +29,6 @@
#include "nautilus-throbber.h"
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gobject-extensions.h>
#include <eel/eel-graphic-effects.h>
#include <eel/eel-gtk-extensions.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
......@@ -156,29 +155,7 @@ set_bonobo_properties (BonoboPropertyBag *bag,
}
}
/* handle destroying the throbber */
static void
nautilus_throbber_destroy (GtkObject *object)
{
NautilusThrobber *throbber = NAUTILUS_THROBBER (object);
nautilus_throbber_remove_update_callback (throbber);
nautilus_throbber_unload_images (throbber);
eel_preferences_remove_callback (NAUTILUS_PREFERENCES_THEME,
nautilus_throbber_theme_changed,
object);
if (throbber->details->property_bag) {
bonobo_object_unref (BONOBO_OBJECT (throbber->details->property_bag));
}
g_free (throbber->details);
GNOME_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
BonoboObject*
BonoboObject *
nautilus_throbber_get_control (NautilusThrobber *throbber)
{
return throbber->details->control;
......@@ -220,14 +197,6 @@ get_throbber_dimensions (NautilusThrobber *throbber, int *throbber_width, int* t
*throbber_height = current_height;
}
static void
null_pointer_callback (GtkObject *object,
gpointer callback_data)
{
* (gpointer *) callback_data = NULL;
}
/* initialize the throbber */
static void
nautilus_throbber_instance_init (NautilusThrobber *throbber)
{
......@@ -256,11 +225,8 @@ nautilus_throbber_instance_init (NautilusThrobber *throbber)
/* make the bonobo control */
throbber->details->control = BONOBO_OBJECT (bonobo_control_new (widget));
eel_signal_connect_while_alive (G_OBJECT (throbber->details->control),
"destroy",
G_CALLBACK (null_pointer_callback),
&throbber->details->control,
G_OBJECT (throbber));
g_object_add_weak_pointer (G_OBJECT (throbber->details->control),
(gpointer *) &throbber->details->control);
/* attach a property bag with the configure property */
throbber->details->property_bag = bonobo_property_bag_new (get_bonobo_properties,
......@@ -679,12 +645,40 @@ nautilus_throbber_size_request (GtkWidget *widget, GtkRequisition *requisition)
}
static void
nautilus_throbber_class_init (NautilusThrobberClass *throbber_class)
nautilus_throbber_finalize (GObject *object)
{
NautilusThrobber *throbber;
throbber = NAUTILUS_THROBBER (object);
nautilus_throbber_remove_update_callback (throbber);
nautilus_throbber_unload_images (throbber);
eel_preferences_remove_callback (NAUTILUS_PREFERENCES_THEME,
nautilus_throbber_theme_changed, object);
if (throbber->details->property_bag != NULL) {
bonobo_object_unref (BONOBO_OBJECT (throbber->details->property_bag));
}
if (throbber->details->control != NULL) {
g_object_remove_weak_pointer (G_OBJECT (throbber->details->control),
(gpointer *) &throbber->details->control);
}
g_free (throbber->details);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
nautilus_throbber_class_init (NautilusThrobberClass *class)
{
GtkObjectClass *object_class = GTK_OBJECT_CLASS (throbber_class);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (throbber_class);
GtkWidgetClass *widget_class;
widget_class = GTK_WIDGET_CLASS (class);
object_class->destroy = nautilus_throbber_destroy;
G_OBJECT_CLASS (class)->finalize = nautilus_throbber_finalize;
widget_class->expose_event = nautilus_throbber_expose;
widget_class->button_press_event = nautilus_throbber_button_press_event;
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/*
* Copyright (C) 2000 Eazel, Inc
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Author: Maciej Stachowiak <mjs@eazel.com>
*/
/* nautilus-tree-expansion-state.c - class to track expansion state for the tree view */
#include <config.h>
#include "nautilus-tree-expansion-state.h"
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-string.h>
#include <libnautilus-private/nautilus-global-preferences.h>
struct NautilusTreeExpansionStateDetails {
GHashTable *table;
GHashTable *ever_expanded_table;
};
static void nautilus_tree_expansion_state_destroy (GtkObject *object);
static void nautilus_tree_expansion_state_init (gpointer object,
gpointer klass);
static void nautilus_tree_expansion_state_class_init (gpointer klass);
EEL_CLASS_BOILERPLATE (NautilusTreeExpansionState, nautilus_tree_expansion_state, GTK_TYPE_OBJECT)
static gboolean expansion_table_hash_remove_func (gpointer key,
gpointer value,
gpointer user_data);
static void nautilus_tree_expansion_state_expand_node_internal (NautilusTreeExpansionState *expansion_state,
const char *uri);
/* infrastructure stuff */
static void
nautilus_tree_expansion_state_class_init (gpointer klass)
{
GtkObjectClass *object_class;
object_class = GTK_OBJECT_CLASS (klass);
object_class->destroy = nautilus_tree_expansion_state_destroy;
}
/* Preference name for the list of expanded uris */
#define NAUTILUS_PREFERENCES_TREE_VIEW_EXPANSION_STATE "tree-sidebar-panel/expansion_state"
static void
expansion_state_load_callback (const char *uri,
gpointer callback_data)
{
g_return_if_fail (eel_strlen (uri) > 0);
g_return_if_fail (NAUTILUS_IS_TREE_EXPANSION_STATE (callback_data));
nautilus_tree_expansion_state_expand_node_internal
(callback_data, uri);
}
static void
nautilus_tree_expansion_state_load_from_preferences (NautilusTreeExpansionState *expansion_state)
{
EelStringList *uris;
uris = eel_preferences_get_string_list (NAUTILUS_PREFERENCES_TREE_VIEW_EXPANSION_STATE);
eel_string_list_for_each (uris, expansion_state_load_callback, expansion_state);
eel_string_list_free (uris);
}
static void
hash_table_get_keys_callback (gpointer key,
gpointer value,
gpointer user_data)
{
GList **keys;
keys = (GList **) user_data;
*keys = g_list_prepend (*keys, key);
}
static GList *
hash_table_get_keys (GHashTable *hash_table)
{
GList *keys;
keys = NULL;
g_hash_table_foreach (hash_table,
hash_table_get_keys_callback,
&keys);
return keys;
}
static void
nautilus_tree_expansion_state_save_to_preferences (NautilusTreeExpansionState *expansion_state)
{
GList *glist;
EelStringList *uris;
glist = hash_table_get_keys (expansion_state->details->table);
glist = eel_g_str_list_alphabetize (glist);
uris = eel_string_list_new_from_g_list (glist, TRUE);
eel_preferences_set_string_list (NAUTILUS_PREFERENCES_TREE_VIEW_EXPANSION_STATE, uris);
g_list_free (glist);
eel_string_list_free (uris);
}
static void
nautilus_tree_expansion_state_init (gpointer object, gpointer klass)
{
NautilusTreeExpansionState *expansion_state;
expansion_state = NAUTILUS_TREE_EXPANSION_STATE (object);
expansion_state->details = g_new0 (NautilusTreeExpansionStateDetails, 1);
expansion_state->details->table = g_hash_table_new (g_str_hash, g_str_equal);
expansion_state->details->ever_expanded_table = g_hash_table_new (g_str_hash, g_str_equal);
nautilus_tree_expansion_state_load_from_preferences (expansion_state);
}
static void
nautilus_tree_expansion_state_destroy (GtkObject *object)
{
NautilusTreeExpansionState *expansion_state;
expansion_state = (NautilusTreeExpansionState *) object;
g_hash_table_foreach_remove (expansion_state->details->table,
expansion_table_hash_remove_func,
NULL);
g_hash_table_destroy (expansion_state->details->table);
g_hash_table_foreach_remove (expansion_state->details->ever_expanded_table,
expansion_table_hash_remove_func,
NULL);
g_hash_table_destroy (expansion_state->details->ever_expanded_table);
g_free (expansion_state->details);
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
NautilusTreeExpansionState *
nautilus_tree_expansion_state_new (void)
{
NautilusTreeExpansionState *state;
state = NAUTILUS_TREE_EXPANSION_STATE (g_object_new (NAUTILUS_TYPE_TREE_EXPANSION_STATE, NULL));
g_object_ref (state);
gtk_object_sink (GTK_OBJECT (state));
return state;
}
gboolean
nautilus_tree_expansion_state_is_node_expanded (NautilusTreeExpansionState *expansion_state,
const char *uri)
{
return (g_hash_table_lookup (expansion_state->details->table,
uri) != NULL);
}
gboolean
nautilus_tree_expansion_state_was_ever_expanded (NautilusTreeExpansionState *expansion_state,
const char *uri)
{
return (g_hash_table_lookup (expansion_state->details->ever_expanded_table,
uri) != NULL);
}
static void
nautilus_tree_expansion_state_expand_node_internal (NautilusTreeExpansionState *expansion_state,
const char *uri)
{
gpointer orig_key;
gpointer value;
if (!g_hash_table_lookup_extended (expansion_state->details->table,
uri,
&orig_key,
&value)) {
g_hash_table_insert (expansion_state->details->table,
g_strdup (uri),
GINT_TO_POINTER (1));
}
}
void
nautilus_tree_expansion_state_expand_node (NautilusTreeExpansionState *expansion_state,
const char *uri)
{
gpointer orig_key;
gpointer value;
nautilus_tree_expansion_state_expand_node_internal (expansion_state,
uri);
if (!g_hash_table_lookup_extended (expansion_state->details->ever_expanded_table,
uri,
&orig_key,
&value)) {
g_hash_table_insert (expansion_state->details->ever_expanded_table,
g_strdup (uri),
GINT_TO_POINTER (1));
}
}
/* We only want to remember expanded nodes. */
void
nautilus_tree_expansion_state_collapse_node (NautilusTreeExpansionState *expansion_state,
const char *uri)
{
nautilus_tree_expansion_state_remove_node (expansion_state, uri);
}
void
nautilus_tree_expansion_state_remove_node (NautilusTreeExpansionState *expansion_state,
const char *uri)
{
gpointer orig_key;
gpointer value;
if (g_hash_table_lookup_extended (expansion_state->details->table,
uri,
&orig_key,
&value)) {
g_hash_table_remove (expansion_state->details->table,
uri);
g_free (orig_key);
}
}
void
nautilus_tree_expansion_state_save (NautilusTreeExpansionState *expansion_state)
{
nautilus_tree_expansion_state_save_to_preferences (expansion_state);
}
static gboolean
expansion_table_hash_remove_func (gpointer key,
gpointer value,
gpointer user_data)
{
g_free (key);
return TRUE;
}
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/*
* Copyright (C) 2000 Eazel, Inc
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Author: Maciej Stachowiak <mjs@eazel.com>
*/
/* nautilus-tree-expansion-state.h - Class to track what nodes are
expanded for the tree view */
#ifndef NAUTILUS_TREE_EXPANSION_STATE_H
#define NAUTILUS_TREE_EXPANSION_STATE_H
#include <gtk/gtkobject.h>
typedef struct NautilusTreeExpansionState NautilusTreeExpansionState;
typedef struct NautilusTreeExpansionStateClass NautilusTreeExpansionStateClass;
#define NAUTILUS_TYPE_TREE_EXPANSION_STATE (nautilus_tree_expansion_state_get_type ())
#define NAUTILUS_TREE_EXPANSION_STATE(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_TREE_EXPANSION_STATE, NautilusTreeExpansionState))
#define NAUTILUS_TREE_EXPANSION_STATE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_TREE_EXPANSION_STATE, NautilusTreeExpansionStateClass))
#define NAUTILUS_IS_TREE_EXPANSION_STATE(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_TREE_EXPANSION_STATE))
#define NAUTILUS_IS_TREE_EXPANSION_STATE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_TREE_EXPANSION_STATE))
typedef struct NautilusTreeExpansionStateDetails NautilusTreeExpansionStateDetails;
struct NautilusTreeExpansionState {
GtkObject parent;
NautilusTreeExpansionStateDetails *details;
};
struct NautilusTreeExpansionStateClass {
GtkObjectClass parent_class;
};
GtkType nautilus_tree_expansion_state_get_type (void);
NautilusTreeExpansionState *nautilus_tree_expansion_state_new (void);
gboolean nautilus_tree_expansion_state_is_node_expanded (NautilusTreeExpansionState *expansion_state,
const char *uri);
gboolean nautilus_tree_expansion_state_was_ever_expanded (NautilusTreeExpansionState *expansion_state,
const char *uri);
void nautilus_tree_expansion_state_expand_node (NautilusTreeExpansionState *expansion_state,
const char *uri);
void nautilus_tree_expansion_state_collapse_node (NautilusTreeExpansionState *expansion_state,
const char *uri);
void nautilus_tree_expansion_state_remove_node (NautilusTreeExpansionState *expansion_state,
const char *uri);
void nautilus_tree_expansion_state_save (NautilusTreeExpansionState *expansion_state);
#endif /* NAUTILUS_TREE_EXPANSION_STATE_H */
This diff is collapsed.
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/*
* Copyright (C) 2000 Eazel, Inc
* Copyright (C) 2002 Anders Carlsson
* Copyright (C) 2002 Bent Spoon Software
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
......@@ -18,7 +19,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Author: Maciej Stachowiak <mjs@eazel.com>
* Author: Anders Carlsson <andersca@gnu.org>
*/
/* nautilus-tree-model.h - Model for the tree view */
......@@ -26,10 +27,7 @@
#ifndef NAUTILUS_TREE_MODEL_H
#define NAUTILUS_TREE_MODEL_H
#include <gtk/gtkobject.h>
typedef struct NautilusTreeModel NautilusTreeModel;
typedef struct NautilusTreeModelClass NautilusTreeModelClass;
#include <glib-object.h>
#define NAUTILUS_TYPE_TREE_MODEL (nautilus_tree_model_get_type ())
#define NAUTILUS_TREE_MODEL(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_TREE_MODEL, NautilusTreeModel))
......@@ -40,26 +38,21 @@ typedef struct NautilusTreeModelClass NautilusTreeModelClass;
enum {
NAUTILUS_TREE_MODEL_DISPLAY_NAME_COLUMN,
NAUTILUS_TREE_MODEL_CLOSED_PIXBUF_COLUMN,
NAUTILUS_TREE_MODEL_NUM_COLUMNS,
NAUTILUS_TREE_MODEL_NUM_COLUMNS
};
typedef struct NautilusTreeModelDetails NautilusTreeModelDetails;
struct NautilusTreeModel {
typedef struct {
GObject parent;
NautilusTreeModelDetails *details;
};
} NautilusTreeModel;
struct NautilusTreeModelClass {
typedef struct {
GObjectClass parent_class;
};
GType nautilus_tree_model_get_type (void);
NautilusTreeModel *nautilus_tree_model_new (const char *root_uri);
} NautilusTreeModelClass;
/* Debugging */
void nautilus_tree_model_dump (NautilusTreeModel *model);
GType nautilus_tree_model_get_type (void);
NautilusTreeModel *nautilus_tree_model_new (const char *root_uri);
#endif /* NAUTILUS_TREE_MODEL_H */
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/*
* Copyright (C) 2000 Eazel, Inc
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Author: Maciej Stachowiak <mjs@eazel.com>
*/
/* nautilus-tree-node-private.h - Private header shared between tree
node and model. */
#ifndef NAUTILUS_TREE_NODE_PRIVATE_H
#define NAUTILUS_TREE_NODE_PRIVATE_H
#include "nautilus-tree-node.h"
struct NautilusTreeNodeDetails {
NautilusFile *file;
NautilusDirectory *directory;
char *uri;
guint files_added_id;
guint files_changed_id;
guint done_loading_id;
GList *monitor_clients;
NautilusTreeNode *parent;
GList *children;
gboolean is_toplevel;
};
NautilusTreeNode *nautilus_tree_node_new (NautilusFile *file);
void nautilus_tree_node_update_uri (NautilusTreeNode *node);
void nautilus_tree_node_set_parent (NautilusTreeNode *node,
NautilusTreeNode *parent);
void nautilus_tree_node_remove_from_parent (NautilusTreeNode *node);
void nautilus_tree_node_remove_children (NautilusTreeNode *node);
#endif /* NAUTILUS_TREE_NODE_PRIVATE_H */
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/*
* Copyright (C) 2000 Eazel, Inc
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Author: Maciej Stachowiak <mjs@eazel.com>
*/
/* nautilus-tree-model.c - model for the tree view */
#include <config.h>
#include "nautilus-tree-node.h"
#include "nautilus-tree-node-private.h"
#include <libnautilus-private/nautilus-directory.h>
#include <libnautilus-private/nautilus-file.h>
#include <eel/eel-gtk-macros.h>
static void nautilus_tree_node_destroy (GtkObject *object);
static void nautilus_tree_node_init (gpointer object,
gpointer klass);
static void nautilus_tree_node_class_init (gpointer klass);
EEL_CLASS_BOILERPLATE (NautilusTreeNode, nautilus_tree_node, GTK_TYPE_OBJECT)
static void
nautilus_tree_node_class_init (gpointer klass)
{
GtkObjectClass *object_class;
object_class = GTK_OBJECT_CLASS (klass);
object_class->destroy = nautilus_tree_node_destroy;
}
static void
nautilus_tree_node_init (gpointer object, gpointer klass)
{
NautilusTreeNode *node;
node = NAUTILUS_TREE_NODE (object);
node->details = g_new0 (NautilusTreeNodeDetails, 1);
}
static void
nautilus_tree_node_destroy (GtkObject *object)
{
NautilusTreeNode *node;
node = NAUTILUS_TREE_NODE (object);
if (node->details->children != NULL) {
g_warning ("Destroyed tree node still has children");
nautilus_tree_node_remove_children (node);
}
nautilus_directory_unref (node->details->directory);
nautilus_file_unref (node->details->file);
g_free (node->details->uri);
g_free (node->details);
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
NautilusTreeNode *
nautilus_tree_node_new (NautilusFile *file)
{