gimp/libgimpconfig
Michael Natterer 894cf70dd5 Added infrastructure to make sure we don't write to the global brush,
2004-01-28  Michael Natterer  <mitch@gimp.org>

	Added infrastructure to make sure we don't write to the global
	brush, pattern etc. directories. Needed to make this configurable
	because we can't rely on the global directories being read-only,
	having certain names or being otherwise detectable at runtime in a
	sane way. Fixes bug #132214.

	* libgimpbase/gimpdatafiles.[ch]: added "const gchar *dirname" to
	the GimpDataFileData struct so callbacks don't need to call
	g_path_get_dirname() for each file.

	* libgimpwidgets/gimpfileentry.c: made it work with non UTF-8
	encoded filenames.

	* libgimpwidgets/gimppatheditor.[ch]: ditto. Added GUI and API for
	setting/getting a second "writable_path". The widget makes sure
	that the writable_path is always a subset of the path.

	* app/config/gimpconfig-utils.[ch]: added new function
	gimp_config_build_writable_path().

	* app/config/gimpcoreconfig.[ch]: added separate properties for
	the writable brush, pattern, gradient, palette and font paths.

	* app/config/gimprc-blurbs.h: added (still empty) blurbs for the
	new properties.

	* app/core/gimpdata.[ch] (gimp_data_set_filename): added parameter
	"gboolean writable". Set data->writable to FALSE by default. If
	"writable" is passed as TRUE, still check if we can write to the
	file before setting data->writable to TRUE.

	(gimp_data_create_filename): changed "data_path" parameter to
	"dest_dir" and assume dest_dir is writable.

	(gimp_data_duplicate): set data->dirty to TRUE to make sure
	duplicated things will be saved.

	* app/core/gimpbrush.c
	* app/core/gimpbrushgenerated.c
	* app/core/gimpbrushpipe.c
	* app/core/gimpgradient.c
	* app/core/gimppalette.c
	* app/core/gimppattern.c: don't set the data's filename and don't
	touch data->dirty in the _load() functions because that's done by
	the data factory now. Don't touch data->dirty in the _duplicate()
	functions because that's done by gimp_data_duplicate() itself now.

	* app/core/gimpdatafactory.[ch] (gimp_data_factory_new): added
	"writable_property_name" and remember it.
	Added utility function gimp_data_factory_get_save_dir() which
	determines the directory to save new datas to.
	Added public function gimp_data_factory_data_save_single() which
	saves a single data object.
	Make sure new things get saved to the first writable directory
	as specified in preferences.

	* app/core/gimp.c (gimp_real_initialize): pass the writable_paths'
	property names to gimp_data_factory_new().

	* app/widgets/gimpdataeditor.c (gimp_data_editor_save_dirty): use
	gimp_data_factory_data_save_single() instead of implementing
	saving here.

	* app/widgets/gimppropwidgets.[ch] (gimp_prop_path_editor_new):
	added "const gchar *writable_property_name" parameter (can be
	NULL).

	Added the needed callbacks to handle the writable_path and made
	the path_editor and file_entry code aware of non UTF-8 filename
	encodings. Some general cleanup.

	* app/gui/preferences-dialog.c: changed accordingly.
2004-01-28 21:53:50 +00:00
..
gimpconfig-deserialize.c libgimpwidgets/gimpquerybox.c configure the labels in the message dialog 2003-11-14 15:33:40 +00:00
gimpconfig-deserialize.h app/widgets/gimpdocked.[ch] renamed GimpDockedIface to 2003-10-11 14:30:18 +00:00
gimpconfig-error.c app/config/Makefile.am moved code from gimpconfig.[ch] to these new files. 2003-07-24 14:14:23 +00:00
gimpconfig-error.h added GIMP_CONFIG_ERROR_VERSION to GimpConfigError enum. 2003-11-07 23:47:35 +00:00
gimpconfig-iface.c app/widgets/gimpdocked.c (gimp_docked_iface_base_init) they are base_init, 2003-10-15 20:05:23 +00:00
gimpconfig-iface.h removed gimp_config_copy_properties() and added the more intelligent 2003-10-14 15:20:59 +00:00
gimpconfig-params.h app/config/gimpscanner.c configured the scanner to use 64bit integers. 2003-11-14 13:41:16 +00:00
gimpconfig-path.c return early if gimp_config_path_expand_only() fails. 2004-01-28 14:36:22 +00:00
gimpconfig-path.h configure.in etc/Makefile.am etc/gimprc.in removed templates for gimprc 2002-12-29 18:58:24 +00:00
gimpconfig-serialize.c handle negative float and double values similar to how this is done for 2003-10-26 00:03:16 +00:00
gimpconfig-serialize.h removed function gimp_config_serialize_comment()... 2003-10-12 01:49:51 +00:00
gimpconfig-utils.c Added infrastructure to make sure we don't write to the global brush, 2004-01-28 21:53:50 +00:00
gimpconfig-utils.h Added infrastructure to make sure we don't write to the global brush, 2004-01-28 21:53:50 +00:00
gimpconfigwriter.c app/app_procs.c app/errors.c app/main.c app/config/gimpconfigwriter.c 2004-01-23 17:24:44 +00:00
gimpconfigwriter.h fixed dependencies for test-config. 2003-10-12 16:46:50 +00:00
gimpscanner.c include "libgimpbase/gimpbase.h" where needed; removed now unnecessary 2004-01-19 01:54:11 +00:00
gimpscanner.h include <libgimpmath/gimpmathtypes.h>. 2003-07-07 16:22:45 +00:00