[gimp: 17/27] app: Remember last export URI for each image



commit 72bc3aeed33a3f4d577c5f45a18ae4a69b566907
Author: Martin Nordholts <martinn src gnome org>
Date:   Sun May 3 10:07:13 2009 +0200

    app: Remember last export URI for each image
---
 app/dialogs/file-save-dialog.c |   25 +++++++++++++++++++------
 app/file/gimp-file.h           |    2 ++
 2 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/app/dialogs/file-save-dialog.c b/app/dialogs/file-save-dialog.c
index a973bc7..2913c94 100644
--- a/app/dialogs/file-save-dialog.c
+++ b/app/dialogs/file-save-dialog.c
@@ -211,13 +211,26 @@ file_save_dialog_response (GtkWidget *save_dialog,
             }
 
           if (! dialog->export)
-            g_object_set_data_full (G_OBJECT (dialog->image->gimp),
-                                    GIMP_FILE_SAVE_LAST_URI_KEY,
-                                    g_strdup (uri), (GDestroyNotify) g_free);
+            {
+              g_object_set_data_full (G_OBJECT (dialog->image->gimp),
+                                      GIMP_FILE_SAVE_LAST_URI_KEY,
+                                      g_strdup (uri), (GDestroyNotify) g_free);
+            }
           else
-            g_object_set_data_full (G_OBJECT (dialog->image->gimp),
-                                    GIMP_FILE_EXPORT_LAST_URI_KEY,
-                                    g_strdup (uri), (GDestroyNotify) g_free);
+            {
+              g_object_set_data_full (G_OBJECT (dialog->image->gimp),
+                                      GIMP_FILE_EXPORT_LAST_URI_KEY,
+                                      g_strdup (uri), (GDestroyNotify) g_free);
+
+              /* Remeber the last entered Export URI for the image. We
+               * only need to do this explicitly when exporting. It
+               * happens implicitly when saving since the GimpObject name
+               * of a GimpImage is the last-save URI
+               */
+              g_object_set_data_full (G_OBJECT (dialog->image),
+                                      GIMP_FILE_EXPORT_URI_KEY,
+                                      g_strdup (uri), (GDestroyNotify) g_free);
+            }
 
           g_object_set_data_full (G_OBJECT (dialog->image->gimp),
                                   GIMP_FILE_SAVE_LAST_URI_KEY,
diff --git a/app/file/gimp-file.h b/app/file/gimp-file.h
index 5044107..072f0c5 100644
--- a/app/file/gimp-file.h
+++ b/app/file/gimp-file.h
@@ -27,9 +27,11 @@
 #define GIMP_FILE_EXPORT_LAST_URI_KEY   "gimp-file-export-last-uri"
 
 /* Data keys for GimpImage */
+#define GIMP_FILE_EXPORT_URI_KEY        "gimp-file-export-uri"
 #define GIMP_FILE_SAVE_A_COPY_URI_KEY   "gimp-file-save-a-copy-uri"
 #define GIMP_FILE_EXPORT_TO_URI_KEY     "gimp-file-export-to-uri"
 #define GIMP_FILE_IMPORT_SOURCE_URI_KEY "gimp-file-import-source-uri"
 
 
+
 #endif /* __GIMP_FILE_H__ */



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