declare default_value as const and allocate a copy.
2005-04-06 Sven Neumann <sven@gimp.org> * libgimpconfig/gimpconfig-path.[ch] (gimp_param_spec_config_path): declare default_value as const and allocate a copy. * app/config/gimpbaseconfig.[ch]: gives access to the default values for temp and swap path. * app/base/base.c (base_init): create the temp directory if it doesn't exist (bug #172682). * plug-ins/uri/uri-backend-gnomevfs.c: fixed path in error message.
This commit is contained in:

committed by
Sven Neumann

parent
24cb9a5d7a
commit
e79099db0d
13
ChangeLog
13
ChangeLog
@ -1,3 +1,16 @@
|
|||||||
|
2005-04-06 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* libgimpconfig/gimpconfig-path.[ch] (gimp_param_spec_config_path):
|
||||||
|
declare default_value as const and allocate a copy.
|
||||||
|
|
||||||
|
* app/config/gimpbaseconfig.[ch]: gives access to the default values
|
||||||
|
for temp and swap path.
|
||||||
|
|
||||||
|
* app/base/base.c (base_init): create the temp directory if it
|
||||||
|
doesn't exist (bug #172682).
|
||||||
|
|
||||||
|
* plug-ins/uri/uri-backend-gnomevfs.c: fixed path in error message.
|
||||||
|
|
||||||
2005-04-06 Sven Neumann <sven@gimp.org>
|
2005-04-06 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* docs/Makefile.am: install a link to the gimp(1) man-page for
|
* docs/Makefile.am: install a link to the gimp(1) man-page for
|
||||||
|
@ -72,6 +72,7 @@ base_init (GimpBaseConfig *config,
|
|||||||
gboolean use_cpu_accel)
|
gboolean use_cpu_accel)
|
||||||
{
|
{
|
||||||
gboolean swap_is_ok;
|
gboolean swap_is_ok;
|
||||||
|
gchar *temp_dir;
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_BASE_CONFIG (config), FALSE);
|
g_return_val_if_fail (GIMP_IS_BASE_CONFIG (config), FALSE);
|
||||||
g_return_val_if_fail (base_config == NULL, FALSE);
|
g_return_val_if_fail (base_config == NULL, FALSE);
|
||||||
@ -87,12 +88,30 @@ base_init (GimpBaseConfig *config,
|
|||||||
|
|
||||||
/* Add the swap file */
|
/* Add the swap file */
|
||||||
if (! config->swap_path)
|
if (! config->swap_path)
|
||||||
g_object_set (config, "swap_path", "${gimp_dir}", NULL);
|
g_object_set (config,
|
||||||
|
"swap-path", gimp_base_config_default_swap_path,
|
||||||
|
NULL);
|
||||||
|
|
||||||
tile_swap_init (config->swap_path);
|
tile_swap_init (config->swap_path);
|
||||||
|
|
||||||
swap_is_ok = tile_swap_test ();
|
swap_is_ok = tile_swap_test ();
|
||||||
|
|
||||||
|
/* create the temp directory if it doesn't exist */
|
||||||
|
if (! config->temp_path)
|
||||||
|
g_object_set (config,
|
||||||
|
"temp-path", gimp_base_config_default_temp_path,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
temp_dir = gimp_config_path_expand (config->temp_path, TRUE, NULL);
|
||||||
|
|
||||||
|
if (! g_file_test (temp_dir, G_FILE_TEST_EXISTS))
|
||||||
|
g_mkdir (temp_dir,
|
||||||
|
S_IRUSR | S_IXUSR | S_IWUSR |
|
||||||
|
S_IRGRP | S_IXGRP |
|
||||||
|
S_IROTH | S_IXOTH);
|
||||||
|
|
||||||
|
g_free (temp_dir);
|
||||||
|
|
||||||
pixel_processor_init (config->num_processors);
|
pixel_processor_init (config->num_processors);
|
||||||
g_signal_connect (config, "notify::num-processors",
|
g_signal_connect (config, "notify::num-processors",
|
||||||
G_CALLBACK (base_num_processors_notify),
|
G_CALLBACK (base_num_processors_notify),
|
||||||
|
@ -36,6 +36,11 @@
|
|||||||
#include "gimp-intl.h"
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
|
const gchar *gimp_base_config_default_swap_path = "${gimp_dir}";
|
||||||
|
const gchar *gimp_base_config_default_temp_path =
|
||||||
|
"${gimp_dir}" G_DIR_SEPARATOR_S "tmp";
|
||||||
|
|
||||||
|
|
||||||
static void gimp_base_config_class_init (GimpBaseConfigClass *klass);
|
static void gimp_base_config_class_init (GimpBaseConfigClass *klass);
|
||||||
static void gimp_base_config_finalize (GObject *object);
|
static void gimp_base_config_finalize (GObject *object);
|
||||||
static void gimp_base_config_set_property (GObject *object,
|
static void gimp_base_config_set_property (GObject *object,
|
||||||
@ -105,12 +110,12 @@ gimp_base_config_class_init (GimpBaseConfigClass *klass)
|
|||||||
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_TEMP_PATH,
|
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_TEMP_PATH,
|
||||||
"temp-path", TEMP_PATH_BLURB,
|
"temp-path", TEMP_PATH_BLURB,
|
||||||
GIMP_CONFIG_PATH_DIR,
|
GIMP_CONFIG_PATH_DIR,
|
||||||
"${gimp_dir}" G_DIR_SEPARATOR_S "tmp",
|
gimp_base_config_default_temp_path,
|
||||||
GIMP_CONFIG_PARAM_RESTART);
|
GIMP_CONFIG_PARAM_RESTART);
|
||||||
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_SWAP_PATH,
|
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_SWAP_PATH,
|
||||||
"swap-path", SWAP_PATH_BLURB,
|
"swap-path", SWAP_PATH_BLURB,
|
||||||
GIMP_CONFIG_PATH_DIR,
|
GIMP_CONFIG_PATH_DIR,
|
||||||
"${gimp_dir}",
|
gimp_base_config_default_swap_path,
|
||||||
GIMP_CONFIG_PARAM_RESTART);
|
GIMP_CONFIG_PARAM_RESTART);
|
||||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_STINGY_MEMORY_USE,
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_STINGY_MEMORY_USE,
|
||||||
"stingy-memory-use",
|
"stingy-memory-use",
|
||||||
|
@ -51,6 +51,10 @@ struct _GimpBaseConfigClass
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
extern const gchar *gimp_base_config_default_swap_path;
|
||||||
|
extern const gchar *gimp_base_config_default_temp_path;
|
||||||
|
|
||||||
|
|
||||||
GType gimp_base_config_get_type (void) G_GNUC_CONST;
|
GType gimp_base_config_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ gimp_param_spec_config_path (const gchar *name,
|
|||||||
const gchar *nick,
|
const gchar *nick,
|
||||||
const gchar *blurb,
|
const gchar *blurb,
|
||||||
GimpConfigPathType type,
|
GimpConfigPathType type,
|
||||||
gchar *default_value,
|
const gchar *default_value,
|
||||||
GParamFlags flags)
|
GParamFlags flags)
|
||||||
{
|
{
|
||||||
GParamSpecString *pspec;
|
GParamSpecString *pspec;
|
||||||
@ -146,7 +146,7 @@ gimp_param_spec_config_path (const gchar *name,
|
|||||||
pspec = g_param_spec_internal (GIMP_TYPE_PARAM_CONFIG_PATH,
|
pspec = g_param_spec_internal (GIMP_TYPE_PARAM_CONFIG_PATH,
|
||||||
name, nick, blurb, flags);
|
name, nick, blurb, flags);
|
||||||
|
|
||||||
pspec->default_value = default_value;
|
pspec->default_value = g_strdup (default_value);
|
||||||
|
|
||||||
GIMP_PARAM_SPEC_CONFIG_PATH (pspec)->type = type;
|
GIMP_PARAM_SPEC_CONFIG_PATH (pspec)->type = type;
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ GParamSpec * gimp_param_spec_config_path (const gchar *name,
|
|||||||
const gchar *nick,
|
const gchar *nick,
|
||||||
const gchar *blurb,
|
const gchar *blurb,
|
||||||
GimpConfigPathType type,
|
GimpConfigPathType type,
|
||||||
gchar *default_value,
|
const gchar *default_value,
|
||||||
GParamFlags flags);
|
GParamFlags flags);
|
||||||
|
|
||||||
GimpConfigPathType gimp_param_spec_config_path_type (GParamSpec *pspec);
|
GimpConfigPathType gimp_param_spec_config_path_type (GParamSpec *pspec);
|
||||||
|
@ -213,7 +213,7 @@ copy_uri (const gchar *src_uri,
|
|||||||
{
|
{
|
||||||
g_set_error (error, 0, 0,
|
g_set_error (error, 0, 0,
|
||||||
_("Could not open '%s' for writing: %s"),
|
_("Could not open '%s' for writing: %s"),
|
||||||
src_uri, gnome_vfs_result_to_string (result));
|
dest_uri, gnome_vfs_result_to_string (result));
|
||||||
gnome_vfs_close (read_handle);
|
gnome_vfs_close (read_handle);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user