Commit 2cd5440e authored by Darin Adler's avatar Darin Adler
Browse files

Fixed bug bug 3264 (Tree view shows no branches for directories,

	...HACK... nodes visible), bug 3290 (changing directory or
	refreshing causes Gdk to assert), bug 2420 (Need to free original
	key when removing model node), and other assorted problems.

	* components/tree/nautilus-tree-view.c: (insert_hack_node),
	(remove_hack_node), (nautilus_tree_view_insert_model_node):
	Fix problem where the hash table key was neither g_strdup'd on the
	way in, nor g_free'd on the way out. This caused all the problems
	with bad nesting in the tree view.

	* nautilus-installer/src/installer.c: (create_pixmap):
	* src/file-manager/fm-list-view.c: (install_row_images):
	* src/nautilus-theme-selector.c: (add_theme):
	Added more checks for NULL before calling gdk_bitmap_unref.

	* src/file-manager/fm-directory-view.c: (no_items_showing):
	Fixed a NautilusDirectory ref. count leak.

	* libnautilus-extensions/nautilus-font-factory.c:
	(unref_global_font_factory), (nautilus_get_current_font_factory):
	Unref the font factory on exit.
	(nautilus_font_factory_initialize_class), (font_hash_node_free),
	(free_one_hash_node), (destroy): Added code to actually destroy
	the font factory.
	(unref_fixed_font), (nautilus_font_factory_get_fallback_font):
	Unref the fixed font on exit.
	* libnautilus-extensions/nautilus-volume-monitor.c:
	(unref_global_volume_monitor), (nautilus_volume_monitor_get):
	Unref the volume monitor on exit.
	* src/nautilus-signaller.c: (unref_global_signaller),
	(nautilus_signaller_get_current): Unref the signaller on exit.

	* src/nautilus-component-adapter-factory.c:
	(nautilus_component_adapter_factory_initialize): Replaced some
	strange FIXMEs with a simpler one.
	(nautilus_component_adapter_factory_destroy): Fix a CORBA object
	reference leak.
	(nautilus_component_adapter_factory_get): Did a ref/sink.

	* components/adapter/nautilus-adapter-control-embed-strategy.c:
	(nautilus_adapter_control_embed_strategy_new):
	* components/adapter/nautilus-adapter-embeddable-embed-strategy.c:
	(nautilus_adapter_embeddable_embed_strategy_new):
	* components/adapter/nautilus-adapter-file-load-strategy.c:
	(nautilus_adapter_file_load_strategy_new):
	* components/adapter/nautilus-adapter-progressive-load-strategy.c:
	(nautilus_adapter_progressive_load_strategy_new):
	* components/adapter/nautilus-adapter-stream-load-strategy.c:
	(nautilus_adapter_stream_load_strategy_new):
	* components/adapter/nautilus-adapter.c: (nautilus_adapter_new):
	* components/rpmview/nautilus-rpm-verify-window.c:
	(nautilus_rpm_verify_window_new):
	* components/services/install/lib/eazel-install-object.c:
	(eazel_install_new), (eazel_install_new_with_config):
	* components/services/time/service/trilobite-eazel-time-service.c:
	(trilobite_eazel_time_service_new):
	* components/services/trilobite/libtrilobite/trilobite-service-pass
	wordquery.c: (trilobite_passwordquery_new):
	* components/services/trilobite/libtrilobite/trilobite-service.c:
	(trilobite_service_new):
	* components/tree/nautilus-tree-expansion-state.c:
	(nautilus_tree_expansion_state_new):
	* components/tree/nautilus-tree-model.c: (nautilus_tree_model_new):
	* components/tree/nautilus-tree-node.c: (nautilus_tree_node_new):
	* cut-n-paste-code/widgets/e-paned/e-hpaned.c: (e_hpaned_new):
	* cut-n-paste-code/widgets/e-paned/e-vpaned.c: (e_vpaned_new):
	* libnautilus-extensions/bonobo-stream-vfs.c:
	(bonobo_stream_create):
	* libnautilus-extensions/nautilus-any-width-bin.c:
	(nautilus_any_width_bin_new):
	* libnautilus-extensions/nautilus-background.c:
	(nautilus_background_new):
	* libnautilus-extensions/nautilus-bookmark.c:
	(nautilus_bookmark_new_with_icon):
	* libnautilus-extensions/nautilus-caption-table.c:
	(nautilus_caption_table_new):
	* libnautilus-extensions/nautilus-caption.c:
	(nautilus_caption_new):
	* libnautilus-extensions/nautilus-directory.c:
	(nautilus_directory_new):
	* libnautilus-extensions/nautilus-druid-page-eazel.c:
	(nautilus_druid_page_eazel_new),
	(nautilus_druid_page_eazel_new_with_vals):
	* libnautilus-extensions/nautilus-druid.c: (nautilus_druid_new):
	* libnautilus-extensions/nautilus-entry.c: (nautilus_entry_new):
	* libnautilus-extensions/nautilus-file-operations-progress.c:
	(nautilus_file_operations_progress_new):
	* libnautilus-extensions/nautilus-file.c:
	(nautilus_file_new_from_name), (nautilus_file_new_from_info):
	* libnautilus-extensions/nautilus-font-picker.c:
	(nautilus_font_picker_new):
	* libnautilus-extensions/nautilus-horizontal-splitter.c:
	(nautilus_horizontal_splitter_new):
	* libnautilus-extensions/nautilus-icon-container.c:
	(nautilus_icon_container_new):
	* libnautilus-extensions/nautilus-icon-factory.c:
	(get_icon_factory):
	* libnautilus-extensions/nautilus-image.c: (nautilus_image_new):
	* libnautilus-extensions/nautilus-keep-last-vertical-box.c:
	(nautilus_keep_last_vertical_box_new):
	* libnautilus-extensions/nautilus-label.c: (nautilus_label_new):
	* libnautilus-extensions/nautilus-list-column-title.c:
	(nautilus_list_column_title_new):
	* libnautilus-extensions/nautilus-list.c:
	(nautilus_list_new_with_titles):
	* libnautilus-extensions/nautilus-password-dialog.c:
	(nautilus_password_dialog_new):
	* libnautilus-extensions/nautilus-preference.c:
	(nautilus_preference_new_from_type):
	* libnautilus-extensions/nautilus-preferences-box.c:
	(nautilus_preferences_box_new):
	* libnautilus-extensions/nautilus-preferences-dialog.c:
	(nautilus_preferences_dialog_new):
	* libnautilus-extensions/nautilus-preferences-group.c:
	(nautilus_preferences_group_new):
	* libnautilus-extensions/nautilus-preferences-item.c:
	(nautilus_preferences_item_new):
	* libnautilus-extensions/nautilus-preferences-pane.c:
	(nautilus_preferences_pane_new):
	* libnautilus-extensions/nautilus-radio-button-group.c:
	(nautilus_radio_button_group_new):
	* libnautilus-extensions/nautilus-scalable-font.c:
	(nautilus_scalable_font_new):
	* libnautilus-extensions/nautilus-string-picker.c:
	(nautilus_string_picker_new):
	* libnautilus-extensions/nautilus-text-caption.c:
	(nautilus_text_caption_new):
	* libnautilus-extensions/nautilus-undo-context.c:
	(nautilus_undo_context_new):
	* libnautilus-extensions/nautilus-undo-manager.c:
	(nautilus_undo_manager_new):
	* libnautilus-extensions/nautilus-user-level-manager.c:
	(user_level_manager_new):
	* libnautilus/nautilus-undo-transaction.c:
	(nautilus_undo_transaction_new):
	* libnautilus/nautilus-view.c:
	(nautilus_view_new_from_bonobo_control):
	* src/file-manager/nautilus-trash-monitor.c:
	(nautilus_trash_monitor_get):
	* src/nautilus-desktop-window.c: (nautilus_desktop_window_new):
	* src/nautilus-property-browser.c: (nautilus_property_browser_new):
	* src/nautilus-shell.c: (nautilus_shell_new):
	* src/nautilus-sidebar-tabs.c: (nautilus_sidebar_tabs_new):
	* src/nautilus-sidebar-title.c: (nautilus_sidebar_title_new):
	* src/nautilus-sidebar.c: (nautilus_sidebar_create_context_menu),
	(nautilus_sidebar_new):
	* src/nautilus-theme-selector.c: (nautilus_theme_selector_new):
	* src/nautilus-throbber.c: (nautilus_throbber_new):
	* src/nautilus-view-frame.c: (nautilus_view_frame_new):
	* src/nautilus-zoom-control.c: (nautilus_zoom_control_new):
	* src/nautilus-about.c: (nautilus_about_new):
	* src/nautilus-application.c: (nautilus_application_new),
	(nautilus_application_create_window):
	* src/nautilus-bookmark-list.c: (nautilus_bookmark_list_new):
	After Tim Janik explained that gtk_type_new is a low-level call to
	be avoided, changed most uses of gtk_type_new to gtk_object_new or
	gtk_widget_new. Also, after Owen and Havoc explained that you
	can't just ignore the floating bit, added ref/sink calls to the
	functions used to create objects where we don't use the floating
	scheme.

	* src/nautilus-zoom-control.c:
	(nautilus_zoom_control_button_press_event): Take advantage of the
	fact that the new menu is floating and don't bother with ref'ing.

	* libnautilus-extensions/nautilus-ctree.c:
	(nautilus_ctree_new_with_titles):
	Added a cast.

	* components/adapter/main.c: (adapter_factory_make_object):
	* components/hardware/main.c: (hardware_view_make_object):
	* components/services/install/lib/eazel-install-corba-callback.c:
	(eazel_install_callback_get_type), (eazel_install_callback_new):
	* libnautilus-extensions/nautilus-theme.c:
	(nautilus_theme_get_theme), (nautilus_theme_set_theme),
	(nautilus_theme_get_theme_data):
	Whitespace tweaks.
