try to substitute paths of the form ${foo} in the unknown token value.

2002-11-18  Sven Neumann  <neo@wintermute>

	* app/config/gimpconfig.c (gimp_config_add_unknown_token): try to
	substitute paths of the form ${foo} in the unknown token value.

	* data/environ/Makefile.am: fixed a comment.
This commit is contained in:
Sven Neumann 2002-11-18 19:32:57 +00:00 committed by Sven Neumann
parent e90728cfe6
commit 79101957a2
4 changed files with 28 additions and 5 deletions

View File

@ -1,8 +1,13 @@
2002-11-18 Sven Neumann <neo@wintermute>
* app/config/gimpconfig.c (gimp_config_add_unknown_token): try to
substitute paths of the form ${foo} in the unknown token value.
* app/config/gimpconfig-deserialize.c (gimp_config_deserialize_enum):
allow numbers when deserializing enum values.
* data/environ/Makefile.am: fixed a comment.
2002-11-18 Sven Neumann <sven@gimp.org>
* data/images/Makefile.am

View File

@ -42,6 +42,7 @@
#include "gimpconfig.h"
#include "gimpconfig-serialize.h"
#include "gimpconfig-deserialize.h"
#include "gimpconfig-substitute.h"
#include "gimpconfig-utils.h"
#include "gimpscanner.h"
@ -479,10 +480,13 @@ gimp_config_add_unknown_token (GObject *object,
GSList *unknown_tokens;
GSList *last;
GSList *list;
gchar *dup_value;
g_return_if_fail (G_IS_OBJECT (object));
g_return_if_fail (key != NULL);
dup_value = value ? gimp_config_substitute_path (object, value, TRUE) : NULL;
unknown_tokens = (GSList *) g_object_get_data (object,
GIMP_CONFIG_UNKNOWN_TOKENS);
@ -495,9 +499,10 @@ gimp_config_add_unknown_token (GObject *object,
if (strcmp (token->key, key) == 0)
{
g_free (token->value);
if (value)
{
token->value = g_strdup (value);
token->value = dup_value;
}
else
{
@ -508,13 +513,17 @@ gimp_config_add_unknown_token (GObject *object,
unknown_tokens,
(GDestroyNotify) gimp_config_destroy_unknown_tokens);
}
return;
}
}
if (!value)
return;
token = g_new (GimpConfigToken, 1);
token->key = g_strdup (key);
token->value = g_strdup (value);
token->value = dup_value;
if (last)
{

View File

@ -1,4 +1,4 @@
## Makefile.am for gimp/etc
## Makefile.am for gimp/app/environ
environdir = $(gimpplugindir)/environ

View File

@ -42,6 +42,7 @@
#include "gimpconfig.h"
#include "gimpconfig-serialize.h"
#include "gimpconfig-deserialize.h"
#include "gimpconfig-substitute.h"
#include "gimpconfig-utils.h"
#include "gimpscanner.h"
@ -479,10 +480,13 @@ gimp_config_add_unknown_token (GObject *object,
GSList *unknown_tokens;
GSList *last;
GSList *list;
gchar *dup_value;
g_return_if_fail (G_IS_OBJECT (object));
g_return_if_fail (key != NULL);
dup_value = value ? gimp_config_substitute_path (object, value, TRUE) : NULL;
unknown_tokens = (GSList *) g_object_get_data (object,
GIMP_CONFIG_UNKNOWN_TOKENS);
@ -495,9 +499,10 @@ gimp_config_add_unknown_token (GObject *object,
if (strcmp (token->key, key) == 0)
{
g_free (token->value);
if (value)
{
token->value = g_strdup (value);
token->value = dup_value;
}
else
{
@ -508,13 +513,17 @@ gimp_config_add_unknown_token (GObject *object,
unknown_tokens,
(GDestroyNotify) gimp_config_destroy_unknown_tokens);
}
return;
}
}
if (!value)
return;
token = g_new (GimpConfigToken, 1);
token->key = g_strdup (key);
token->value = g_strdup (value);
token->value = dup_value;
if (last)
{