Use gimp_display_set_image() in gimp_display_new()

instead of manually calling gimp_display_connect(). Make
gimp_display_set_image() handle displays in construction
(which don't have a shell yet).
This commit is contained in:
Michael Natterer 2009-10-07 19:42:08 +02:00
parent 08f35de4ac
commit 6ad76d226e
1 changed files with 11 additions and 9 deletions

View File

@ -406,11 +406,7 @@ gimp_display_new (Gimp *gimp,
/* refs the image */
if (image)
{
private->instance = image->instance_count++;
gimp_display_connect (display, image);
}
gimp_display_set_image (display, image);
/* get an image window */
if (GIMP_GUI_CONFIG (display->config)->single_window_mode)
@ -614,6 +610,7 @@ gimp_display_set_image (GimpDisplay *display,
{
GimpDisplayPrivate *private;
GimpImage *old_image = NULL;
GimpDisplayShell *shell;
g_return_if_fail (GIMP_IS_DISPLAY (display));
g_return_if_fail (image == NULL || GIMP_IS_IMAGE (image));
@ -643,10 +640,15 @@ gimp_display_set_image (GimpDisplay *display,
if (old_image)
g_object_unref (old_image);
if (image)
gimp_display_shell_reconnect (gimp_display_get_shell (display));
else
gimp_display_shell_icon_update (gimp_display_get_shell (display));
shell = gimp_display_get_shell (display);
if (shell)
{
if (image)
gimp_display_shell_reconnect (shell);
else
gimp_display_shell_icon_update (shell);
}
if (old_image != image)
g_object_notify (G_OBJECT (display), "image");