[gthumb/ext] do not ask whether to save the image when reverting or deleting
- From: Paolo Bacchilega <paobac src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gthumb/ext] do not ask whether to save the image when reverting or deleting
- Date: Tue, 22 Sep 2009 09:41:15 +0000 (UTC)
commit 56f0ec660f203e247c4767a1b481715b7a95732c
Author: Paolo Bacchilega <paobac src gnome org>
Date: Tue Sep 22 11:40:02 2009 +0200
do not ask whether to save the image when reverting or deleting
[bug #589462]
extensions/image_viewer/gth-image-viewer-page.c | 5 ++++-
gthumb/gth-browser-actions-callbacks.c | 8 +++++++-
gthumb/gth-browser.c | 7 ++++---
3 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/extensions/image_viewer/gth-image-viewer-page.c b/extensions/image_viewer/gth-image-viewer-page.c
index eb82cb5..cabcb29 100644
--- a/extensions/image_viewer/gth-image-viewer-page.c
+++ b/extensions/image_viewer/gth-image-viewer-page.c
@@ -44,6 +44,7 @@ struct _GthImageViewerPagePrivate {
guint cnxn_id[GCONF_NOTIFICATIONS];
guint hide_mouse_timeout;
guint motion_signal;
+ gboolean pixbuf_changed;
};
@@ -591,7 +592,8 @@ gth_image_viewer_page_real_view (GthViewerPage *base,
g_return_if_fail (file_data != NULL);
if ((self->priv->file_data != NULL)
- && g_file_equal (file_data->file, self->priv->file_data->file))
+ && g_file_equal (file_data->file, self->priv->file_data->file)
+ && ! self->priv->pixbuf_changed)
{
return;
}
@@ -1153,6 +1155,7 @@ gth_image_viewer_page_set_pixbuf (GthImageViewerPage *self,
if (add_to_history)
gth_image_history_add_image (self->priv->history, pixbuf, TRUE);
_gth_image_viewer_page_set_pixbuf (self, pixbuf, TRUE);
+ self->priv->pixbuf_changed = TRUE;
}
diff --git a/gthumb/gth-browser-actions-callbacks.c b/gthumb/gth-browser-actions-callbacks.c
index 5da078c..ec9c101 100644
--- a/gthumb/gth-browser-actions-callbacks.c
+++ b/gthumb/gth-browser-actions-callbacks.c
@@ -91,7 +91,13 @@ void
gth_browser_activate_action_file_revert (GtkAction *action,
GthBrowser *browser)
{
- gth_browser_load_file (browser, gth_browser_get_current_file (browser), TRUE);
+ GthFileData *file_data;
+
+ file_data = gth_browser_get_current_file (browser);
+ if (file_data == NULL)
+ return;
+ g_file_info_set_attribute_boolean (file_data->info, "gth::file::is-modified", FALSE);
+ gth_browser_load_file (browser, file_data, TRUE);
}
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index 82c42b0..edb948e 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -2540,6 +2540,7 @@ folder_changed_cb (GthMonitor *monitor,
}
if (current_file_deleted) {
+ g_file_info_set_attribute_boolean (browser->priv->current_file->info, "gth::file::is-modified", FALSE);
gth_browser_load_file (browser, new_file, FALSE);
_g_object_unref (new_file);
}
@@ -3556,10 +3557,10 @@ gth_browser_get_current_file (GthBrowser *browser)
gboolean
gth_browser_get_file_modified (GthBrowser *browser)
{
- if (browser->priv->current_file == NULL)
- return FALSE;
- else
+ if (browser->priv->current_file != NULL)
return g_file_info_get_attribute_boolean (browser->priv->current_file->info, "gth::file::is-modified");
+ else
+ return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]