From 49522507d46e185a92151baf304f00ed5d2fcea0 Mon Sep 17 00:00:00 2001 From: infirit Date: Fri, 25 Jul 2014 13:53:15 +0200 Subject: Store the changed status of an image file Based on oeg commit c1cc23e3c776c9b05b255c7127b4932d2d076b4e From Claudio Saavedra --- src/eom-image-private.h | 1 + src/eom-image.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/eom-image-private.h b/src/eom-image-private.h index 679774e..b0ba0f0 100644 --- a/src/eom-image-private.h +++ b/src/eom-image-private.h @@ -62,6 +62,7 @@ struct _EomImagePrivate { guint iptc_chunk_len; gboolean modified; + gboolean file_is_changed; #ifdef HAVE_EXIF gboolean autorotate; diff --git a/src/eom-image.c b/src/eom-image.c index 2eac5ea..c2fb5eb 100644 --- a/src/eom-image.c +++ b/src/eom-image.c @@ -289,6 +289,7 @@ eom_image_init (EomImage *img) img->priv->width = -1; img->priv->height = -1; img->priv->modified = FALSE; + img->priv->file_is_changed = FALSE; g_mutex_init (&img->priv->status_mutex); img->priv->status = EOM_IMAGE_STATUS_UNKNOWN; img->priv->metadata_status = EOM_IMAGE_METADATA_NOT_READ; @@ -1148,6 +1149,8 @@ eom_image_real_load (EomImage *img, priv->file_type = gdk_pixbuf_format_get_name (format); } + priv->file_is_changed = FALSE; + /* If it's non-threadsafe loader, then trigger window * showing in the end of the process. */ if (!priv->threadsafe_format) @@ -2223,12 +2226,14 @@ eom_image_get_transform (EomImage *img) * eom_image_file_changed: * @img: a #EomImage * - * Emits EomImage::file-changed signal + * Marks the image files contents as changed. Also, emits + * EomImage::file-changed signal **/ void eom_image_file_changed (EomImage *img) { g_return_if_fail (EOM_IS_IMAGE (img)); + img->priv->file_is_changed = TRUE; g_signal_emit (img, signals[SIGNAL_FILE_CHANGED], 0); } -- cgit v1.2.1