parent 38a59061
2000-09-25 Darin Adler <darin@eazel.com>
Fixed bug bug 3264 (Tree view shows no branches for directories,
...HACK... nodes visible), bug 3290 (changing directory or
refreshing causes Gdk to assert), bug 2420 (Need to free original
key when removing model node), and other assorted problems.
* components/tree/nautilus-tree-view.c: (insert_hack_node),
(remove_hack_node), (nautilus_tree_view_insert_model_node):
Fix problem where the hash table key was neither g_strdup'd on the
way in, nor g_free'd on the way out. This caused all the problems
with bad nesting in the tree view.
* nautilus-installer/src/installer.c: (create_pixmap):
* src/file-manager/fm-list-view.c: (install_row_images):
* src/nautilus-theme-selector.c: (add_theme):
Added more checks for NULL before calling gdk_bitmap_unref.
* src/file-manager/fm-directory-view.c: (no_items_showing):
Fixed a NautilusDirectory ref. count leak.
* libnautilus-extensions/nautilus-font-factory.c:
(unref_global_font_factory), (nautilus_get_current_font_factory):
Unref the font factory on exit.
(nautilus_font_factory_initialize_class), (font_hash_node_free),
(free_one_hash_node), (destroy): Added code to actually destroy
the font factory.
(unref_fixed_font), (nautilus_font_factory_get_fallback_font):
Unref the fixed font on exit.
* libnautilus-extensions/nautilus-volume-monitor.c:
(unref_global_volume_monitor), (nautilus_volume_monitor_get):
Unref the volume monitor on exit.
* src/nautilus-signaller.c: (unref_global_signaller),
(nautilus_signaller_get_current): Unref the signaller on exit.
* src/nautilus-component-adapter-factory.c:
(nautilus_component_adapter_factory_initialize): Replaced some
strange FIXMEs with a simpler one.
(nautilus_component_adapter_factory_destroy): Fix a CORBA object
reference leak.
(nautilus_component_adapter_factory_get): Did a ref/sink.
* components/adapter/nautilus-adapter-control-embed-strategy.c:
(nautilus_adapter_control_embed_strategy_new):
* components/adapter/nautilus-adapter-embeddable-embed-strategy.c:
(nautilus_adapter_embeddable_embed_strategy_new):
* components/adapter/nautilus-adapter-file-load-strategy.c:
(nautilus_adapter_file_load_strategy_new):
* components/adapter/nautilus-adapter-progressive-load-strategy.c:
(nautilus_adapter_progressive_load_strategy_new):
* components/adapter/nautilus-adapter-stream-load-strategy.c:
(nautilus_adapter_stream_load_strategy_new):
* components/adapter/nautilus-adapter.c: (nautilus_adapter_new):
* components/rpmview/nautilus-rpm-verify-window.c:
(nautilus_rpm_verify_window_new):
* components/services/install/lib/eazel-install-object.c:
(eazel_install_new), (eazel_install_new_with_config):
* components/services/time/service/trilobite-eazel-time-service.c:
(trilobite_eazel_time_service_new):
* components/services/trilobite/libtrilobite/trilobite-service-pass
wordquery.c: (trilobite_passwordquery_new):
* components/services/trilobite/libtrilobite/trilobite-service.c:
(trilobite_service_new):
* components/tree/nautilus-tree-expansion-state.c:
(nautilus_tree_expansion_state_new):
* components/tree/nautilus-tree-model.c: (nautilus_tree_model_new):
* components/tree/nautilus-tree-node.c: (nautilus_tree_node_new):
* cut-n-paste-code/widgets/e-paned/e-hpaned.c: (e_hpaned_new):
* cut-n-paste-code/widgets/e-paned/e-vpaned.c: (e_vpaned_new):
* libnautilus-extensions/bonobo-stream-vfs.c:
(bonobo_stream_create):
* libnautilus-extensions/nautilus-any-width-bin.c:
(nautilus_any_width_bin_new):
* libnautilus-extensions/nautilus-background.c:
(nautilus_background_new):
* libnautilus-extensions/nautilus-bookmark.c:
(nautilus_bookmark_new_with_icon):
* libnautilus-extensions/nautilus-caption-table.c:
(nautilus_caption_table_new):
* libnautilus-extensions/nautilus-caption.c:
(nautilus_caption_new):
* libnautilus-extensions/nautilus-directory.c:
(nautilus_directory_new):
* libnautilus-extensions/nautilus-druid-page-eazel.c:
(nautilus_druid_page_eazel_new),
(nautilus_druid_page_eazel_new_with_vals):
* libnautilus-extensions/nautilus-druid.c: (nautilus_druid_new):
* libnautilus-extensions/nautilus-entry.c: (nautilus_entry_new):
* libnautilus-extensions/nautilus-file-operations-progress.c:
(nautilus_file_operations_progress_new):
* libnautilus-extensions/nautilus-file.c:
(nautilus_file_new_from_name), (nautilus_file_new_from_info):
* libnautilus-extensions/nautilus-font-picker.c:
(nautilus_font_picker_new):
* libnautilus-extensions/nautilus-horizontal-splitter.c:
(nautilus_horizontal_splitter_new):
* libnautilus-extensions/nautilus-icon-container.c:
(nautilus_icon_container_new):
* libnautilus-extensions/nautilus-icon-factory.c:
(get_icon_factory):
* libnautilus-extensions/nautilus-image.c: (nautilus_image_new):
* libnautilus-extensions/nautilus-keep-last-vertical-box.c:
(nautilus_keep_last_vertical_box_new):
* libnautilus-extensions/nautilus-label.c: (nautilus_label_new):
* libnautilus-extensions/nautilus-list-column-title.c:
(nautilus_list_column_title_new):
* libnautilus-extensions/nautilus-list.c:
(nautilus_list_new_with_titles):
* libnautilus-extensions/nautilus-password-dialog.c:
(nautilus_password_dialog_new):
* libnautilus-extensions/nautilus-preference.c:
(nautilus_preference_new_from_type):
* libnautilus-extensions/nautilus-preferences-box.c:
(nautilus_preferences_box_new):
* libnautilus-extensions/nautilus-preferences-dialog.c:
(nautilus_preferences_dialog_new):
* libnautilus-extensions/nautilus-preferences-group.c:
(nautilus_preferences_group_new):
* libnautilus-extensions/nautilus-preferences-item.c:
(nautilus_preferences_item_new):
* libnautilus-extensions/nautilus-preferences-pane.c:
(nautilus_preferences_pane_new):
* libnautilus-extensions/nautilus-radio-button-group.c:
(nautilus_radio_button_group_new):
* libnautilus-extensions/nautilus-scalable-font.c:
(nautilus_scalable_font_new):
* libnautilus-extensions/nautilus-string-picker.c:
(nautilus_string_picker_new):
* libnautilus-extensions/nautilus-text-caption.c:
(nautilus_text_caption_new):
* libnautilus-extensions/nautilus-undo-context.c:
(nautilus_undo_context_new):
* libnautilus-extensions/nautilus-undo-manager.c:
(nautilus_undo_manager_new):
* libnautilus-extensions/nautilus-user-level-manager.c:
(user_level_manager_new):
* libnautilus/nautilus-undo-transaction.c:
(nautilus_undo_transaction_new):
* libnautilus/nautilus-view.c:
(nautilus_view_new_from_bonobo_control):
* src/file-manager/nautilus-trash-monitor.c:
(nautilus_trash_monitor_get):
* src/nautilus-desktop-window.c: (nautilus_desktop_window_new):
* src/nautilus-property-browser.c: (nautilus_property_browser_new):
* src/nautilus-shell.c: (nautilus_shell_new):
* src/nautilus-sidebar-tabs.c: (nautilus_sidebar_tabs_new):
* src/nautilus-sidebar-title.c: (nautilus_sidebar_title_new):
* src/nautilus-sidebar.c: (nautilus_sidebar_create_context_menu),
(nautilus_sidebar_new):
* src/nautilus-theme-selector.c: (nautilus_theme_selector_new):
* src/nautilus-throbber.c: (nautilus_throbber_new):
* src/nautilus-view-frame.c: (nautilus_view_frame_new):
* src/nautilus-zoom-control.c: (nautilus_zoom_control_new):
* src/nautilus-about.c: (nautilus_about_new):
* src/nautilus-application.c: (nautilus_application_new),
(nautilus_application_create_window):
* src/nautilus-bookmark-list.c: (nautilus_bookmark_list_new):
After Tim Janik explained that gtk_type_new is a low-level call to
be avoided, changed most uses of gtk_type_new to gtk_object_new or
gtk_widget_new. Also, after Owen and Havoc explained that you
can't just ignore the floating bit, added ref/sink calls to the
functions used to create objects where we don't use the floating
scheme.
* src/nautilus-zoom-control.c:
(nautilus_zoom_control_button_press_event): Take advantage of the
fact that the new menu is floating and don't bother with ref'ing.
* libnautilus-extensions/nautilus-ctree.c:
(nautilus_ctree_new_with_titles):
Added a cast.
* components/adapter/main.c: (adapter_factory_make_object):
* components/hardware/main.c: (hardware_view_make_object):
* components/services/install/lib/eazel-install-corba-callback.c:
(eazel_install_callback_get_type), (eazel_install_callback_new):
* libnautilus-extensions/nautilus-theme.c:
(nautilus_theme_get_theme), (nautilus_theme_set_theme),
(nautilus_theme_get_theme_data):
Whitespace tweaks.
2000-09-25 Andy Hertzfeld <andy@eazel.com>
* libnautilus-extensions/nautilus-icon-canvas-item.c:
......
......@@ -346,7 +346,7 @@ bonobo_stream_create (GnomeVFSHandle *fd)
Bonobo_Stream corba_stream;
CORBA_Environment ev;
stream_vfs = gtk_type_new (bonobo_stream_vfs_get_type ());
stream_vfs = BONOBO_STREAM_VFS (gtk_object_new (bonobo_stream_vfs_get_type (), NULL));
stream_vfs->fd = fd;
......
......@@ -39,8 +39,6 @@
#include <libgnomevfs/gnome-vfs-init.h>
#define META_FACTORY_IID "OAFIID:nautilus_adapter_factory_generic_factory:8e62e106-807d-4d37-b14a-00dc82ecf88f"
#define FACTORY_OBJECT_IID "OAFIID:nautilus_adapter_factory:fd24ecfc-0a6e-47ab-bc53-69d7487c6ad4"
static int object_count = 0;
......@@ -81,7 +79,6 @@ adapter_factory_make_object (BonoboGenericFactory *factory,
*/
adapter = NAUTILUS_ADAPTER_FACTORY_SERVER (gtk_object_new (NAUTILUS_TYPE_ADAPTER_FACTORY_SERVER, NULL));
/* Connect a handler that will get us out of the main loop
* when there are no more objects outstanding.
*/
......
......@@ -119,7 +119,9 @@ nautilus_adapter_control_embed_strategy_new (Bonobo_Control control,
{
NautilusAdapterControlEmbedStrategy *strategy;
strategy = NAUTILUS_ADAPTER_CONTROL_EMBED_STRATEGY (gtk_type_new (NAUTILUS_TYPE_ADAPTER_CONTROL_EMBED_STRATEGY));
strategy = NAUTILUS_ADAPTER_CONTROL_EMBED_STRATEGY (gtk_object_new (NAUTILUS_TYPE_ADAPTER_CONTROL_EMBED_STRATEGY, NULL));
gtk_object_ref (GTK_OBJECT (strategy));
gtk_object_sink (GTK_OBJECT (strategy));
strategy->details->control = control;
strategy->details->control_frame = bonobo_control_frame_new(uih);
......
......@@ -124,7 +124,9 @@ nautilus_adapter_embeddable_embed_strategy_new (Bonobo_Embeddable embeddable,
{
NautilusAdapterEmbeddableEmbedStrategy *strategy;
strategy = NAUTILUS_ADAPTER_EMBEDDABLE_EMBED_STRATEGY (gtk_type_new (NAUTILUS_TYPE_ADAPTER_EMBEDDABLE_EMBED_STRATEGY));
strategy = NAUTILUS_ADAPTER_EMBEDDABLE_EMBED_STRATEGY (gtk_object_new (NAUTILUS_TYPE_ADAPTER_EMBEDDABLE_EMBED_STRATEGY, NULL));
gtk_object_ref (GTK_OBJECT (strategy));
gtk_object_sink (GTK_OBJECT (strategy));
strategy->details->embeddable_wrapper = bonobo_object_client_from_corba (embeddable);
......
......@@ -124,7 +124,9 @@ nautilus_adapter_embeddable_embed_strategy_new (Bonobo_Embeddable embeddable,
{
NautilusAdapterEmbeddableEmbedStrategy *strategy;
strategy = NAUTILUS_ADAPTER_EMBEDDABLE_EMBED_STRATEGY (gtk_type_new (NAUTILUS_TYPE_ADAPTER_EMBEDDABLE_EMBED_STRATEGY));
strategy = NAUTILUS_ADAPTER_EMBEDDABLE_EMBED_STRATEGY (gtk_object_new (NAUTILUS_TYPE_ADAPTER_EMBEDDABLE_EMBED_STRATEGY, NULL));
gtk_object_ref (GTK_OBJECT (strategy));
gtk_object_sink (GTK_OBJECT (strategy));
strategy->details->embeddable_wrapper = bonobo_object_client_from_corba (embeddable);
......
......@@ -107,7 +107,9 @@ nautilus_adapter_file_load_strategy_new (Bonobo_PersistFile persist_file,
{
NautilusAdapterFileLoadStrategy *strategy;
strategy = NAUTILUS_ADAPTER_FILE_LOAD_STRATEGY (gtk_type_new (NAUTILUS_TYPE_ADAPTER_FILE_LOAD_STRATEGY));
strategy = NAUTILUS_ADAPTER_FILE_LOAD_STRATEGY (gtk_object_new (NAUTILUS_TYPE_ADAPTER_FILE_LOAD_STRATEGY, NULL));
gtk_object_ref (GTK_OBJECT (strategy));
gtk_object_sink (GTK_OBJECT (strategy));
strategy->details->persist_file = persist_file;
strategy->details->nautilus_view = view;
......
......@@ -108,7 +108,9 @@ nautilus_adapter_progressive_load_strategy_new (Bonobo_ProgressiveDataSink prog
{
NautilusAdapterProgressiveLoadStrategy *strategy;
strategy = NAUTILUS_ADAPTER_PROGRESSIVE_LOAD_STRATEGY (gtk_type_new (NAUTILUS_TYPE_ADAPTER_PROGRESSIVE_LOAD_STRATEGY));
strategy = NAUTILUS_ADAPTER_PROGRESSIVE_LOAD_STRATEGY (gtk_object_new (NAUTILUS_TYPE_ADAPTER_PROGRESSIVE_LOAD_STRATEGY, NULL));
gtk_object_ref (GTK_OBJECT (strategy));
gtk_object_sink (GTK_OBJECT (strategy));
strategy->details->progressive_data_sink = progressive_data_sink;
strategy->details->nautilus_view = view;
......
......@@ -104,7 +104,9 @@ nautilus_adapter_stream_load_strategy_new (Bonobo_PersistStream persist_stream,
{
NautilusAdapterStreamLoadStrategy *strategy;
strategy = NAUTILUS_ADAPTER_STREAM_LOAD_STRATEGY (gtk_type_new (NAUTILUS_TYPE_ADAPTER_STREAM_LOAD_STRATEGY));
strategy = NAUTILUS_ADAPTER_STREAM_LOAD_STRATEGY (gtk_object_new (NAUTILUS_TYPE_ADAPTER_STREAM_LOAD_STRATEGY, NULL));
gtk_object_ref (GTK_OBJECT (strategy));
gtk_object_sink (GTK_OBJECT (strategy));
strategy->details->persist_stream = persist_stream;
strategy->details->nautilus_view = view;
......
......@@ -135,7 +135,7 @@ nautilus_adapter_new (Bonobo_Unknown component)
CORBA_exception_init (&ev);
adapter = NAUTILUS_ADAPTER (gtk_type_new (NAUTILUS_TYPE_ADAPTER));
adapter = NAUTILUS_ADAPTER (gtk_object_new (NAUTILUS_TYPE_ADAPTER, NULL));
/* Set up a few wrapper framework details */
......
......@@ -44,8 +44,8 @@ hardware_view_object_destroyed(GtkObject *obj)
static BonoboObject *
hardware_view_make_object (BonoboGenericFactory *factory,
const char *goad_id,
void *closure)
const char *goad_id,
void *closure)
{
NautilusHardwareView *hardware_view;
......
......@@ -170,13 +170,13 @@ nautilus_rpm_verify_window_initialize (NautilusRPMVerifyWindow *rpm_verify_windo
}
/* allocate a new rpm_verify_window dialog */
GtkWidget*
GtkWidget *
nautilus_rpm_verify_window_new (const char *package_name)
{
char *title_string;
NautilusRPMVerifyWindow *rpm_verify_window;
rpm_verify_window = gtk_type_new (nautilus_rpm_verify_window_get_type ());
rpm_verify_window = NAUTILUS_RPM_VERIFY_WINDOW (gtk_widget_new (nautilus_rpm_verify_window_get_type (), NULL));
/* set up the window title */
title_string = g_strdup_printf (_("Verifying %s..."), package_name);
......
......@@ -468,7 +468,8 @@ eazel_install_callback_initialize (EazelInstallCallback *service) {
}
GtkType
eazel_install_callback_get_type() {
eazel_install_callback_get_type (void)
{
static GtkType service_type = 0;
/* g_message ("into eazel_install_callback_get_type"); */
......@@ -494,8 +495,8 @@ eazel_install_callback_get_type() {
return service_type;
}
EazelInstallCallback*
eazel_install_callback_new()
EazelInstallCallback *
eazel_install_callback_new (void)
{
EazelInstallCallback *service;
......
......@@ -610,17 +610,19 @@ eazel_install_get_type() {
return service_type;
}
EazelInstall*
eazel_install_new()
EazelInstall *
eazel_install_new (void)
{
EazelInstall *service;
service = EAZEL_INSTALL (gtk_object_new (TYPE_EAZEL_INSTALL, NULL));
gtk_object_ref (GTK_OBJECT (service));
gtk_object_sink (GTK_OBJECT (service));
return service;
}
EazelInstall*
EazelInstall *
eazel_install_new_with_config (void)
{
EazelInstall *service;
......@@ -653,6 +655,8 @@ eazel_install_new_with_config (void)
"server_port", topts->port_number,
"cgi_path", topts->cgi_path,
NULL));
gtk_object_ref (GTK_OBJECT (service));
gtk_object_sink (GTK_OBJECT (service));
transferoptions_destroy (topts);
installoptions_destroy (iopts);
......
......@@ -375,14 +375,16 @@ trilobite_eazel_time_service_get_type() {
The _new method simply builds the service
using gtk_object_new
*/
TrilobiteEazelTimeService*
trilobite_eazel_time_service_new()
TrilobiteEazelTimeService *
trilobite_eazel_time_service_new (void)
{
TrilobiteEazelTimeService *service;
/* g_message ("in trilobite_eazel_time_service_new"); */
service = TRILOBITE_EAZEL_TIME_SERVICE (gtk_object_new (TRILOBITE_TYPE_EAZEL_TIME_SERVICE, NULL));
gtk_object_ref (GTK_OBJECT (service));
gtk_object_sink (GTK_OBJECT (service));
return service;
}
......
......@@ -282,14 +282,14 @@ trilobite_passwordquery_get_type (void)
return trilobite_passwordquery_type;
}
TrilobitePasswordQuery*
trilobite_passwordquery_new()
TrilobitePasswordQuery *
trilobite_passwordquery_new (void)
{
TrilobitePasswordQuery *trilobite;
/* g_message ("in trilobite_passwordquery_new"); */
trilobite = TRILOBITE_PASSWORDQUERY (gtk_type_new (TRILOBITE_TYPE_PASSWORDQUERY));
trilobite = TRILOBITE_PASSWORDQUERY (gtk_object_new (TRILOBITE_TYPE_PASSWORDQUERY, NULL));
if (trilobite == NULL) {
g_warning ("Could not create a TrilobitePasswordQuery*");
......
......@@ -475,7 +475,7 @@ trilobite_service_new()
/* g_message ("in trilobite_service_new"); */
trilobite = TRILOBITE_SERVICE (gtk_type_new (TRILOBITE_TYPE_SERVICE));
trilobite = TRILOBITE_SERVICE (gtk_object_new (TRILOBITE_TYPE_SERVICE, NULL));
if (trilobite == NULL) {
g_warning ("Could not create a TrilobiteService*");
......
......@@ -162,9 +162,14 @@ nautilus_tree_expansion_state_destroy (GtkObject *object)
NautilusTreeExpansionState *
nautilus_tree_expansion_state_new ()
nautilus_tree_expansion_state_new (void)
{
return NAUTILUS_TREE_EXPANSION_STATE (gtk_type_new (NAUTILUS_TYPE_TREE_EXPANSION_STATE));
NautilusTreeExpansionState *state;
state = NAUTILUS_TREE_EXPANSION_STATE (gtk_object_new (NAUTILUS_TYPE_TREE_EXPANSION_STATE, NULL));
gtk_object_ref (GTK_OBJECT (state));
gtk_object_sink (GTK_OBJECT (state));
return state;
}
......
......@@ -177,7 +177,9 @@ nautilus_tree_model_new (const char *root_uri)
{
NautilusTreeModel *model;
model = NAUTILUS_TREE_MODEL (gtk_type_new (NAUTILUS_TYPE_TREE_MODEL));
model = NAUTILUS_TREE_MODEL (gtk_object_new (NAUTILUS_TYPE_TREE_MODEL, NULL));
gtk_object_ref (GTK_OBJECT (model));
gtk_object_sink (GTK_OBJECT (model));
nautilus_tree_model_set_root_uri (model, root_uri);
......
......@@ -90,7 +90,9 @@ nautilus_tree_node_new (NautilusFile *file)
{
NautilusTreeNode *node;
node = NAUTILUS_TREE_NODE (gtk_type_new (NAUTILUS_TYPE_TREE_NODE));
node = NAUTILUS_TREE_NODE (gtk_object_new (NAUTILUS_TYPE_TREE_NODE, NULL));
gtk_object_ref (GTK_OBJECT (node));
gtk_object_sink (GTK_OBJECT (node));
node->details = g_new0 (NautilusTreeNodeDetails, 1);
node->details->file = nautilus_file_ref (file);
......
......@@ -359,8 +359,9 @@ insert_hack_node (NautilusTreeView *view, const char *uri)
FALSE,
FALSE);
g_assert (g_hash_table_lookup (view->details->uri_to_hack_node_map, uri) == NULL);
g_hash_table_insert (view->details->uri_to_hack_node_map,
(char *) uri, hack_node);
g_strdup (uri), hack_node);
}
}
......@@ -368,21 +369,24 @@ insert_hack_node (NautilusTreeView *view, const char *uri)
static void
remove_hack_node (NautilusTreeView *view, const char *uri)
{
gpointer key, value;
NautilusCTreeNode *hack_node;
#ifdef DEBUG_TREE
printf ("XXX: removing hack node for %s\n", uri);
#endif
hack_node = g_hash_table_lookup (view->details->uri_to_hack_node_map, uri);
if (hack_node != NULL) {
nautilus_ctree_remove_node (NAUTILUS_CTREE (view->details->tree),
hack_node);
if (g_hash_table_lookup_extended (view->details->uri_to_hack_node_map,
uri, &key, &value)) {
hack_node = value;
nautilus_ctree_remove_node (NAUTILUS_CTREE (view->details->tree),
hack_node);
g_hash_table_remove (view->details->uri_to_hack_node_map, uri);
g_free (key);
gtk_clist_thaw (GTK_CLIST (view->details->tree));
#ifdef DEBUG_TREE
printf ("XXX: actually thawing (%d)\n", GTK_CLIST (view->details->tree)->freeze_count);
#endif
......@@ -472,7 +476,8 @@ nautilus_tree_view_insert_model_node (NautilusTreeView *view, NautilusTreeNode *
view_node,
node);
g_hash_table_insert (view->details->uri_to_node_map, uri, view_node);
g_assert (g_hash_table_lookup (view->details->uri_to_node_map, uri) == NULL);
g_hash_table_insert (view->details->uri_to_node_map, g_strdup (uri), view_node);
if (nautilus_file_is_directory (file)) {
/* Gratuitous hack so node can be expandable w/o
......@@ -501,21 +506,22 @@ nautilus_tree_view_insert_model_node (NautilusTreeView *view, NautilusTreeNode *
static void
nautilus_tree_view_remove_model_node (NautilusTreeView *view, NautilusTreeNode *node)
{
NautilusCTreeNode *view_node;
char *uri;
gpointer key, value;
NautilusCTreeNode *view_node;
nautilus_tree_model_stop_monitoring_node (view->details->model, node, view);
uri = nautilus_tree_node_get_uri (node);
view_node = model_node_to_view_node (view, node);
if (view_node != NULL) {
if (g_hash_table_lookup_extended (view->details->uri_to_node_map,
uri, &key, &value)) {
view_node = value;
nautilus_ctree_remove_node (NAUTILUS_CTREE (view->details->tree),
view_node);
/* FIXME bugzilla.eazel.com 2420: free the original key */
g_hash_table_remove (view->details->uri_to_node_map, uri);
view_node);
g_hash_table_remove (view->details->uri_to_node_map, uri);
g_free (key);
}
nautilus_tree_expansion_state_remove_node (view->details->expansion_state,
......
......@@ -111,11 +111,7 @@ e_hpaned_init (EHPaned *hpaned)
GtkWidget *
e_hpaned_new (void)
{
EHPaned *hpaned;
hpaned = gtk_type_new (E_TYPE_HPANED);
return GTK_WIDGET (hpaned);
return gtk_widget_new (E_TYPE_HPANED, NULL);
}