[gthumb/gthumb-2-14] do not set the image if it's NULL or equal to the current image
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb/gthumb-2-14] do not set the image if it's NULL or equal to the current image
- Date: Fri, 4 Nov 2011 08:58:33 +0000 (UTC)
commit b323772867ae2cea9cfd252a1553256a56565c60
Author: Paolo Bacchilega <paobac src gnome org>
Date: Fri Nov 4 09:34:47 2011 +0100
do not set the image if it's NULL or equal to the current image
extensions/image_viewer/gth-image-viewer-page.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/extensions/image_viewer/gth-image-viewer-page.c b/extensions/image_viewer/gth-image-viewer-page.c
index 2c75eeb..bcaaeca 100644
--- a/extensions/image_viewer/gth-image-viewer-page.c
+++ b/extensions/image_viewer/gth-image-viewer-page.c
@@ -1304,6 +1304,9 @@ _gth_image_viewer_page_set_image (GthImageViewerPage *self,
int height;
char *size;
+ if (image == NULL)
+ return;
+
gth_image_viewer_set_surface (GTH_IMAGE_VIEWER (self->priv->viewer), image, -1, -1);
file_data = gth_browser_get_current_file (GTH_BROWSER (self->priv->browser));
@@ -1499,10 +1502,15 @@ gth_image_viewer_page_set_image (GthImageViewerPage *self,
cairo_surface_t *image,
gboolean add_to_history)
{
+ if (gth_image_viewer_page_get_image (self) == image)
+ return;
+
if (add_to_history)
gth_image_history_add_image (self->priv->history, image, TRUE);
+
_gth_image_viewer_page_set_image (self, image, TRUE);
self->priv->image_changed = TRUE;
+
if (add_to_history)
gth_viewer_page_focus (GTH_VIEWER_PAGE (self));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]