[eog] Store the changed status of an image file



commit c1cc23e3c776c9b05b255c7127b4932d2d076b4e
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Mon Sep 13 18:35:24 2010 +0300

    Store the changed status of an image file

 src/eog-image-private.h |    1 +
 src/eog-image.c         |    7 ++++++-
 2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/eog-image-private.h b/src/eog-image-private.h
index 3bf2e54..c34330b 100644
--- a/src/eog-image-private.h
+++ b/src/eog-image-private.h
@@ -62,6 +62,7 @@ struct _EogImagePrivate {
 	guint             iptc_chunk_len;
 
 	gboolean          modified;
+	gboolean          file_is_changed;
 
 #ifdef HAVE_EXIF
 	gboolean          autorotate;
diff --git a/src/eog-image.c b/src/eog-image.c
index 6d72b5a..4fbfdec 100644
--- a/src/eog-image.c
+++ b/src/eog-image.c
@@ -292,6 +292,7 @@ eog_image_init (EogImage *img)
 	img->priv->width = -1;
 	img->priv->height = -1;
 	img->priv->modified = FALSE;
+	img->priv->file_is_changed = FALSE;
 	img->priv->status_mutex = g_mutex_new ();
 	img->priv->status = EOG_IMAGE_STATUS_UNKNOWN;
         img->priv->metadata_status = EOG_IMAGE_METADATA_NOT_READ;
@@ -1151,6 +1152,8 @@ eog_image_real_load (EogImage *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)
@@ -2226,12 +2229,14 @@ eog_image_get_transform (EogImage *img)
  * eog_image_file_changed:
  * @img: a #EogImage
  *
- * Emits EogImage::file-changed signal
+ * Marks the image file contents as changed. Also, emits
+ * EogImage::file-changed signal.
  **/
 void
 eog_image_file_changed (EogImage *img)
 {
 	g_return_if_fail (EOG_IS_IMAGE (img));
 
+	img->priv->file_is_changed = TRUE;
 	g_signal_emit (img, signals[SIGNAL_FILE_CHANGED], 0);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]