diff options
author | Darin Adler <darin@src.gnome.org> | 2002-01-25 00:53:00 +0000 |
---|---|---|
committer | Darin Adler <darin@src.gnome.org> | 2002-01-25 00:53:00 +0000 |
commit | cae57667952819daaf1e6b5ad67b83f255a0b84b (patch) | |
tree | 98dbd7b513fffc5f8b8e6abf5ac62bd697a45643 | |
parent | 5db444dcb41a76284531525d6d414955c2a0232d (diff) | |
download | nautilus-cae57667952819daaf1e6b5ad67b83f255a0b84b.tar.gz |
GNOME2_CONVERSION_COMPLETE eradication campaign
* libnautilus-private/nautilus-icon-factory.c: (cache_icon_new):
No last_unref_handler any more.
(cache_icon_unref): Just keep one ref for the factory, just like
in the old days, since we don't have a "last_unref_handler" any
more.
(nautilus_icon_factory_possibly_free_cached_icon): Look at
ref_count rather than looking at "outstanding" flag.
(nautilus_icon_factory_get_pixbuf_for_icon): Just ref, no fancy
"oustanding" logic.
(embed_text): Rewrite to use Pango.
* src/file-manager/fm-list-model.h: Tweak formatting and order.
* src/file-manager/fm-list-model.c: Tweak formatting and order.
* src/file-manager/fm-list-view.h: Tweak formatting and order.
* src/file-manager/fm-list-view.c: Tweak formatting and order.
* src/file-manager/fm-properties-window.c:
(select_image_button_callback): Turn this code back on.
* src/nautilus-bookmarks-window.c: (on_row_move): Remove puts.
* src/nautilus-complex-search-bar.c:
(nautilus_complex_search_bar_queue_resize): GnomeDock -> BonoboDock.
* src/nautilus-property-browser.c: (nautilus_emblem_dialog_new):
Finish porting to GtkDialog.
(nautilus_color_selection_dialog_new): Finish porting to
GtkDialog.
(add_new_pattern): Re-enable some code.
(labeled_image_configure): Re-enable some code, take out other stuff.
(labeled_image_new): Take out some dead code.
(property_browser_category_button_new): Take out some dead code.
* src/nautilus-sidebar-tabs.c: (tab_item_destroy),
(tab_indicator_changed_callback),
(nautilus_sidebar_tabs_connect_view):
Use a listener object now, not a listener ID.
* src/nautilus-simple-search-bar.c:
(nautilus_simple_search_bar_class_init): Remove some undo code.
* src/nautilus-switchable-navigation-bar.c:
(nautilus_switchable_navigation_bar_set_mode): GnomeDock -> BonoboDock.
* src/nautilus-switchable-search-bar.c:
(nautilus_switchable_search_bar_set_mode): GnomeDock -> BonoboDock.
* src/nautilus-view-frame.c: (destroy_view): Make deregister code use
the BonoboUIEngine instead of the BonoboWindow.
-rw-r--r-- | ChangeLog | 54 | ||||
-rw-r--r-- | libnautilus-private/nautilus-icon-factory.c | 105 | ||||
-rw-r--r-- | src/file-manager/fm-list-model.c | 238 | ||||
-rw-r--r-- | src/file-manager/fm-list-model.h | 42 | ||||
-rw-r--r-- | src/file-manager/fm-list-view.c | 60 | ||||
-rw-r--r-- | src/file-manager/fm-list-view.h | 13 | ||||
-rw-r--r-- | src/file-manager/fm-properties-window.c | 10 | ||||
-rw-r--r-- | src/nautilus-bookmarks-window.c | 1 | ||||
-rw-r--r-- | src/nautilus-complex-search-bar.c | 7 | ||||
-rw-r--r-- | src/nautilus-property-browser.c | 42 | ||||
-rw-r--r-- | src/nautilus-sidebar-tabs.c | 36 | ||||
-rw-r--r-- | src/nautilus-simple-search-bar.c | 26 | ||||
-rw-r--r-- | src/nautilus-switchable-navigation-bar.c | 11 | ||||
-rw-r--r-- | src/nautilus-switchable-search-bar.c | 7 | ||||
-rw-r--r-- | src/nautilus-view-frame.c | 8 |
15 files changed, 269 insertions, 391 deletions
@@ -2,6 +2,60 @@ GNOME2_CONVERSION_COMPLETE eradication campaign + * libnautilus-private/nautilus-icon-factory.c: (cache_icon_new): + No last_unref_handler any more. + (cache_icon_unref): Just keep one ref for the factory, just like + in the old days, since we don't have a "last_unref_handler" any + more. + (nautilus_icon_factory_possibly_free_cached_icon): Look at + ref_count rather than looking at "outstanding" flag. + (nautilus_icon_factory_get_pixbuf_for_icon): Just ref, no fancy + "oustanding" logic. + (embed_text): Rewrite to use Pango. + + * src/file-manager/fm-list-model.h: Tweak formatting and order. + * src/file-manager/fm-list-model.c: Tweak formatting and order. + * src/file-manager/fm-list-view.h: Tweak formatting and order. + * src/file-manager/fm-list-view.c: Tweak formatting and order. + + * src/file-manager/fm-properties-window.c: + (select_image_button_callback): Turn this code back on. + + * src/nautilus-bookmarks-window.c: (on_row_move): Remove puts. + + * src/nautilus-complex-search-bar.c: + (nautilus_complex_search_bar_queue_resize): GnomeDock -> BonoboDock. + + * src/nautilus-property-browser.c: (nautilus_emblem_dialog_new): + Finish porting to GtkDialog. + (nautilus_color_selection_dialog_new): Finish porting to + GtkDialog. + (add_new_pattern): Re-enable some code. + (labeled_image_configure): Re-enable some code, take out other stuff. + (labeled_image_new): Take out some dead code. + (property_browser_category_button_new): Take out some dead code. + + * src/nautilus-sidebar-tabs.c: (tab_item_destroy), + (tab_indicator_changed_callback), + (nautilus_sidebar_tabs_connect_view): + Use a listener object now, not a listener ID. + + * src/nautilus-simple-search-bar.c: + (nautilus_simple_search_bar_class_init): Remove some undo code. + + * src/nautilus-switchable-navigation-bar.c: + (nautilus_switchable_navigation_bar_set_mode): GnomeDock -> BonoboDock. + + * src/nautilus-switchable-search-bar.c: + (nautilus_switchable_search_bar_set_mode): GnomeDock -> BonoboDock. + + * src/nautilus-view-frame.c: (destroy_view): Make deregister code use + the BonoboUIEngine instead of the BonoboWindow. + +2002-01-24 Darin Adler <darin@bentspoon.com> + + GNOME2_CONVERSION_COMPLETE eradication campaign + * components/hardware/nautilus-hardware-view.c: (nautilus_hardware_view_init): Re-enable the property bag. diff --git a/libnautilus-private/nautilus-icon-factory.c b/libnautilus-private/nautilus-icon-factory.c index 04b80f9c8..c723cb097 100644 --- a/libnautilus-private/nautilus-icon-factory.c +++ b/libnautilus-private/nautilus-icon-factory.c @@ -45,6 +45,7 @@ #include <eel/eel-gdk-pixbuf-extensions.h> #include <eel/eel-glib-extensions.h> #include <eel/eel-gtk-macros.h> +#include <eel/eel-pango-extensions.h> #include <eel/eel-string.h> #include <eel/eel-vfs-extensions.h> #include <gtk/gtksignal.h> @@ -202,9 +203,6 @@ typedef struct { GdkPixbuf *pixbuf; NautilusIconDetails details; - /* If true, outside clients have refs to the pixbuf. */ - gboolean outstanding; - /* Number of internal clients with refs to the pixbuf. */ guint internal_ref_count; @@ -386,26 +384,6 @@ cache_key_destroy (CacheKey *key) g_free (key); } -#if GNOME2_CONVERSION_COMPLETE -static void -mark_icon_not_outstanding (GdkPixbuf *pixbuf, gpointer callback_data) -{ - NautilusIconFactory *factory; - CacheIcon *icon; - - g_assert (callback_data == NULL); - - factory = get_icon_factory (); - - icon = g_hash_table_lookup (factory->cache_icons, pixbuf); - g_return_if_fail (icon != NULL); - g_return_if_fail (icon->pixbuf == pixbuf); - g_return_if_fail (icon->outstanding); - - icon->outstanding = FALSE; -} -#endif - static CacheIcon * cache_icon_new (GdkPixbuf *pixbuf, IconRequest request, @@ -422,10 +400,6 @@ cache_icon_new (GdkPixbuf *pixbuf, /* Grab the pixbuf since we are keeping it. */ g_object_ref (pixbuf); -#if GNOME2_CONVERSION_COMPLETE - gdk_pixbuf_set_last_unref_handler - (pixbuf, mark_icon_not_outstanding, NULL); -#endif /* Make the icon. */ icon = g_new0 (CacheIcon, 1); @@ -508,18 +482,7 @@ cache_icon_unref (CacheIcon *icon) /* Remove from the cache icons table. */ g_hash_table_remove (factory->cache_icons, icon->pixbuf); - /* Since it's no longer in the cache, we don't need to notice the last unref. */ -#if GNOME2_CONVERSION_COMPLETE - gdk_pixbuf_set_last_unref_handler (icon->pixbuf, NULL, NULL); -#endif - - /* Let go of the pixbuf if we were holding a reference to it. - * If it was still outstanding, we didn't have a reference to it, - * and we were counting on the unref handler to catch it. - */ - if (!icon->outstanding) { - g_object_unref (icon->pixbuf); - } + g_object_unref (icon->pixbuf); g_free (icon); } @@ -601,7 +564,7 @@ nautilus_icon_factory_possibly_free_cached_icon (gpointer key, } /* Don't free a cache entry if the pixbuf is still in use. */ - if (icon->outstanding) { + if (G_OBJECT (icon->pixbuf)->ref_count > 1) { return FALSE; } @@ -1609,11 +1572,10 @@ load_specific_icon (NautilusScalableIcon *scalable_icon, return icon; } -#if GNOME2_CONVESION_COMPLETE - static void destroy_fallback_icon (void) { +#if 0 CacheIcon *icon; icon = fallback_icon; @@ -1621,9 +1583,8 @@ destroy_fallback_icon (void) cache_icon_ref (icon); fallback_icon = NULL; cache_icon_unref (icon); -} - #endif +} /* This load function is not allowed to return NULL. */ static CacheIcon * @@ -1675,9 +1636,7 @@ load_icon_for_scaling (NautilusScalableIcon *scalable_icon, NULL); fallback_icon = cache_icon_new (pixbuf, FALSE, FALSE, NULL); fallback_icon->is_fallback = TRUE; -#if GNOME2_CONVERSION_COMPLETE eel_debug_call_at_shutdown (destroy_fallback_icon); -#endif } *actual_size_result = NAUTILUS_ICON_SIZE_STANDARD; @@ -2036,19 +1995,8 @@ nautilus_icon_factory_get_pixbuf_for_icon (NautilusScalableIcon *scalable_icon, return NULL; } - /* The first time we hand out an icon we just leave it with a - * single ref (we'll get called back for the unref), but - * subsequent times we add additional refs. - */ pixbuf = icon->pixbuf; - if (!icon->outstanding) { - icon->outstanding = TRUE; -#ifndef GNOME2_CONVERSION_COMPLETE - g_object_ref (pixbuf); -#endif - } else { - g_object_ref (pixbuf); - } + g_object_ref (pixbuf); cache_icon_unref (icon); return pixbuf; @@ -2211,17 +2159,19 @@ embedded_text_font_free (void) static GdkPixbuf * embed_text (GdkPixbuf *pixbuf_without_text, - ArtIRect embedded_text_rect, + ArtIRect text_rect, const char *text) { GdkPixbuf *pixbuf_with_text; + PangoLayout *layout; + static PangoContext *context; g_return_val_if_fail (pixbuf_without_text != NULL, NULL); /* Quick out for the case where there's no place to embed the * text or the place is too small or there's no text. */ - if (!embedded_text_rect_usable (embedded_text_rect) || eel_strlen (text) == 0) { + if (!embedded_text_rect_usable (text_rect) || eel_strlen (text) == 0) { return NULL; } @@ -2239,32 +2189,21 @@ embed_text (GdkPixbuf *pixbuf_without_text, } g_return_val_if_fail (EEL_IS_SCALABLE_FONT (embedded_text_font), NULL); - - smooth_text_layout = eel_smooth_text_layout_new (text, - eel_strlen (text), - embedded_text_font, - EMBEDDED_TEXT_FONT_SIZE, - FALSE); - g_return_val_if_fail (EEL_IS_SMOOTH_TEXT_LAYOUT (smooth_text_layout), NULL); - eel_smooth_text_layout_set_line_spacing (smooth_text_layout, EMBEDDED_TEXT_LINE_SPACING); - eel_smooth_text_layout_set_empty_line_height (smooth_text_layout, EMBEDDED_TEXT_EMPTY_LINE_HEIGHT); #endif - pixbuf_with_text = gdk_pixbuf_copy (pixbuf_without_text); - -#if GNOME2_CONVERSION_COMPLETE - eel_smooth_text_layout_draw_to_pixbuf (smooth_text_layout, - pixbuf_with_text, - 0, - 0, - embedded_text_rect, - GTK_JUSTIFY_LEFT, - FALSE, - EEL_RGB_COLOR_BLACK, - EEL_OPACITY_FULLY_OPAQUE); + if (context == NULL) { + context = eel_pango_ft2_get_context (); + eel_debug_call_at_shutdown_with_data (g_object_unref, context); + } + layout = pango_layout_new (context); + pango_layout_set_text (layout, text, -1); - g_object_unref (smooth_text_layout); -#endif + pixbuf_with_text = gdk_pixbuf_copy (pixbuf_without_text); + /* FIXME: Need a version of eel_gdk_pixbuf_draw_layout that does clipping. */ + eel_gdk_pixbuf_draw_layout (pixbuf_with_text, + text_rect.x0, text_rect.y0, + EEL_RGB_COLOR_BLACK, layout); + g_object_unref (layout); return pixbuf_with_text; } diff --git a/src/file-manager/fm-list-model.c b/src/file-manager/fm-list-model.c index d2b1935d4..ca51b5057 100644 --- a/src/file-manager/fm-list-model.c +++ b/src/file-manager/fm-list-model.c @@ -32,7 +32,7 @@ #define G_SLIST(x) ((GSList *) x) -struct _FMListModelDetails { +struct FMListModelDetails { GSList *files; GSList *tail; int length; @@ -50,7 +50,7 @@ typedef struct { int sort_column_id; } AttributeEntry; -AttributeEntry attributes[] = { +static const AttributeEntry attributes[] = { { "name", FM_LIST_MODEL_NAME_COLUMN }, { "icon", FM_LIST_MODEL_TYPE_COLUMN }, #ifdef GNOME2_CONVERSION_COMPLETE @@ -61,128 +61,6 @@ AttributeEntry attributes[] = { { "date_modified", FM_LIST_MODEL_DATE_MODIFIED_COLUMN }, }; -static void fm_list_model_init (FMListModel *list_store); -static void fm_list_model_class_init (FMListModelClass *klass); -static void fm_list_model_tree_model_init (GtkTreeModelIface *iface); -static void fm_list_model_sortable_init (GtkTreeSortableIface *iface); -static void fm_list_model_drag_source_init (GtkTreeDragSourceIface *iface); -static guint fm_list_model_get_flags (GtkTreeModel *tree_model); -static int fm_list_model_get_n_columns (GtkTreeModel *tree_model); -static GType fm_list_model_get_column_type (GtkTreeModel *tree_model, - int index); -static gboolean fm_list_model_get_iter (GtkTreeModel *tree_model, - GtkTreeIter *iter, - GtkTreePath *path); -static GtkTreePath *fm_list_model_get_path (GtkTreeModel *tree_model, - GtkTreeIter *iter); -static void fm_list_model_get_value (GtkTreeModel *tree_model, - GtkTreeIter *iter, - int column, - GValue *value); -static gboolean fm_list_model_iter_next (GtkTreeModel *tree_model, - GtkTreeIter *iter); -static gboolean fm_list_model_iter_children (GtkTreeModel *tree_model, - GtkTreeIter *iter, - GtkTreeIter *parent); -static gboolean fm_list_model_iter_has_child (GtkTreeModel *tree_model, - GtkTreeIter *iter); -static int fm_list_model_iter_n_children (GtkTreeModel *tree_model, - GtkTreeIter *iter); -static gboolean fm_list_model_iter_nth_child (GtkTreeModel *tree_model, - GtkTreeIter *iter, - GtkTreeIter *parent, - int n); -static gboolean fm_list_model_iter_parent (GtkTreeModel *tree_model, - GtkTreeIter *iter, - GtkTreeIter *child); - -/* Sortable */ -static gboolean fm_list_model_get_sort_column_id (GtkTreeSortable *sortable, - gint *sort_column_id, - GtkSortType *order); - -GType -fm_list_model_get_type (void) -{ - static GType object_type = 0; - - if (object_type == 0) { - static const GTypeInfo object_info = { - sizeof (FMListModelClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) fm_list_model_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (FMListModel), - 0, - (GInstanceInitFunc) fm_list_model_init, - }; - - static const GInterfaceInfo tree_model_info = { - (GInterfaceInitFunc) fm_list_model_tree_model_init, - NULL, - NULL - }; - - static const GInterfaceInfo sortable_info = { - (GInterfaceInitFunc) fm_list_model_sortable_init, - NULL, - NULL - }; - - static const GInterfaceInfo drag_source_info = { - (GInterfaceInitFunc) fm_list_model_drag_source_init, - NULL, - NULL - }; - - object_type = g_type_register_static (G_TYPE_OBJECT, "FMListModel", &object_info, 0); - g_type_add_interface_static (object_type, - GTK_TYPE_TREE_MODEL, - &tree_model_info); - g_type_add_interface_static (object_type, - GTK_TYPE_TREE_SORTABLE, - &sortable_info); - g_type_add_interface_static (object_type, - GTK_TYPE_TREE_DRAG_SOURCE, - &drag_source_info); - } - - return object_type; - -} - -static void -fm_list_model_init (FMListModel *model) -{ - model->details = g_new0 (FMListModelDetails, 1); - model->details->stamp = g_random_int (); - model->details->sort_column_id = -1; -} - -static void -fm_list_model_class_init (FMListModelClass *klass) -{ -} - -static void -fm_list_model_tree_model_init (GtkTreeModelIface *iface) -{ - iface->get_flags = fm_list_model_get_flags; - iface->get_n_columns = fm_list_model_get_n_columns; - iface->get_column_type = fm_list_model_get_column_type; - iface->get_iter = fm_list_model_get_iter; - iface->get_path = fm_list_model_get_path; - iface->get_value = fm_list_model_get_value; - iface->iter_next = fm_list_model_iter_next; - iface->iter_children = fm_list_model_iter_children; - iface->iter_has_child = fm_list_model_iter_has_child; - iface->iter_n_children = fm_list_model_iter_n_children; - iface->iter_nth_child = fm_list_model_iter_nth_child; - iface->iter_parent = fm_list_model_iter_parent; -} - static guint fm_list_model_get_flags (GtkTreeModel *tree_model) { @@ -597,14 +475,6 @@ fm_list_model_has_default_sort_func (GtkTreeSortable *sortable) return FALSE; } -static void -fm_list_model_sortable_init (GtkTreeSortableIface *iface) -{ - iface->get_sort_column_id = fm_list_model_get_sort_column_id; - iface->set_sort_column_id = fm_list_model_set_sort_column_id; - iface->has_default_sort_func = fm_list_model_has_default_sort_func; -} - static gboolean fm_list_model_row_draggable (GtkTreeDragSource *drag_source, GtkTreePath *path) { @@ -619,13 +489,6 @@ fm_list_model_drag_data_get (GtkTreeDragSource *drag_source, GtkTreePath *path, } -static void -fm_list_model_drag_source_init (GtkTreeDragSourceIface *iface) -{ - iface->row_draggable = fm_list_model_row_draggable; - iface->drag_data_get = fm_list_model_drag_data_get; -} - void fm_list_model_add_file (FMListModel *model, NautilusFile *file) { @@ -856,3 +719,100 @@ fm_list_model_get_sort_column_id_from_sort_type (NautilusFileSortType sort_type) return -1; } + +static void +fm_list_model_init (FMListModel *model) +{ + model->details = g_new0 (FMListModelDetails, 1); + model->details->stamp = g_random_int (); + model->details->sort_column_id = -1; +} + +static void +fm_list_model_class_init (FMListModelClass *klass) +{ +} + +static void +fm_list_model_tree_model_init (GtkTreeModelIface *iface) +{ + iface->get_flags = fm_list_model_get_flags; + iface->get_n_columns = fm_list_model_get_n_columns; + iface->get_column_type = fm_list_model_get_column_type; + iface->get_iter = fm_list_model_get_iter; + iface->get_path = fm_list_model_get_path; + iface->get_value = fm_list_model_get_value; + iface->iter_next = fm_list_model_iter_next; + iface->iter_children = fm_list_model_iter_children; + iface->iter_has_child = fm_list_model_iter_has_child; + iface->iter_n_children = fm_list_model_iter_n_children; + iface->iter_nth_child = fm_list_model_iter_nth_child; + iface->iter_parent = fm_list_model_iter_parent; +} + +static void +fm_list_model_sortable_init (GtkTreeSortableIface *iface) +{ + iface->get_sort_column_id = fm_list_model_get_sort_column_id; + iface->set_sort_column_id = fm_list_model_set_sort_column_id; + iface->has_default_sort_func = fm_list_model_has_default_sort_func; +} + +static void +fm_list_model_drag_source_init (GtkTreeDragSourceIface *iface) +{ + iface->row_draggable = fm_list_model_row_draggable; + iface->drag_data_get = fm_list_model_drag_data_get; +} + +GType +fm_list_model_get_type (void) +{ + static GType object_type = 0; + + if (object_type == 0) { + static const GTypeInfo object_info = { + sizeof (FMListModelClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) fm_list_model_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (FMListModel), + 0, + (GInstanceInitFunc) fm_list_model_init, + }; + + static const GInterfaceInfo tree_model_info = { + (GInterfaceInitFunc) fm_list_model_tree_model_init, + NULL, + NULL + }; + + static const GInterfaceInfo sortable_info = { + (GInterfaceInitFunc) fm_list_model_sortable_init, + NULL, + NULL + }; + + static const GInterfaceInfo drag_source_info = { + (GInterfaceInitFunc) fm_list_model_drag_source_init, + NULL, + NULL + }; + + object_type = g_type_register_static (G_TYPE_OBJECT, "FMListModel", &object_info, 0); + g_type_add_interface_static (object_type, + GTK_TYPE_TREE_MODEL, + &tree_model_info); + g_type_add_interface_static (object_type, + GTK_TYPE_TREE_SORTABLE, + &sortable_info); + g_type_add_interface_static (object_type, + GTK_TYPE_TREE_DRAG_SOURCE, + &drag_source_info); + } + + return object_type; + +} diff --git a/src/file-manager/fm-list-model.h b/src/file-manager/fm-list-model.h index d08de5fef..ddcc10b19 100644 --- a/src/file-manager/fm-list-model.h +++ b/src/file-manager/fm-list-model.h @@ -44,30 +44,32 @@ enum { FM_LIST_MODEL_NUM_COLUMNS }; -typedef struct _FMListModel FMListModel; -typedef struct _FMListModelClass FMListModelClass; -typedef struct _FMListModelDetails FMListModelDetails; +typedef struct FMListModelDetails FMListModelDetails; -struct _FMListModel { +typedef struct FMListModel { GObject parent_instance; - FMListModelDetails *details; -}; +} FMListModel; -struct _FMListModelClass { +typedef struct { GObjectClass parent_class; -}; - -GType fm_list_model_get_type (void); - -void fm_list_model_add_file (FMListModel *model, NautilusFile *file); -void fm_list_model_file_changed (FMListModel *model, NautilusFile *file); -gboolean fm_list_model_is_empty (FMListModel *model); -void fm_list_model_remove_file (FMListModel *model, NautilusFile *file); -void fm_list_model_clear (FMListModel *model); -gboolean fm_list_model_get_tree_iter_from_file (FMListModel *model, NautilusFile *file, GtkTreeIter *iter); -void fm_list_model_set_should_sort_directories_first (FMListModel *model, gboolean sort_directories_first); -int fm_list_model_get_sort_column_id_from_attribute (const char *attribute); -int fm_list_model_get_sort_column_id_from_sort_type (NautilusFileSortType sort_type); +} FMListModelClass; + +GType fm_list_model_get_type (void); +void fm_list_model_add_file (FMListModel *model, + NautilusFile *file); +void fm_list_model_file_changed (FMListModel *model, + NautilusFile *file); +gboolean fm_list_model_is_empty (FMListModel *model); +void fm_list_model_remove_file (FMListModel *model, + NautilusFile *file); +void fm_list_model_clear (FMListModel *model); +gboolean fm_list_model_get_tree_iter_from_file (FMListModel *model, + NautilusFile *file, + GtkTreeIter *iter); +void fm_list_model_set_should_sort_directories_first (FMListModel *model, + gboolean sort_directories_first); +int fm_list_model_get_sort_column_id_from_attribute (const char *attribute); +int fm_list_model_get_sort_column_id_from_sort_type (NautilusFileSortType sort_type); #endif /* FM_LIST_MODEL_H */ diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c index 803d78ef3..be800666a 100644 --- a/src/file-manager/fm-list-view.c +++ b/src/file-manager/fm-list-view.c @@ -30,17 +30,17 @@ #include "fm-list-model.h" #include <eel/eel-cell-renderer-pixbuf-list.h> #include <eel/eel-dnd.h> -#include <eel/eel-gtk-macros.h> #include <gtk/gtkcellrendererpixbuf.h> #include <gtk/gtkcellrenderertext.h> #include <gtk/gtktreeselection.h> #include <gtk/gtktreeview.h> #include <libgnome/gnome-i18n.h> +#include <libgnome/gnome-macros.h> #include <libnautilus-private/nautilus-directory-background.h> #include <libnautilus-private/nautilus-global-preferences.h> #include <libnautilus-private/nautilus-metadata.h> -struct _FMListViewDetails { +struct FMListViewDetails { GtkTreeView *tree_view; FMListModel *model; }; @@ -61,34 +61,10 @@ static GtkTargetEntry drag_types [] = { static NautilusFileSortType default_sort_order_auto_value; static gboolean default_sort_reversed_auto_value; -static void fm_list_view_init (FMListView *list_view); -static void fm_list_view_class_init (FMListViewClass *klass); -static void create_and_set_up_tree_view (FMListView *view); - -static void fm_list_view_begin_loading (FMDirectoryView *view); -static GtkWidget * fm_list_view_get_background_widget (FMDirectoryView *view); static GList * fm_list_view_get_selection (FMDirectoryView *view); -static gboolean fm_list_view_is_empty (FMDirectoryView *view); -static void fm_list_view_remove_file (FMDirectoryView *view, - NautilusFile *file); -static void fm_list_view_set_selection (FMDirectoryView *view, - GList *selection); -static void fm_list_view_sort_directories_first_changed (FMDirectoryView *view); - -EEL_CLASS_BOILERPLATE (FMListView, - fm_list_view, - FM_TYPE_DIRECTORY_VIEW) - -static void -fm_list_view_init (FMListView *list_view) -{ - list_view->details = g_new0 (FMListViewDetails, 1); - list_view->details->model = g_object_new (FM_TYPE_LIST_MODEL, NULL); - fm_list_model_set_should_sort_directories_first (list_view->details->model, - fm_directory_view_should_sort_directories_first (FM_DIRECTORY_VIEW (list_view))); - create_and_set_up_tree_view (list_view); -} +GNOME_CLASS_BOILERPLATE (FMListView, fm_list_view, + FMDirectoryView, FM_TYPE_DIRECTORY_VIEW) static void list_selection_changed_callback (GtkTreeSelection *selection, gpointer user_data) @@ -126,6 +102,7 @@ create_and_set_up_tree_view (FMListView *view) g_signal_connect (view->details->tree_view, "row_activated", G_CALLBACK (list_activate_callback), view); + view->details->model = g_object_new (FM_TYPE_LIST_MODEL, NULL); gtk_tree_view_set_model (view->details->tree_view, GTK_TREE_MODEL (view->details->model)); g_object_unref (view->details->model); @@ -212,9 +189,8 @@ set_sort_order_from_metadata_and_preferences (FMListView *list_view) sort_attribute); if (sort_attribute == NULL) { - sort_column_id= fm_list_model_get_sort_column_id_from_sort_type (default_sort_order_auto_value); - } - else { + sort_column_id = fm_list_model_get_sort_column_id_from_sort_type (default_sort_order_auto_value); + } else { sort_column_id = fm_list_model_get_sort_column_id_from_attribute (sort_attribute); } @@ -319,13 +295,14 @@ fm_list_view_set_selection (FMDirectoryView *view, GList *selection) for (list = selection; list; list = list->next) { file = list->data; - if (fm_list_model_get_tree_iter_from_file (list_view->details->model, file, &iter) == TRUE) { + if (fm_list_model_get_tree_iter_from_file (list_view->details->model, file, &iter)) { gtk_tree_selection_select_iter (gtk_tree_view_get_selection (list_view->details->tree_view), &iter); } } } #if 0 + static char * get_attribute_from_sort_type (NautilusFileSortType sort_type) { @@ -363,13 +340,18 @@ fm_list_view_sort_directories_first_changed (FMDirectoryView *view) fm_list_model_set_should_sort_directories_first (list_view->details->model, fm_directory_view_should_sort_directories_first (view)); - } static void fm_list_view_finalize (GObject *object) { - EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object)); + FMListView *list_view; + + list_view = FM_LIST_VIEW (object); + + g_free (list_view->details); + + G_OBJECT_CLASS (parent_class)->finalize (object); } static void @@ -399,3 +381,13 @@ fm_list_view_class_init (FMListViewClass *klass) eel_preferences_add_auto_boolean (NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER, &default_sort_reversed_auto_value); } + +static void +fm_list_view_instance_init (FMListView *list_view) +{ + list_view->details = g_new0 (FMListViewDetails, 1); + + create_and_set_up_tree_view (list_view); + + fm_list_view_sort_directories_first_changed (FM_DIRECTORY_VIEW (list_view)); +} diff --git a/src/file-manager/fm-list-view.h b/src/file-manager/fm-list-view.h index be219fda2..5078dfa72 100644 --- a/src/file-manager/fm-list-view.h +++ b/src/file-manager/fm-list-view.h @@ -35,19 +35,16 @@ #define FM_IS_LIST_VIEW(obj) (GTK_CHECK_TYPE ((obj), FM_TYPE_LIST_VIEW)) #define FM_IS_LIST_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), FM_TYPE_LIST_VIEW)) -typedef struct _FMListView FMListView; -typedef struct _FMListViewClass FMListViewClass; -typedef struct _FMListViewDetails FMListViewDetails; +typedef struct FMListViewDetails FMListViewDetails; -struct _FMListView { +typedef struct { FMDirectoryView parent_instance; - FMListViewDetails *details; -}; +} FMListView; -struct _FMListViewClass { +typedef struct { FMDirectoryViewClass parent_class; -}; +} FMListViewClass; GType fm_list_view_get_type (void); diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c index 5fa55d3af..c9e3563b2 100644 --- a/src/file-manager/fm-properties-window.c +++ b/src/file-manager/fm-properties-window.c @@ -2510,17 +2510,15 @@ set_icon_callback (const char* icon_path, FMPropertiesWindow *properties_window) static void select_image_button_callback (GtkWidget *widget, FMPropertiesWindow *properties_window) { -#if GNOME2_CONVERSION_COMPLETE GtkWidget *dialog; g_assert (FM_IS_PROPERTIES_WINDOW (properties_window)); dialog = eel_gnome_icon_selector_new (_("Select an icon:"), - NULL, - GTK_WINDOW (properties_window), - (EelIconSelectionFunction) set_icon_callback, - properties_window); -#endif + NULL, + GTK_WINDOW (properties_window), + (EelIconSelectionFunction) set_icon_callback, + properties_window); } static void diff --git a/src/nautilus-bookmarks-window.c b/src/nautilus-bookmarks-window.c index 86235836f..4697d7706 100644 --- a/src/nautilus-bookmarks-window.c +++ b/src/nautilus-bookmarks-window.c @@ -480,7 +480,6 @@ on_row_move (GtkCList *clist, { NautilusBookmark *bookmark; - puts (__FUNCTION__); bookmark = nautilus_bookmark_copy( nautilus_bookmark_list_item_at(bookmarks, old_row)); diff --git a/src/nautilus-complex-search-bar.c b/src/nautilus-complex-search-bar.c index 4cfa01daf..c3cc14a7a 100644 --- a/src/nautilus-complex-search-bar.c +++ b/src/nautilus-complex-search-bar.c @@ -32,6 +32,7 @@ #include "nautilus-search-bar-criterion-private.h" #include "nautilus-search-bar-criterion.h" #include "nautilus-window-private.h" +#include <bonobo/bonobo-dock.h> #include <eel/eel-gdk-pixbuf-extensions.h> #include <eel/eel-gtk-extensions.h> #include <eel/eel-gtk-macros.h> @@ -349,9 +350,7 @@ nautilus_complex_search_bar_set_location (NautilusNavigationBar *navigation_bar, void nautilus_complex_search_bar_queue_resize (NautilusComplexSearchBar *bar) { -#if GNOME2_CONVERSION_COMPLETE GtkWidget *dock; -#endif gtk_widget_queue_resize (bar->details->criteria_container); /* FIXME bugzilla.gnome.org 43171: @@ -363,12 +362,10 @@ nautilus_complex_search_bar_queue_resize (NautilusComplexSearchBar *bar) * shrink when pressing the fewer options button, but it will if the * window is fairly narrow. */ -#if GNOME2_CONVERSION_COMPLETE - dock = gtk_widget_get_ancestor (GTK_WIDGET (bar), GNOME_TYPE_DOCK); + dock = gtk_widget_get_ancestor (GTK_WIDGET (bar), BONOBO_TYPE_DOCK); if (dock != NULL) { gtk_widget_queue_resize (dock); } -#endif } static void diff --git a/src/nautilus-property-browser.c b/src/nautilus-property-browser.c index 75b63de7a..853de7cd9 100644 --- a/src/nautilus-property-browser.c +++ b/src/nautilus-property-browser.c @@ -955,11 +955,9 @@ nautilus_emblem_dialog_new (NautilusPropertyBrowser *property_browser) gtk_entry_set_text(GTK_ENTRY(entry), property_browser->details->image_path); /* install the table in the dialog */ - gtk_widget_show(table); - gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), table, TRUE, TRUE, GNOME_PAD); -#if GNOME2_CONVERSION_COMPLETE - gtk_dialog_set_default(GTK_DIALOG(dialog), GNOME_OK); -#endif + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), table, TRUE, TRUE, GNOME_PAD); + gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_OK); gtk_window_set_wmclass(GTK_WINDOW(dialog), "emblem_dialog", "Nautilus"); return dialog; @@ -1005,17 +1003,13 @@ nautilus_color_selection_dialog_new (NautilusPropertyBrowser *property_browser) /* install the table in the dialog */ - gtk_widget_show(table); - gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), table, TRUE, TRUE, GNOME_PAD); -#if GNOME2_CONVERSION_COMPLETE - gtk_dialog_set_default(GTK_DIALOG(dialog), GNOME_OK); -#endif + gtk_widget_show (table); + gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox), table, TRUE, TRUE, GNOME_PAD); + gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_OK); return dialog; } -#if GNOME2_CONVERSION_COMPLETE - /* add the newly selected file to the browser images */ static void add_pattern_to_browser (const char *path_name, gpointer *data) @@ -1089,8 +1083,6 @@ add_pattern_to_browser (const char *path_name, gpointer *data) nautilus_property_browser_update_contents (property_browser); } -#endif - /* here's where we initiate adding a new pattern by putting up a file selector */ static void @@ -1102,7 +1094,6 @@ add_new_pattern (NautilusPropertyBrowser *property_browser) gdk_window_raise(property_browser->details->dialog->window); } } else { -#if GNOME2_CONVERSION_COMPLETE property_browser->details->dialog = eel_gnome_icon_selector_new (_("Select an image file to add as a pattern:"), DATADIR "/pixmaps/tiles/", @@ -1111,7 +1102,6 @@ add_new_pattern (NautilusPropertyBrowser *property_browser) property_browser); eel_nullify_when_destroyed (&property_browser->details->dialog); -#endif } } @@ -1578,13 +1568,7 @@ labeled_image_configure (EelLabeledImage *labeled_image) { g_return_if_fail (EEL_IS_LABELED_IMAGE (labeled_image)); -#if GNOME2_CONVERSION_COMPLETE - eel_labeled_image_set_background_mode (labeled_image, - EEL_SMOOTH_BACKGROUND_SOLID_COLOR); - eel_labeled_image_set_solid_background_color (labeled_image, - EEL_RGB_COLOR_WHITE); eel_labeled_image_set_spacing (labeled_image, LABELED_IMAGE_SPACING); -#endif } /* Make a color tile for a property */ @@ -1598,12 +1582,6 @@ labeled_image_new (const char *text, labeled_image = eel_labeled_image_new (text, pixbuf); labeled_image_configure (EEL_LABELED_IMAGE (labeled_image)); -#if GNOME2_CONVERSION_COMPLETE - if (num_smaller > 0) { - eel_labeled_image_make_smaller (EEL_LABELED_IMAGE (labeled_image), - num_smaller); - } -#endif if (property_name != NULL) { g_object_set_data_full (G_OBJECT (labeled_image), @@ -1853,13 +1831,7 @@ property_browser_category_button_new (const char *display_name, file_name = nautilus_pixmap_file (image); g_return_val_if_fail (file_name != NULL, NULL); - button = eel_labeled_image_toggle_button_new_from_file_name (display_name, - file_name); - -#if GNOME2_CONVERSION_COMPLETE - /* We want the label to never be smooth */ - eel_labeled_image_set_label_never_smooth (EEL_LABELED_IMAGE (GTK_BIN (button)->child), TRUE); -#endif + button = eel_labeled_image_toggle_button_new_from_file_name (display_name, file_name); /* We also want all of the buttons to be the same height */ eel_labeled_image_set_fixed_image_height (EEL_LABELED_IMAGE (GTK_BIN (button)->child), STANDARD_BUTTON_IMAGE_HEIGHT); diff --git a/src/nautilus-sidebar-tabs.c b/src/nautilus-sidebar-tabs.c index df7ffe79c..3c6937b21 100644 --- a/src/nautilus-sidebar-tabs.c +++ b/src/nautilus-sidebar-tabs.c @@ -82,7 +82,7 @@ typedef struct { char *indicator_pixbuf_name; GdkPixbuf *indicator_pixbuf; int notebook_page; - Bonobo_EventSource_ListenerId listener_id; + Bonobo_Listener listener; GtkWidget *tab_view; GdkRectangle tab_rect; } TabItem; @@ -349,6 +349,7 @@ static void tab_item_destroy (TabItem *item) { Bonobo_PropertyBag property_bag; + CORBA_Environment ev; g_free (item->tab_text); g_free (item->indicator_pixbuf_name); @@ -357,16 +358,18 @@ tab_item_destroy (TabItem *item) g_object_unref (item->indicator_pixbuf); } - if (item->listener_id != 0) { + if (item->listener != CORBA_OBJECT_NIL) { property_bag = get_property_bag (item); - if (property_bag != CORBA_OBJECT_NIL) { -#ifdef GNOME2_CONVERSION_COMPLETE + if (property_bag != CORBA_OBJECT_NIL) { bonobo_event_source_client_remove_listener - (property_bag, item->listener_id, NULL); -#endif + (property_bag, item->listener, NULL); bonobo_object_release_unref (property_bag, NULL); } + CORBA_exception_init (&ev); + CORBA_Object_release (item->listener, &ev); + CORBA_exception_free (&ev); } + g_free (item); } @@ -1376,8 +1379,6 @@ get_tab_item_from_view (NautilusSidebarTabs *sidebar_tabs, GtkWidget *view) return NULL; } -#ifdef GNOME2_CONVERSION_COMPLETE - /* check all of the tabs to see if their indicator pixmaps are ready for updating */ static void nautilus_sidebar_tabs_update_all_indicators (NautilusSidebarTabs *sidebar_tabs) @@ -1391,8 +1392,6 @@ nautilus_sidebar_tabs_update_all_indicators (NautilusSidebarTabs *sidebar_tabs) } } -#endif - /* check all of the tabs to see if their indicator pixmaps are ready for updating */ static void nautilus_sidebar_tabs_update_indicator (NautilusSidebarTabs *sidebar_tabs, GtkWidget *view) @@ -1409,12 +1408,10 @@ nautilus_sidebar_tabs_update_indicator (NautilusSidebarTabs *sidebar_tabs, GtkWi } } -#if GNOME2_CONVERSION_COMPLETE - static void tab_indicator_changed_callback (BonoboListener *listener, - char *event_name, - CORBA_any *arg, + const char *event_name, + const CORBA_any *arg, CORBA_Environment *ev, gpointer callback_data) { @@ -1424,8 +1421,6 @@ tab_indicator_changed_callback (BonoboListener *listener, nautilus_sidebar_tabs_update_all_indicators (sidebar_tabs); } -#endif - /* listen for changes on the tab_image property */ void nautilus_sidebar_tabs_connect_view (NautilusSidebarTabs *sidebar_tabs, GtkWidget *view) @@ -1440,11 +1435,10 @@ nautilus_sidebar_tabs_connect_view (NautilusSidebarTabs *sidebar_tabs, GtkWidget property_bag = get_property_bag (tab_item); if (property_bag != CORBA_OBJECT_NIL) { -#ifdef GNOME2_CONVERSION_COMPLETE - tab_item->listener_id = bonobo_event_source_client_add_listener - (property_bag, tab_indicator_changed_callback, - "Bonobo/Property:change:tab_image", NULL, sidebar_tabs); -#endif + tab_item->listener = bonobo_event_source_client_add_listener_full + (property_bag, + g_cclosure_new (G_CALLBACK (tab_indicator_changed_callback), sidebar_tabs, NULL), + "Bonobo/Property:change:tab_image", NULL); bonobo_object_release_unref (property_bag, NULL); } diff --git a/src/nautilus-simple-search-bar.c b/src/nautilus-simple-search-bar.c index 62ef9f018..6b5549f1e 100644 --- a/src/nautilus-simple-search-bar.c +++ b/src/nautilus-simple-search-bar.c @@ -57,20 +57,15 @@ static char * nautilus_simple_search_criteria_to_search_uri (const char static void nautilus_simple_search_bar_class_init (NautilusSimpleSearchBarClass *class); static void nautilus_simple_search_bar_init (NautilusSimpleSearchBar *bar); static void nautilus_simple_search_bar_finalize (GObject *object); -#ifdef GNOME2_CONVERSION_COMPLETE -static void nautilus_simple_search_bar_destroy (GtkObject *object); -#endif + EEL_CLASS_BOILERPLATE (NautilusSimpleSearchBar, - nautilus_simple_search_bar, - NAUTILUS_TYPE_SEARCH_BAR) + nautilus_simple_search_bar, + NAUTILUS_TYPE_SEARCH_BAR) static void nautilus_simple_search_bar_class_init (NautilusSimpleSearchBarClass *klass) { G_OBJECT_CLASS (klass)->finalize = nautilus_simple_search_bar_finalize; -#ifdef GNOME2_CONVERSION_COMPLETE - GTK_OBJECT_CLASS (klass)->destroy = nautilus_simple_search_bar_destroy; -#endif NAUTILUS_NAVIGATION_BAR_CLASS (klass)->activate = real_activate; NAUTILUS_NAVIGATION_BAR_CLASS (klass)->get_location = nautilus_simple_search_bar_get_location; NAUTILUS_NAVIGATION_BAR_CLASS (klass)->set_location = nautilus_simple_search_bar_set_location; @@ -102,21 +97,6 @@ nautilus_simple_search_bar_init (NautilusSimpleSearchBar *bar) bar->details = g_new0 (NautilusSimpleSearchBarDetails, 1); } -#ifdef GNOME2_CONVERSION_COMPLETE -static void -nautilus_simple_search_bar_destroy (GtkObject *object) -{ - NautilusSimpleSearchBar *bar; - - bar = NAUTILUS_SIMPLE_SEARCH_BAR (object); - - nautilus_undo_editable_set_undo_key (GTK_EDITABLE (bar->details->entry), FALSE); - nautilus_undo_tear_down_nautilus_entry_for_undo (bar->details->entry); - - EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object)); -} -#endif - static void nautilus_simple_search_bar_finalize (GObject *object) { diff --git a/src/nautilus-switchable-navigation-bar.c b/src/nautilus-switchable-navigation-bar.c index 53d24102f..70fa3af4a 100644 --- a/src/nautilus-switchable-navigation-bar.c +++ b/src/nautilus-switchable-navigation-bar.c @@ -31,14 +31,15 @@ #include "nautilus-switchable-navigation-bar.h" #include "nautilus-switchable-search-bar.h" +#include <bonobo/bonobo-dock.h> +#include <eel/eel-gtk-macros.h> +#include <eel/eel-string.h> #include <gtk/gtklabel.h> #include <gtk/gtksignal.h> #include <gtk/gtkvbox.h> #include <libgnome/gnome-i18n.h> #include <libnautilus-private/nautilus-directory.h> -#include <eel/eel-gtk-macros.h> #include <libnautilus-private/nautilus-search-uri.h> -#include <eel/eel-string.h> #include <stdio.h> struct NautilusSwitchableNavigationBarDetails { @@ -189,9 +190,7 @@ nautilus_switchable_navigation_bar_set_mode (NautilusSwitchableNavigationBar NautilusSwitchableNavigationBarMode mode) { GtkWidget *widget_to_hide, *widget_to_show; -#if GNOME2_CONVERSION_COMPLETE GtkWidget *dock; -#endif if (bar->details->mode == mode) { return; @@ -224,18 +223,16 @@ nautilus_switchable_navigation_bar_set_mode (NautilusSwitchableNavigationBar nautilus_switchable_navigation_bar_activate (bar); -#if GNOME2_CONVERSION_COMPLETE /* FIXME bugzilla.gnome.org 43171: * We don't know why this line is needed here, but if it's removed * then the bar won't shrink when we switch from the complex search * bar to the location bar (though it does grow when switching in * the other direction) */ - dock = gtk_widget_get_ancestor (GTK_WIDGET (bar), GNOME_TYPE_DOCK); + dock = gtk_widget_get_ancestor (GTK_WIDGET (bar), BONOBO_TYPE_DOCK); if (dock != NULL) { gtk_widget_queue_resize (dock); } -#endif g_signal_emit (bar, signals[MODE_CHANGED], 0, mode); } diff --git a/src/nautilus-switchable-search-bar.c b/src/nautilus-switchable-search-bar.c index 01b9afb94..0245e9f24 100644 --- a/src/nautilus-switchable-search-bar.c +++ b/src/nautilus-switchable-search-bar.c @@ -31,6 +31,7 @@ #include "nautilus-complex-search-bar.h" #include "nautilus-simple-search-bar.h" +#include <bonobo/bonobo-dock.h> #include <gtk/gtkeventbox.h> #include <gtk/gtksignal.h> #include <gtk/gtkvbox.h> @@ -191,9 +192,7 @@ nautilus_switchable_search_bar_set_mode (NautilusSwitchableSearchBar *bar, NautilusSearchBarMode mode) { char *location; -#if GNOME2_CONVERSION_COMPLETE GtkWidget *dock; -#endif g_return_if_fail (NAUTILUS_IS_SWITCHABLE_SEARCH_BAR (bar)); g_return_if_fail (mode == NAUTILUS_SIMPLE_SEARCH_BAR @@ -223,17 +222,15 @@ nautilus_switchable_search_bar_set_mode (NautilusSwitchableSearchBar *bar, break; } -#if GNOME2_CONVERSION_COMPLETE /* FIXME bugzilla.gnome.org 43171: * We don't know why this line is needed here, but if it's removed * then the bar won't shrink when we switch to the simple search bar * (though it does grow when switching to the complex one). */ - dock = gtk_widget_get_ancestor (GTK_WIDGET (bar), GNOME_TYPE_DOCK); + dock = gtk_widget_get_ancestor (GTK_WIDGET (bar), BONOBO_TYPE_DOCK); if (dock != NULL) { gtk_widget_queue_resize (dock); } -#endif } static char * diff --git a/src/nautilus-view-frame.c b/src/nautilus-view-frame.c index e22b8c310..d6fd63d25 100644 --- a/src/nautilus-view-frame.c +++ b/src/nautilus-view-frame.c @@ -172,6 +172,7 @@ stop_activation (NautilusViewFrame *view) static void destroy_view (NautilusViewFrame *view) { + BonoboUIEngine *engine; CORBA_Environment ev; if (view->details->view == CORBA_OBJECT_NIL) { @@ -191,11 +192,10 @@ destroy_view (NautilusViewFrame *view) view->details->control_frame = NULL; view->details->zoomable_frame = NULL; -#if GNOME2_CONVERSION_COMPLETE - if (view->details->ui_container->win != NULL) { - bonobo_window_deregister_dead_components (view->details->ui_container->win); + engine = bonobo_ui_container_get_engine (view->details->ui_container); + if (engine != NULL) { + bonobo_ui_engine_deregister_dead_components (engine); } -#endif bonobo_object_unref (BONOBO_OBJECT (view->details->ui_container)); view->details->ui_container = NULL; } |