[PATCH 3/7] bgo543308 - Factor out the code to emit default-size-changed.

Only emit default-size-changed if the file chooser widget is mapped.
It only makes sense to do this once we know our final configuration,
which is actually when we are mapped.

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=21164
This commit is contained in:
Federico Mena Quintero 2008-08-20 01:11:45 +00:00 committed by Federico Mena Quintero
parent 63674f1baf
commit 0e386e9324

View File

@ -1150,6 +1150,17 @@ change_folder_and_display_error (GtkFileChooserDefault *impl,
return result;
}
static void
emit_default_size_changed (GtkFileChooserDefault *impl)
{
if (!GTK_WIDGET_MAPPED (impl))
return;
profile_msg (" emit default-size-changed start", NULL);
g_signal_emit_by_name (impl, "default-size-changed");
profile_msg (" emit default-size-changed end", NULL);
}
static void
update_preview_widget_visibility (GtkFileChooserDefault *impl)
{
@ -1178,7 +1189,7 @@ update_preview_widget_visibility (GtkFileChooserDefault *impl)
else
gtk_widget_hide (impl->preview_box);
g_signal_emit_by_name (impl, "default-size-changed");
emit_default_size_changed (impl);
}
static void
@ -5422,7 +5433,7 @@ update_appearance (GtkFileChooserDefault *impl)
*/
gtk_widget_queue_draw (impl->browse_files_tree_view);
g_signal_emit_by_name (impl, "default-size-changed");
emit_default_size_changed (impl);
}
static void
@ -5841,9 +5852,7 @@ gtk_file_chooser_default_style_set (GtkWidget *widget,
if (gtk_widget_has_screen (GTK_WIDGET (impl)))
change_icon_theme (impl);
profile_msg (" emit default-size-changed start", NULL);
g_signal_emit_by_name (widget, "default-size-changed");
profile_msg (" emit default-size-changed end", NULL);
emit_default_size_changed (impl);
profile_end ("end", NULL);
}
@ -5864,7 +5873,7 @@ gtk_file_chooser_default_screen_changed (GtkWidget *widget,
remove_settings_signal (impl, previous_screen);
check_icon_theme (impl);
g_signal_emit_by_name (widget, "default-size-changed");
emit_default_size_changed (impl);
profile_end ("end", NULL);
}