[gimp] Make it harder to "save" to foo.png.gz or "export" to foo.xcf.gz



commit 086793d040deed9fba3bee0463c078f061968137
Author: Michael Natterer <mitch gimp org>
Date:   Fri Feb 15 00:01:27 2013 +0100

    Make it harder to "save" to foo.png.gz or "export" to foo.xcf.gz
    
    Remove plain .gz .bz2 .xz from the extensions the file-compressor
    plug-in registers, and make sure is only ends up in "save_procs", so
    at least "exporting" to foo.xcf.gz is not possible any longer. With
    some effort, one can still "save" to foo.png.gz tho, but it's much
    harder now.

 app/file/file-procedure.c                  |   12 ++++++------
 plug-ins/file-compressor/file-compressor.c |    6 +++---
 2 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/app/file/file-procedure.c b/app/file/file-procedure.c
index 5c6303a..2a1c86b 100644
--- a/app/file/file-procedure.c
+++ b/app/file/file-procedure.c
@@ -238,25 +238,25 @@ file_procedure_in_group (GimpPlugInProcedure *file_proc,
   const gchar *name        = gimp_object_get_name (file_proc);
   gboolean     is_xcf_save = FALSE;
   gboolean     is_filter   = FALSE;
+  gboolean     is_uri      = FALSE;
 
   is_xcf_save = (strcmp (name, "gimp-xcf-save") == 0);
 
   is_filter   = (strcmp (name, "file-gz-save")  == 0 ||
                  strcmp (name, "file-bz2-save") == 0 ||
-                 strcmp (name, "file-xz-save")  == 0 ||
-                 strcmp (name, "file-uri-save") == 0);
+                 strcmp (name, "file-xz-save")  == 0);
+
+  is_uri      = (strcmp (name, "file-uri-save") == 0);
 
   switch (group)
     {
     case FILE_PROCEDURE_GROUP_SAVE:
       /* Only .xcf shall pass */
-      /* FIXME: Handle .gz and .bz2 properly */
-      return is_xcf_save || is_filter;
+      return is_xcf_save || is_filter || is_uri;
 
     case FILE_PROCEDURE_GROUP_EXPORT:
       /* Anything but .xcf shall pass */
-      /* FIXME: Handle .gz, .bz2 and .xz properly */
-      return ! is_xcf_save || is_filter;
+      return ! is_xcf_save || is_uri;
 
     case FILE_PROCEDURE_GROUP_OPEN:
       /* No filter applied for Open */
diff --git a/plug-ins/file-compressor/file-compressor.c b/plug-ins/file-compressor/file-compressor.c
index 0b84a8b..2109efc 100644
--- a/plug-ins/file-compressor/file-compressor.c
+++ b/plug-ins/file-compressor/file-compressor.c
@@ -174,7 +174,7 @@ static const Compressor compressors[] =
   {
     N_("gzip archive"),
     "application/x-gzip",
-    "xcf.gz,gz,xcfgz",
+    "xcf.gz,xcfgz", /* FIXME "xcf.gz,gz,xcfgz" */
     "0,string,\037\213",
     ".xcfgz",
     ".gz",
@@ -193,7 +193,7 @@ static const Compressor compressors[] =
   {
     N_("bzip archive"),
     "application/x-bzip",
-    "xcf.bz2,bz2,xcfbz2",
+    "xcf.bz2,xcfbz2", /* FIXME "xcf.bz2,bz2,xcfbz2" */
     "0,string,BZh",
     ".xcfbz2",
     ".bz2",
@@ -212,7 +212,7 @@ static const Compressor compressors[] =
   {
     N_("xz archive"),
     "application/x-xz",
-    "xcf.xz,xz,xcfxz",
+    "xcf.xz,xcfxz", /* FIXME "xcf.xz,xz,xcfxz" */
     "0,ustring,\3757zXZ\x00",
     ".xcfxz",
     ".xz",


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