[gthumb] image viewer: fixed undo after reverting to last saved image
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] image viewer: fixed undo after reverting to last saved image
- Date: Sun, 24 Nov 2019 12:36:35 +0000 (UTC)
commit 86636f6c3ea5b1f7d2dea29febcc89657cd5c687
Author: Paolo Bacchilega <paobac src gnome org>
Date: Fri Nov 22 10:11:51 2019 +0100
image viewer: fixed undo after reverting to last saved image
Add back the image to the history.
extensions/image_viewer/gth-image-viewer-page.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/extensions/image_viewer/gth-image-viewer-page.c b/extensions/image_viewer/gth-image-viewer-page.c
index c8efc3e3..ddec2092 100644
--- a/extensions/image_viewer/gth-image-viewer-page.c
+++ b/extensions/image_viewer/gth-image-viewer-page.c
@@ -1910,13 +1910,22 @@ static void
gth_image_viewer_page_real_revert (GthViewerPage *base)
{
GthImageViewerPage *self = GTH_IMAGE_VIEWER_PAGE (base);
- GthImageData *idata;
+ GthImageData *last_saved;
- idata = gth_image_history_revert (self->priv->history);
- if (idata != NULL) {
- _gth_image_viewer_page_set_image (self, idata->image, idata->requested_size, idata->unsaved);
- gth_image_data_unref (idata);
- }
+ last_saved = gth_image_history_revert (self->priv->history);
+ if (last_saved == NULL)
+ return;
+
+ gth_image_history_add_image (self->priv->history,
+ last_saved->image,
+ last_saved->requested_size,
+ last_saved->unsaved);
+ _gth_image_viewer_page_set_image (self,
+ last_saved->image,
+ last_saved->requested_size,
+ last_saved->unsaved);
+
+ gth_image_data_unref (last_saved);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]