diff options
author | Darin Adler <darin@src.gnome.org> | 2001-09-25 18:26:16 +0000 |
---|---|---|
committer | Darin Adler <darin@src.gnome.org> | 2001-09-25 18:26:16 +0000 |
commit | badc7589bce8a2849172136e088bdbe076a62b6f (patch) | |
tree | 3631358412758daafdf948b21d5bbdfe0b93ae76 /components/adapter | |
parent | 494f382efbcda4cc1b37e15740f6ae3cb5ca7474 (diff) | |
download | nautilus-badc7589bce8a2849172136e088bdbe076a62b6f.tar.gz |
Ref and sink the new adapter. (nautilus_adapter_new): Remove unused
* components/adapter/nautilus-adapter.c:
(nautilus_adapter_initialize): Ref and sink the new adapter.
(nautilus_adapter_new): Remove unused CORBA_Environment.
* components/adapter/nautilus-adapter.h: Whitespace tweak.
* libnautilus-private/nautilus-directory-metafile.c:
(nautilus_directory_get_integer_file_metadata):
* libnautilus-private/nautilus-file.c: (get_id_from_digit_string):
* libnautilus-private/nautilus-icon-factory.c:
(parse_attach_points):
* libnautilus-private/nautilus-thumbnails.c:
(nautilus_thumbnail_load_framed_image):
* src/file-manager/fm-icon-view.c:
(get_stored_icon_position_callback):
A bunch of places were trying to use %*s to detect whether there
were stray characters at the end of a string when doing an sscanf.
I wrote that code. But it doesn't work. A similar technique that
does work is to use %c, and ignore the parsed character.
* src/nautilus-search-bar-criterion.c:
(nautilus_search_uri_get_first_criterion):
This place wasn't using the %*s at all, so just remove it.
Diffstat (limited to 'components/adapter')
-rw-r--r-- | components/adapter/nautilus-adapter.c | 83 | ||||
-rw-r--r-- | components/adapter/nautilus-adapter.h | 3 |
2 files changed, 26 insertions, 60 deletions
diff --git a/components/adapter/nautilus-adapter.c b/components/adapter/nautilus-adapter.c index f2c918c5d..274f9cced 100644 --- a/components/adapter/nautilus-adapter.c +++ b/components/adapter/nautilus-adapter.c @@ -45,9 +45,9 @@ #include <libnautilus/nautilus-bonobo-ui.h> struct NautilusAdapterDetails { - NautilusView *nautilus_view; + NautilusView *nautilus_view; NautilusAdapterEmbedStrategy *embed_strategy; - NautilusAdapterLoadStrategy *load_strategy; + NautilusAdapterLoadStrategy *load_strategy; guint report_load_underway_id; guint report_load_progress_id; guint report_load_complete_id; @@ -55,35 +55,30 @@ struct NautilusAdapterDetails { }; -static void nautilus_adapter_load_location_callback (NautilusView *view, - const char *uri, - NautilusAdapter *adapter); -static void nautilus_adapter_stop_loading_callback (NautilusView *view, - NautilusAdapter *adapter); - -static void nautilus_adapter_activate_callback (BonoboControl *control, - gboolean state, - NautilusAdapter *adapter); +static void nautilus_adapter_load_location_callback (NautilusView *view, + const char *uri, + NautilusAdapter *adapter); +static void nautilus_adapter_stop_loading_callback (NautilusView *view, + NautilusAdapter *adapter); +static void nautilus_adapter_activate_callback (BonoboControl *control, + gboolean state, + NautilusAdapter *adapter); static void nautilus_adapter_open_location_callback (NautilusAdapterEmbedStrategy *strategy, const char *uri, NautilusAdapter *adapter); - -static void nautilus_adapter_load_underway_callback (NautilusAdapter *adapter); -static void nautilus_adapter_load_progress_callback (NautilusAdapter *adapter, - double fraction_complete); -static void nautilus_adapter_load_complete_callback (NautilusAdapter *adapter); -static void nautilus_adapter_load_failed_callback (NautilusAdapter *adapter); - - - -static void nautilus_adapter_initialize_class (NautilusAdapterClass *klass); -static void nautilus_adapter_initialize (NautilusAdapter *server); -static void nautilus_adapter_destroy (GtkObject *object); +static void nautilus_adapter_load_underway_callback (NautilusAdapter *adapter); +static void nautilus_adapter_load_progress_callback (NautilusAdapter *adapter, + double fraction_complete); +static void nautilus_adapter_load_complete_callback (NautilusAdapter *adapter); +static void nautilus_adapter_load_failed_callback (NautilusAdapter *adapter); +static void nautilus_adapter_initialize_class (NautilusAdapterClass *klass); +static void nautilus_adapter_initialize (NautilusAdapter *server); +static void nautilus_adapter_destroy (GtkObject *object); EEL_DEFINE_CLASS_BOILERPLATE (NautilusAdapter, - nautilus_adapter, - GTK_TYPE_OBJECT) + nautilus_adapter, + GTK_TYPE_OBJECT) static void @@ -91,8 +86,6 @@ nautilus_adapter_initialize_class (NautilusAdapterClass *klass) { GtkObjectClass *object_class; - g_assert (NAUTILUS_IS_ADAPTER_CLASS (klass)); - object_class = GTK_OBJECT_CLASS (klass); object_class->destroy = nautilus_adapter_destroy; @@ -101,15 +94,9 @@ nautilus_adapter_initialize_class (NautilusAdapterClass *klass) static void nautilus_adapter_initialize (NautilusAdapter *adapter) { - CORBA_Environment ev; - - CORBA_exception_init (&ev); - - g_assert (NAUTILUS_IS_ADAPTER (adapter)); - adapter->details = g_new0 (NautilusAdapterDetails, 1); - - CORBA_exception_free (&ev); + gtk_object_ref (GTK_OBJECT (adapter)); + gtk_object_sink (GTK_OBJECT (adapter)); } static void @@ -153,20 +140,15 @@ nautilus_adapter_new (Bonobo_Unknown component) BonoboControl *control; GtkWidget *bin; BonoboObject *zoomable; - CORBA_Environment ev; - /* FIXME bugzilla.gnome.org 44405: should be done with * construct args */ - CORBA_exception_init (&ev); - adapter = NAUTILUS_ADAPTER (gtk_object_new (NAUTILUS_TYPE_ADAPTER, NULL)); - /* Set up a few wrapper framework details */ - bin = gtk_widget_new (EEL_TYPE_GENEROUS_BIN, NULL); + bin = gtk_widget_new (EEL_TYPE_GENEROUS_BIN, NULL); gtk_widget_show (bin); control = bonobo_control_new (bin); adapter->details->nautilus_view = nautilus_view_new_from_bonobo_control (control); @@ -177,12 +159,9 @@ nautilus_adapter_new (Bonobo_Unknown component) GTK_OBJECT (adapter)); /* Get the class to handle embedding this kind of component. */ - adapter->details->embed_strategy = nautilus_adapter_embed_strategy_get - (component); - + adapter->details->embed_strategy = nautilus_adapter_embed_strategy_get (component); if (adapter->details->embed_strategy == NULL) { gtk_object_unref (GTK_OBJECT (adapter)); - return NULL; } @@ -200,13 +179,9 @@ nautilus_adapter_new (Bonobo_Unknown component) /* Get the class to handle loading this kind of component. */ - - adapter->details->load_strategy = nautilus_adapter_load_strategy_get - (component); - + adapter->details->load_strategy = nautilus_adapter_load_strategy_get (component); if (adapter->details->load_strategy == NULL) { gtk_object_unref (GTK_OBJECT (adapter)); - return NULL; } @@ -233,18 +208,14 @@ nautilus_adapter_new (Bonobo_Unknown component) GTK_OBJECT (adapter)); /* complete the embedding */ - gtk_container_add (GTK_CONTAINER (bin), nautilus_adapter_embed_strategy_get_widget (adapter->details->embed_strategy)); - /* hook up view signals. */ - gtk_signal_connect (GTK_OBJECT (adapter->details->nautilus_view), "load_location", nautilus_adapter_load_location_callback, adapter); - gtk_signal_connect (GTK_OBJECT (adapter->details->nautilus_view), "stop_loading", nautilus_adapter_stop_loading_callback, @@ -253,15 +224,12 @@ nautilus_adapter_new (Bonobo_Unknown component) return adapter; } - NautilusView * nautilus_adapter_get_nautilus_view (NautilusAdapter *adapter) { return adapter->details->nautilus_view; } - - static void nautilus_adapter_load_location_callback (NautilusView *view, const char *location, @@ -336,4 +304,3 @@ nautilus_adapter_load_failed_callback (NautilusAdapter *adapter) { nautilus_view_report_load_failed (adapter->details->nautilus_view); } - diff --git a/components/adapter/nautilus-adapter.h b/components/adapter/nautilus-adapter.h index e99c5e6ef..1b1662c6e 100644 --- a/components/adapter/nautilus-adapter.h +++ b/components/adapter/nautilus-adapter.h @@ -27,7 +27,6 @@ #ifndef NAUTILUS_ADAPTER_H #define NAUTILUS_ADAPTER_H -#include <gtk/gtklabel.h> #include <libnautilus/nautilus-view.h> #define NAUTILUS_TYPE_ADAPTER (nautilus_adapter_get_type ()) @@ -51,6 +50,6 @@ typedef struct { GtkType nautilus_adapter_get_type (void); NautilusAdapter *nautilus_adapter_new (Bonobo_Unknown component); - NautilusView *nautilus_adapter_get_nautilus_view (NautilusAdapter *adapter); + #endif /* NAUTILUS_ADAPTER_H */ |