Commit 30d2fdef authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

configure.in themes/Default/images/Makefile.am some new Makefiles to make

2001-08-06  Michael Natterer  <mitch@gimp.org>

	* configure.in
	* themes/Default/images/Makefile.am
	* themes/Default/images/tools/Makefile.am: some new Makefiles to
	make it installable.

	* Makefile.am
	* gtkrc: removed...

	* themes/Default/Makefile.am
	* themes/Default/gtkrc: ...added here.

	* themes/Default/imagerc: new file (not used, just for
	documentation) which loads the default theme's images in the same
	way the inlined pixbufs are registered with the stock system.

	* gimprc.in
	* gimprc.win32
	* user_install
	* user_install.bat
	* app/gimprc.[ch]: added "theme-path" and "theme" gimprc variables.

	* app/app_procs.c: prase gimprc before initializing the GUI.

	* app/core/gimpdatafiles.[ch]: added support for getting only
	subdirectories in the callback.

	* libgimpbase/gimpenv.c: as a temp_hack gimp_gtkrc(); returns the
	default theme's gtkrc.

	* app/gui/gui.c: build a hash of theme directories and select
	the one configured in gimprc.theme. Use gimp_gtkrc()'s default
	value if there is no theme installed or configured.

	* app/gui/preferences-dialog.c: Added theme_path to the GUI. No
	stuff for selection the theme yet.

	* app/gui/menus.c: beautify <Image>/Tools/

	* app/tools/gimpcroptool.c: register in <Image>/Tools/Transform Tools/
