app: add --verbose output to GimpInterpreterDB and GimpEnvironTable

This commit is contained in:
Michael Natterer 2014-07-14 22:55:53 +02:00
parent 06b2dd35c2
commit 08fdf55fe1
5 changed files with 27 additions and 38 deletions

View File

@ -81,10 +81,6 @@ gimp_environ_table_class_init (GimpEnvironTableClass *class)
static void
gimp_environ_table_init (GimpEnvironTable *environ_table)
{
environ_table->vars = NULL;
environ_table->internal = NULL;
environ_table->envp = NULL;
}
static void
@ -98,9 +94,13 @@ gimp_environ_table_finalize (GObject *object)
}
GimpEnvironTable *
gimp_environ_table_new (void)
gimp_environ_table_new (gboolean verbose)
{
return g_object_new (GIMP_TYPE_ENVIRON_TABLE, NULL);
GimpEnvironTable *table = g_object_new (GIMP_TYPE_ENVIRON_TABLE, NULL);
table->verbose = verbose;
return table;
}
static guint
@ -249,6 +249,9 @@ gimp_environ_table_load_env_file (const GimpDatafileData *file_data,
gchar *name, *value, *separator, *p, *q;
GimpEnvironValue *val;
if (environ_table->verbose)
g_print ("Parsing '%s'\n", gimp_filename_to_utf8 (file_data->filename));
env = g_fopen (file_data->filename, "r");
if (! env)
return;

View File

@ -36,6 +36,8 @@ struct _GimpEnvironTable
{
GObject parent_instance;
gboolean verbose;
GHashTable *vars;
GHashTable *internal;
@ -49,7 +51,7 @@ struct _GimpEnvironTableClass
GType gimp_environ_table_get_type (void) G_GNUC_CONST;
GimpEnvironTable * gimp_environ_table_new (void);
GimpEnvironTable * gimp_environ_table_new (gboolean verbose);
void gimp_environ_table_load (GimpEnvironTable *environ_table,
const gchar *env_path);

View File

@ -117,13 +117,6 @@ gimp_interpreter_db_class_init (GimpInterpreterDBClass *class)
static void
gimp_interpreter_db_init (GimpInterpreterDB *db)
{
db->programs = NULL;
db->magics = NULL;
db->magic_names = NULL;
db->extensions = NULL;
db->extension_names = NULL;
}
static void
@ -137,9 +130,13 @@ gimp_interpreter_db_finalize (GObject *object)
}
GimpInterpreterDB *
gimp_interpreter_db_new (void)
gimp_interpreter_db_new (gboolean verbose)
{
return g_object_new (GIMP_TYPE_INTERPRETER_DB, NULL);
GimpInterpreterDB *db = g_object_new (GIMP_TYPE_INTERPRETER_DB, NULL);
db->verbose = verbose;
return db;
}
void
@ -213,6 +210,9 @@ gimp_interpreter_db_load_interp_file (const GimpDatafileData *file_data,
db = GIMP_INTERPRETER_DB (user_data);
if (db->verbose)
g_print ("Parsing '%s'\n", gimp_filename_to_utf8 (file_data->filename));
interp_file = g_fopen (file_data->filename, "r");
if (! interp_file)
return;

View File

@ -36,6 +36,8 @@ struct _GimpInterpreterDB
{
GObject parent_instance;
gboolean verbose;
GHashTable *programs;
GSList *magics;
@ -52,7 +54,7 @@ struct _GimpInterpreterDBClass
GType gimp_interpreter_db_get_type (void) G_GNUC_CONST;
GimpInterpreterDB * gimp_interpreter_db_new (void);
GimpInterpreterDB * gimp_interpreter_db_new (gboolean verbose);
void gimp_interpreter_db_load (GimpInterpreterDB *db,
const gchar *interp_path);

View File

@ -138,26 +138,6 @@ gimp_plug_in_manager_class_init (GimpPlugInManagerClass *klass)
static void
gimp_plug_in_manager_init (GimpPlugInManager *manager)
{
manager->gimp = NULL;
manager->plug_in_defs = NULL;
manager->write_pluginrc = FALSE;
manager->plug_in_procedures = NULL;
manager->load_procs = NULL;
manager->save_procs = NULL;
manager->export_procs = NULL;
manager->current_plug_in = NULL;
manager->open_plug_ins = NULL;
manager->plug_in_stack = NULL;
manager->history = NULL;
manager->shm = NULL;
manager->interpreter_db = gimp_interpreter_db_new ();
manager->environ_table = gimp_environ_table_new ();
manager->debug = NULL;
manager->data_list = NULL;
}
static void
@ -280,7 +260,9 @@ gimp_plug_in_manager_new (Gimp *gimp)
manager = g_object_new (GIMP_TYPE_PLUG_IN_MANAGER, NULL);
manager->gimp = gimp;
manager->gimp = gimp;
manager->interpreter_db = gimp_interpreter_db_new (gimp->be_verbose);
manager->environ_table = gimp_environ_table_new (gimp->be_verbose);
return manager;
}