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.
This commit is contained in:
Michael Natterer 2013-02-15 00:01:27 +01:00
parent 1ba0cfbf38
commit 086793d040
2 changed files with 9 additions and 9 deletions

View File

@ -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 */

View File

@ -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",