parent 572942f1
2001-08-06 Michael Natterer <mitch@gimp.org>
* configure.in
* themes/Default/images/Makefile.am
* themes/Default/images/tools/Makefile.am: some new Makefiles to
make it installable.
* Makefile.am
* gtkrc: removed...
* themes/Default/Makefile.am
* themes/Default/gtkrc: ...added here.
* themes/Default/imagerc: new file (not used, just for
documentation) which loads the default theme's images in the same
way the inlined pixbufs are registered with the stock system.
* gimprc.in
* gimprc.win32
* user_install
* user_install.bat
* app/gimprc.[ch]: added "theme-path" and "theme" gimprc variables.
* app/app_procs.c: prase gimprc before initializing the GUI.
* app/core/gimpdatafiles.[ch]: added support for getting only
subdirectories in the callback.
* libgimpbase/gimpenv.c: as a temp_hack gimp_gtkrc(); returns the
default theme's gtkrc.
* app/gui/gui.c: build a hash of theme directories and select
the one configured in gimprc.theme. Use gimp_gtkrc()'s default
value if there is no theme installed or configured.
* app/gui/preferences-dialog.c: Added theme_path to the GUI. No
stuff for selection the theme yet.
* app/gui/menus.c: beautify <Image>/Tools/
* app/tools/gimpcroptool.c: register in <Image>/Tools/Transform Tools/
2001-08-05 Michael Natterer <mitch@gimp.org>
* Makefile.am
......
......@@ -39,7 +39,6 @@ EXTRA_DIST = \
PLUGIN_MAINTAINERS \
MAINTAINERS \
TODO \
gtkrc \
gtkrc_user \
unitrc \
gimp_logo.ppm \
......@@ -59,7 +58,6 @@ gimpdata_DATA = \
gimpsysconf_DATA = \
gimprc \
gimprc_user \
gtkrc \
gtkrc_user \
unitrc \
ps-menurc
......
......@@ -126,11 +126,6 @@ app_init (gint gimp_argc,
}
}
if (! no_interface)
{
gui_libs_init (&gimp_argc, &gimp_argv);
}
/* The user_install dialog may have parsed unitrc and gimprc, so
* check gimprc_init()'s return value
*/
......@@ -145,6 +140,8 @@ app_init (gint gimp_argc,
if (! no_interface)
{
gui_libs_init (&gimp_argc, &gimp_argv);
get_standard_colormaps ();
if (! no_splash)
......
......@@ -165,6 +165,12 @@ gimp_datafiles_read_directories (const gchar *path_str,
{
while ((dir_ent = readdir (dir)))
{
if (! strcmp (dir_ent->d_name, ".") ||
! strcmp (dir_ent->d_name, ".."))
{
continue;
}
filename = g_strdup_printf ("%s%s",
(gchar *) list->data,
dir_ent->d_name);
......@@ -172,14 +178,21 @@ gimp_datafiles_read_directories (const gchar *path_str,
/* Check the file and see that it is not a sub-directory */
err = stat (filename, &filestat);
if (!err && S_ISREG (filestat.st_mode) &&
(!(flags & MODE_EXECUTABLE) ||
(filestat.st_mode & S_IXUSR) ||
is_script (filename)))
if (! err)
{
filestat_valid = TRUE;
(* loader_func) (filename, loader_data);
if (S_ISDIR (filestat.st_mode) && (flags & TYPE_DIRECTORY))
{
(* loader_func) (filename, loader_data);
}
else if (S_ISREG (filestat.st_mode) &&
(!(flags & MODE_EXECUTABLE) ||
(filestat.st_mode & S_IXUSR) ||
is_script (filename)))
{
(* loader_func) (filename, loader_data);
}
filestat_valid = FALSE;
}
......
......@@ -27,8 +27,8 @@
typedef enum
{
INCLUDE_TEMP_DIR = 1 << 0,
MODE_EXECUTABLE = 1 << 1
MODE_EXECUTABLE = 1 << 0,
TYPE_DIRECTORY = 1 << 1
} GimpDataFileFlags;
......
......@@ -146,6 +146,7 @@ static gchar * old_brush_path;
static gchar * old_pattern_path;
static gchar * old_palette_path;
static gchar * old_gradient_path;
static gchar * old_theme_path;
static gdouble old_monitor_xres;
static gdouble old_monitor_yres;
static gboolean old_using_xserver_resolution;
......@@ -182,6 +183,7 @@ static gchar * edit_brush_path = NULL;
static gchar * edit_pattern_path = NULL;
static gchar * edit_palette_path = NULL;
static gchar * edit_gradient_path = NULL;
static gchar * edit_theme_path = NULL;
/* variables which will be changed _after_ closing the dialog */
static guint edit_tile_cache_size;
......@@ -358,7 +360,8 @@ prefs_check_settings (void)
prefs_strcmp (old_brush_path, edit_brush_path) ||
prefs_strcmp (old_pattern_path, edit_pattern_path) ||
prefs_strcmp (old_palette_path, edit_palette_path) ||
prefs_strcmp (old_gradient_path, edit_gradient_path))
prefs_strcmp (old_gradient_path, edit_gradient_path) ||
prefs_strcmp (old_theme_path, edit_theme_path))
{
return PREFS_RESTART;
}
......@@ -489,6 +492,7 @@ prefs_save_callback (GtkWidget *widget,
gchar *save_pattern_path;
gchar *save_palette_path;
gchar *save_gradient_path;
gchar *save_theme_path;
state = prefs_check_settings ();
switch (state)
......@@ -540,6 +544,8 @@ prefs_save_callback (GtkWidget *widget,
save_palette_path = the_gimp->config->palette_path;
save_gradient_path = the_gimp->config->gradient_path;
save_theme_path = gimprc.theme_path;
if (the_gimp->config->levels_of_undo != old_levels_of_undo)
{
update = g_list_append (update, "undo-levels");
......@@ -806,6 +812,11 @@ prefs_save_callback (GtkWidget *widget,
the_gimp->config->gradient_path = edit_gradient_path;
update = g_list_append (update, "gradient-path");
}
if (prefs_strcmp (old_theme_path, edit_theme_path))
{
gimprc.theme_path = edit_theme_path;
update = g_list_append (update, "theme-path");
}
/* values which are changed on "OK" or "Save" */
if (edit_tile_cache_size != old_tile_cache_size)
......@@ -842,6 +853,8 @@ prefs_save_callback (GtkWidget *widget,
the_gimp->config->palette_path = save_palette_path;
the_gimp->config->gradient_path = save_gradient_path;
gimprc.theme_path = save_theme_path;
/* no need to restore values which are only changed on "OK" and "Save" */
g_list_free (update);
......@@ -944,6 +957,8 @@ prefs_cancel_callback (GtkWidget *widget,
prefs_strset (&edit_palette_path, old_palette_path);
prefs_strset (&edit_gradient_path, old_gradient_path);
prefs_strset (&edit_theme_path, old_theme_path);
/* no need to restore values which are only changed on "OK" and "Save" */
}
......@@ -1444,6 +1459,8 @@ preferences_dialog_create (void)
edit_pattern_path = prefs_strdup (the_gimp->config->pattern_path);
edit_palette_path = prefs_strdup (the_gimp->config->palette_path);
edit_gradient_path = prefs_strdup (the_gimp->config->gradient_path);
edit_theme_path = prefs_strdup (gimprc.theme_path);
}
/* assign edit variables for values which get changed on "OK" and "Save"
......@@ -1515,6 +1532,7 @@ preferences_dialog_create (void)
prefs_strset (&old_pattern_path, edit_pattern_path);
prefs_strset (&old_palette_path, edit_palette_path);
prefs_strset (&old_gradient_path, edit_gradient_path);
prefs_strset (&old_theme_path, edit_theme_path);
/* values which will be changed on "OK" and "Save" */
old_tile_cache_size = edit_tile_cache_size;
......@@ -2684,7 +2702,11 @@ preferences_dialog_create (void)
{ N_("Modules"), N_("Modules Directories"),
"dialogs/preferences/directories.html#modules",
N_("Select Modules Dir"),
&edit_module_path }
&edit_module_path },
{ N_("Themes"), N_("Themes Directories"),
"dialogs/preferences/directories.html#themes",
N_("Select Themes Dir"),
&edit_theme_path }
};
static gint npaths = sizeof (paths) / sizeof (paths[0]);
......
......@@ -237,7 +237,9 @@ GimpRc gimprc =
/* info_window_follows_mouse */ TRUE,
/* help_browser */ HELP_BROWSER_GIMP,
/* cursor_mode */ CURSOR_MODE_TOOL_ICON,
/* disable_tearoff_menus */ FALSE
/* disable_tearoff_menus */ FALSE,
/* theme_path */ NULL,
/* theme */ NULL
};
static GHashTable *parse_func_hash = NULL;
......@@ -358,7 +360,11 @@ static ParseFunc funcs[] =
{ "cursor-mode", TT_XCURSORMODE,
&(gimprc.cursor_mode), NULL },
{ "disable-tearoff-menus", TT_BOOLEAN,
&(gimprc.disable_tearoff_menus), NULL }
&(gimprc.disable_tearoff_menus), NULL },
{ "theme-path", TT_PATH,
&(gimprc.theme_path), NULL },
{ "theme", TT_STRING,
&(gimprc.theme), NULL }
};
static gint n_funcs = (sizeof (funcs) /
sizeof (funcs[0]));
......
......@@ -64,6 +64,8 @@ struct _GimpRc
gint help_browser;
gint cursor_mode;
gboolean disable_tearoff_menus;
gchar *theme_path;
gchar *theme;
};
extern GimpRc gimprc;
......
......@@ -31,6 +31,7 @@
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpdatafiles.h"
#include "core/gimpimage.h"
#include "widgets/gimpdialogfactory.h"
......@@ -119,35 +120,88 @@ static GQuark image_size_changed_handler_id = 0;
static GQuark image_alpha_changed_handler_id = 0;
static GQuark image_update_handler_id = 0;
static GHashTable *themes_hash = NULL;
/* public functions */
static void
gui_themes_dir_foreach_func (const gchar *filename,
gpointer loader_data)
{
GHashTable *hash;
gchar *basename;
hash = (GHashTable *) loader_data;
basename = g_path_get_basename (filename);
if (be_verbose)
g_print (_("adding theme \"%s\" (%s)\n"), basename, filename);
g_hash_table_insert (hash,
basename,
g_strdup (filename));
}
void
gui_libs_init (gint *argc,
gchar ***argv)
{
const gchar *gtkrc;
gchar *filename;
gchar *theme_dir;
gchar *gtkrc;
gimp_stock_init ();
/* parse the systemwide gtkrc */
gtkrc = gimp_gtkrc ();
themes_hash = g_hash_table_new_full (g_str_hash,
g_str_equal,
g_free,
g_free);
if (gimprc.theme_path)
{
gimp_datafiles_read_directories (gimprc.theme_path,
TYPE_DIRECTORY,
gui_themes_dir_foreach_func,
themes_hash);
}
if (gimprc.theme)
theme_dir = g_hash_table_lookup (themes_hash, gimprc.theme);
else
theme_dir = g_hash_table_lookup (themes_hash, "Default");
if (theme_dir)
{
gtkrc = g_strconcat (theme_dir,
G_DIR_SEPARATOR_S,
"gtkrc",
NULL);
}
else
{
/* get the hardcoded default theme gtkrc */
gtkrc = g_strdup (gimp_gtkrc ());
}
if (be_verbose)
g_print (_("parsing \"%s\"\n"), gtkrc);
gtk_rc_parse (gtkrc);
g_free (gtkrc);
/* parse the user gtkrc */
filename = gimp_personal_rc_file ("gtkrc");
gtkrc = gimp_personal_rc_file ("gtkrc");
if (be_verbose)
g_print (_("parsing \"%s\"\n"), filename);
g_print (_("parsing \"%s\"\n"), gtkrc);
gtk_rc_parse (filename);
gtk_rc_parse (gtkrc);
g_free (filename);
g_free (gtkrc);
}
void
......@@ -321,6 +375,12 @@ gui_exit (Gimp *gimp)
image_size_changed_handler_id = 0;
image_alpha_changed_handler_id = 0;
image_update_handler_id = 0;
if (themes_hash)
{
g_hash_table_destroy (themes_hash);
themes_hash = NULL;
}
}
void
......
......@@ -778,6 +778,10 @@ static GimpItemFactoryEntry image_entries[] =
SEPARATOR ("/Tools/---"),
BRANCH (N_("/Tools/Selection Tools")),
BRANCH (N_("/Tools/Paint Tools")),
BRANCH (N_("/Tools/Transform Tools")),
/* <Image>/Dialogs */
{ { N_("/Dialogs/Layers, Channels & Paths..."), "<control>L",
......
......@@ -146,6 +146,7 @@ static gchar * old_brush_path;
static gchar * old_pattern_path;
static gchar * old_palette_path;
static gchar * old_gradient_path;
static gchar * old_theme_path;
static gdouble old_monitor_xres;
static gdouble old_monitor_yres;
static gboolean old_using_xserver_resolution;
......@@ -182,6 +183,7 @@ static gchar * edit_brush_path = NULL;
static gchar * edit_pattern_path = NULL;
static gchar * edit_palette_path = NULL;
static gchar * edit_gradient_path = NULL;
static gchar * edit_theme_path = NULL;
/* variables which will be changed _after_ closing the dialog */
static guint edit_tile_cache_size;
......@@ -358,7 +360,8 @@ prefs_check_settings (void)
prefs_strcmp (old_brush_path, edit_brush_path) ||
prefs_strcmp (old_pattern_path, edit_pattern_path) ||
prefs_strcmp (old_palette_path, edit_palette_path) ||
prefs_strcmp (old_gradient_path, edit_gradient_path))
prefs_strcmp (old_gradient_path, edit_gradient_path) ||
prefs_strcmp (old_theme_path, edit_theme_path))
{
return PREFS_RESTART;
}
......@@ -489,6 +492,7 @@ prefs_save_callback (GtkWidget *widget,
gchar *save_pattern_path;
gchar *save_palette_path;
gchar *save_gradient_path;
gchar *save_theme_path;
state = prefs_check_settings ();
switch (state)
......@@ -540,6 +544,8 @@ prefs_save_callback (GtkWidget *widget,
save_palette_path = the_gimp->config->palette_path;
save_gradient_path = the_gimp->config->gradient_path;
save_theme_path = gimprc.theme_path;
if (the_gimp->config->levels_of_undo != old_levels_of_undo)
{
update = g_list_append (update, "undo-levels");
......@@ -806,6 +812,11 @@ prefs_save_callback (GtkWidget *widget,
the_gimp->config->gradient_path = edit_gradient_path;
update = g_list_append (update, "gradient-path");
}
if (prefs_strcmp (old_theme_path, edit_theme_path))
{
gimprc.theme_path = edit_theme_path;
update = g_list_append (update, "theme-path");
}
/* values which are changed on "OK" or "Save" */
if (edit_tile_cache_size != old_tile_cache_size)
......@@ -842,6 +853,8 @@ prefs_save_callback (GtkWidget *widget,
the_gimp->config->palette_path = save_palette_path;
the_gimp->config->gradient_path = save_gradient_path;
gimprc.theme_path = save_theme_path;
/* no need to restore values which are only changed on "OK" and "Save" */
g_list_free (update);
......@@ -944,6 +957,8 @@ prefs_cancel_callback (GtkWidget *widget,
prefs_strset (&edit_palette_path, old_palette_path);
prefs_strset (&edit_gradient_path, old_gradient_path);
prefs_strset (&edit_theme_path, old_theme_path);
/* no need to restore values which are only changed on "OK" and "Save" */
}
......@@ -1444,6 +1459,8 @@ preferences_dialog_create (void)
edit_pattern_path = prefs_strdup (the_gimp->config->pattern_path);
edit_palette_path = prefs_strdup (the_gimp->config->palette_path);
edit_gradient_path = prefs_strdup (the_gimp->config->gradient_path);
edit_theme_path = prefs_strdup (gimprc.theme_path);
}
/* assign edit variables for values which get changed on "OK" and "Save"
......@@ -1515,6 +1532,7 @@ preferences_dialog_create (void)
prefs_strset (&old_pattern_path, edit_pattern_path);
prefs_strset (&old_palette_path, edit_palette_path);
prefs_strset (&old_gradient_path, edit_gradient_path);
prefs_strset (&old_theme_path, edit_theme_path);
/* values which will be changed on "OK" and "Save" */
old_tile_cache_size = edit_tile_cache_size;
......@@ -2684,7 +2702,11 @@ preferences_dialog_create (void)
{ N_("Modules"), N_("Modules Directories"),
"dialogs/preferences/directories.html#modules",
N_("Select Modules Dir"),
&edit_module_path }
&edit_module_path },
{ N_("Themes"), N_("Themes Directories"),
"dialogs/preferences/directories.html#themes",
N_("Select Themes Dir"),
&edit_theme_path }
};
static gint npaths = sizeof (paths) / sizeof (paths[0]);
......
......@@ -778,6 +778,10 @@ static GimpItemFactoryEntry image_entries[] =
SEPARATOR ("/Tools/---"),
BRANCH (N_("/Tools/Selection Tools")),
BRANCH (N_("/Tools/Paint Tools")),
BRANCH (N_("/Tools/Transform Tools")),
/* <Image>/Dialogs */
{ { N_("/Dialogs/Layers, Channels & Paths..."), "<control>L",
......
......@@ -174,7 +174,7 @@ gimp_crop_tool_register (Gimp *gimp)
"gimp:crop_tool",
_("Crop Tool"),
_("Crop or Resize an image"),
N_("/Tools/Crop Tool"), "<shift>C",
N_("/Tools/Transform Tools/Crop Tool"), "<shift>C",
NULL, "tools/crop_tool.html",
GIMP_STOCK_TOOL_CROP);
}
......
......@@ -778,6 +778,10 @@ static GimpItemFactoryEntry image_entries[] =
SEPARATOR ("/Tools/---"),
BRANCH (N_("/Tools/Selection Tools")),
BRANCH (N_("/Tools/Paint Tools")),
BRANCH (N_("/Tools/Transform Tools")),
/* <Image>/Dialogs */
{ { N_("/Dialogs/Layers, Channels & Paths..."), "<control>L",
......
......@@ -809,7 +809,7 @@ AC_SUBST(GIMP_THREAD_LIBS)
AC_SUBST(GIMP_MP_FLAGS)
AC_SUBST(GIMP_MP_LIBS)
AC_SUBST(GIMP_PERL)
AC_SUBST(GIMP_PERL_PO)
AC_SUBST(GIMP_PERL_PO)
AC_SUBST(GIMPINSTALL)
AC_SUBST(HELPBROWSER)
AC_SUBST(GTKXMHTML_CFLAGS)
......@@ -835,6 +835,14 @@ gimptool-1.4
gimptool.1
gimp-remote.1
gimp.spec
Makefile
build/Makefile
build/win32/Makefile
intl/Makefile
tools/Makefile
tools/authorsgen/Makefile
tools/pdbgen/Makefile
regexrepl/Makefile
libgimp/Makefile
libgimp/makefile.mingw
libgimpbase/gimpversion.h
......@@ -901,7 +909,6 @@ plug-ins/sgi/Makefile
plug-ins/plugin-helper/Makefile
modules/Makefile
modules/makefile.mingw
cursors/Makefile
devel-docs/Makefile
devel-docs/libgimp/Makefile
devel-docs/libgimpbase/Makefile
......@@ -909,28 +916,23 @@ devel-docs/libgimpcolor/Makefile
devel-docs/libgimpmath/Makefile
devel-docs/libgimpwidgets/Makefile
docs/Makefile
tips/Makefile
pixmaps/Makefile
cursors/Makefile
themes/Makefile
themes/Default/Makefile
themes/Default/images/Makefile
themes/Default/images/tools/Makefile
data/Makefile
data/brushes/Makefile
data/gradients/Makefile
data/palettes/Makefile
data/patterns/Makefile
Makefile
build/Makefile
build/win32/Makefile
po/Makefile.in
po-libgimp/Makefile.in
plug-ins/perl/po/Makefile.in
po-plug-ins/Makefile.in
po-script-fu/Makefile.in
intl/Makefile
regexrepl/Makefile
tools/Makefile
tools/authorsgen/Makefile
tools/pdbgen/Makefile
tips/Makefile],
plug-ins/perl/po/Makefile.in],
[
chmod +x gimptool-1.4
sed -e "s/^ ..\/..\/..\// ..\//" plug-ins/perl/po/Makefile > plug-ins/perl/po/Makefile.eek && mv plug-ins/perl/po/Makefile.eek plug-ins/perl/po/Makefile
......
......@@ -22,6 +22,8 @@ cp $3/unitrc $2/unitrc
echo "cp $3/gtkrc_user $2/gtkrc"
cp $3/gtkrc_user $2/gtkrc
echo "mkdir $2/themes"
mkdir $2/themes
echo "mkdir $2/brushes"
mkdir $2/brushes
echo "mkdir $2/gradients"
......
......@@ -4,6 +4,7 @@ mkdir %2
copy %3\gimprc_user %2\gimprc
copy %3\unitrc %2\unitrc
copy %3\gtkrc_user %2\gtkrc
mkdir %2\themes
mkdir %2\brushes
mkdir %2\gradients
mkdir %2\palettes
......
......@@ -76,6 +76,12 @@
# Set the path to modules that are to be initialized at startup
(module-path "${gimp_dir}/modules:${gimp_plugin_dir}/modules")
# Specify a theme for the GUI. If none is specified it defaults to "Default"
(theme "Default")
# Set the theme path.
(theme-path "${gimp_dir}/themes:${gimp_data_dir}/themes")
# The tile cache is used to make sure the gimp doesn't thrash
# tiles between memory and disk. Setting this value higher will
# cause the gimp to use less swap space, but will also cause
......
......@@ -85,6 +85,12 @@
# Set the path to modules that are to be initialized at startup
(module-path "${gimp_dir}\\modules;${gimp_plugin_dir}\\modules")
# Specify a theme for the GUI. If none is specified it defaults to "Default"
(theme "Default")
# Set the theme path.
(theme-path "${gimp_dir}\\themes:${gimp_data_dir}\\themes")
# The tile cache is used to make sure the gimp doesn't thrash
# tiles between memory and disk. Setting this value higher will
# cause the gimp to use less swap space, but will also cause
......
......@@ -76,6 +76,12 @@
# Set the path to modules that are to be initialized at startup
(module-path "${gimp_dir}/modules:${gimp_plugin_dir}/modules")
# Specify a theme for the GUI. If none is specified it defaults to "Default"
(theme "Default")
# Set the theme path.
(theme-path "${gimp_dir}/themes:${gimp_data_dir}/themes")
# The tile cache is used to make sure the gimp doesn't thrash
# tiles between memory and disk. Setting this value higher will
# cause the gimp to use less swap space, but will also cause
......
......@@ -85,6 +85,12 @@
# Set the path to modules that are to be initialized at startup
(module-path "${gimp_dir}\\modules;${gimp_plugin_dir}\\modules")
# Specify a theme for the GUI. If none is specified it defaults to "Default"
(theme "Default")
# Set the theme path.
(theme-path "${gimp_dir}\\themes:${gimp_data_dir}\\themes")
# The tile cache is used to make sure the gimp doesn't thrash
# tiles between memory and disk. Setting this value higher will
# cause the gimp to use less swap space, but will also cause
......
......@@ -165,6 +165,12 @@ gimp_datafiles_read_directories (const gchar *path_str,
{
while ((dir_ent = readdir (dir)))
{
if (! strcmp (dir_ent->d_name, ".") ||
! strcmp (dir_ent->d_name, ".."))
{
continue;
}
filename = g_strdup_printf ("%s%s",
(gchar *) list->data,
dir_ent->d_name);
......@@ -172,14 +178,21 @@ gimp_datafiles_read_directories (const gchar *path_str,
/* Check the file and see that it is not a sub-directory */
err = stat (filename, &filestat);
if (!err && S_ISREG (filestat.st_mode) &&
(!(flags & MODE_EXECUTABLE) ||
(filestat.st_mode & S_IXUSR) ||
is_script (filename)))
if (! err)
{
filestat_valid = TRUE;
(* loader_func) (filename, loader_data);
if (S_ISDIR (filestat.st_mode) && (flags & TYPE_DIRECTORY))
{
(* loader_func) (filename, loader_data);
}
else if (S_ISREG (filestat.st_mode) &&
(!(flags & MODE_EXECUTABLE) ||
(filestat.st_mode & S_IXUSR) ||
is_script (filename)))
{
(* loader_func) (filename, loader_data);
}