Commit c11b6253 authored by John Sullivan's avatar John Sullivan

Fixed assertion failure Andy found in icon-text window.

parent c5c68502
......@@ -283,9 +283,7 @@ customize_icon_text_cb (GtkMenuItem *menu_item, gpointer *view)
g_assert (GTK_IS_MENU_ITEM (menu_item));
g_assert (FM_IS_DIRECTORY_VIEW_ICONS (view));
window = GTK_WINDOW (fm_icon_text_window_get_or_create ());
fm_icon_text_window_set_view (window, FM_DIRECTORY_VIEW_ICONS (view));
window = GTK_WINDOW (fm_icon_text_window_get_or_create ());
nautilus_gtk_window_present (window);
}
......@@ -451,12 +449,12 @@ fm_directory_view_icons_can_zoom_out (FMDirectoryView *view)
}
/**
* fm_directory_view_icons_get_icon_text_attribute_names:
* fm_directory_view_icons_get_full_icon_text_attribute_names:
*
* Get a string representing which text attributes should be displayed
* beneath an icon at the highest zoom level.
* Use g_free to free the result.
* @view: Any FMDirectoryViewIcons object.
* @view: A FMDirectoryViewIcons object, or NULL to get the default.
*
* Return value: A |-delimited string comprising attribute names, e.g. "name|size".
*
......@@ -468,15 +466,23 @@ fm_directory_view_icons_get_full_icon_text_attribute_names (FMDirectoryViewIcons
* So this routine doesn't need the first parameter, but it's in there
* for consistency and possible future expansion.
*/
/* Don't let callers get away with using a non-NULL value here since
* it probably means they're expecting something directory-specific.
*/
g_assert (view == NULL);
return g_strdup (default_icon_text_attribute_names);
}
/**
* fm_directory_view_icons_set_icon_text_attribute_names:
* fm_directory_view_icons_set_full_icon_text_attribute_names:
*
* Sets the string representing which text attributes should be displayed
* beneath an icon at the highest zoom level.
* @view: FMDirectoryViewIcons whose displayed text attributes should be changed.
* @view: FMDirectoryViewIcons whose displayed text attributes should be changed,
* or NULL to change the default. (Currently there is only one global setting, and
* this parameter is ignored.)
* @new_names: The |-delimited set of names to display at the highest zoom level,
* e.g. "name|size|date_modified".
*
......@@ -490,6 +496,11 @@ fm_directory_view_icons_set_full_icon_text_attribute_names (FMDirectoryViewIcons
* for consistency and possible future expansion.
*/
/* Don't let callers get away with using a non-NULL value here since
* it probably means they're expecting something directory-specific.
*/
g_assert (view == NULL);
if (strcmp (new_names, default_icon_text_attribute_names) == 0)
return;
......
......@@ -48,7 +48,6 @@ static gboolean fm_icon_text_window_delete_event_cb (GtkWidget *widget,
#define PIECES_COUNT 4
#define MENU_COUNT (PIECES_COUNT - 1)
static FMDirectoryViewIcons *icon_view = NULL;
static GtkOptionMenu *option_menus[MENU_COUNT];
static char * attribute_names[] = {
......@@ -97,8 +96,6 @@ changed_attributes_option_menu_cb (GtkMenuItem *menu_item, gpointer user_data)
int which_menu;
int index;
g_assert (FM_IS_DIRECTORY_VIEW_ICONS (icon_view));
which_menu = GPOINTER_TO_INT (user_data);
attribute_names_array = g_new0 (gchar*, PIECES_COUNT + 1);
......@@ -118,8 +115,7 @@ changed_attributes_option_menu_cb (GtkMenuItem *menu_item, gpointer user_data)
attribute_names_string = g_strjoinv ("|", attribute_names_array);
fm_directory_view_icons_set_full_icon_text_attribute_names (icon_view,
attribute_names_string);
fm_directory_view_icons_set_full_icon_text_attribute_names (NULL, attribute_names_string);
g_free (attribute_names_string);
g_strfreev (attribute_names_array);
......@@ -297,24 +293,3 @@ fm_icon_text_window_get_or_create (void)
g_assert (GTK_IS_WINDOW (icon_text_window));
return icon_text_window;
}
/**
* fm_icon_text_window_set_view:
*
* Specify which directory view the icon text window is controlling.
*
**/
void
fm_icon_text_window_set_view (GtkWindow *window, FMDirectoryViewIcons *view)
{
/* FIXME: Implement this or remove the API for it. Note that there
* are tricky UI issues since the window is (at least currently)
* non-modal but it affects a particular directory window. Must at
* minimum make that obvious in the icon text window. User can
* change this by choosing "Customize icon text..." in a different
* directory, but that's pretty subtle.
*/
g_return_if_fail (FM_IS_DIRECTORY_VIEW_ICONS (view));
icon_view = view;
}
\ No newline at end of file
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