Commit 2b5c4766 authored by Maciej Stachowiak's avatar Maciej Stachowiak

New function to use when searching view identifier lists.

	* libnautilus-extensions/nautilus-view-identifier.h,
	libnautilus-extensions/nautilus-view-identifier.c
	(nautilus_view_identifier_compare): New function to use when
	searching view identifier lists.

	* src/nautilus-applicable-views.c (got_file_info_callback): Merge
	the default view into the menu.
parent 0784d73f
2000-06-08 Maciej Stachowiak <mjs@eazel.com>
* libnautilus-extensions/nautilus-view-identifier.h,
libnautilus-extensions/nautilus-view-identifier.c
(nautilus_view_identifier_compare): New function to use when
searching view identifier lists.
* src/nautilus-applicable-views.c (got_file_info_callback): Merge
the default view into the menu.
2000-06-08 Andy Hertzfeld <andy@eazel.com>
* components/rpmview/nautilus-rpm-view.c:
......
......@@ -162,3 +162,8 @@ nautilus_view_identifier_list_free (GList *identifiers)
NULL);
}
int
nautilus_view_identifier_compare (NautilusViewIdentifier *a, NautilusViewIdentifier *b)
{
return (strcmp (a->iid, b->iid) || strcmp (a->name, b->name));
}
......@@ -47,5 +47,7 @@ NautilusViewIdentifier *nautilus_view_identifier_copy (NautilusViewIdentifie
void nautilus_view_identifier_free (NautilusViewIdentifier *identifier);
void nautilus_view_identifier_list_free (GList *identifiers);
int nautilus_view_identifier_compare (NautilusViewIdentifier *a,
NautilusViewIdentifier *b);
#endif
......@@ -162,3 +162,8 @@ nautilus_view_identifier_list_free (GList *identifiers)
NULL);
}
int
nautilus_view_identifier_compare (NautilusViewIdentifier *a, NautilusViewIdentifier *b)
{
return (strcmp (a->iid, b->iid) || strcmp (a->name, b->name));
}
......@@ -47,5 +47,7 @@ NautilusViewIdentifier *nautilus_view_identifier_copy (NautilusViewIdentifie
void nautilus_view_identifier_free (NautilusViewIdentifier *identifier);
void nautilus_view_identifier_list_free (GList *identifiers);
int nautilus_view_identifier_compare (NautilusViewIdentifier *a,
NautilusViewIdentifier *b);
#endif
......@@ -221,6 +221,13 @@ got_file_info_callback (GnomeVFSAsyncHandle *ah,
if (default_component != NULL) {
default_id = nautilus_view_identifier_new_from_content_view (default_component);
CORBA_free (default_component);
if (g_list_find_custom (navinfo->content_identifiers, default_id,
(GCompareFunc) nautilus_view_identifier_compare) == NULL) {
/* FIXME: should insert in sorted order by name */
navinfo->content_identifiers = g_list_prepend (navinfo->content_identifiers,
nautilus_view_identifier_copy (default_id));
}
} else if (navinfo->content_identifiers != NULL) {
/* No default component, just take first one from list. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment