Example #1
0
static void
gimp_module_db_finalize (GObject *object)
{
  GimpModuleDB *db = GIMP_MODULE_DB (object);

  if (db->modules)
    {
      GList *list;

      for (list = db->modules; list; list = g_list_next (list))
        {
          g_signal_handlers_disconnect_by_func (list->data,
                                                gimp_module_db_module_modified,
                                                db);
        }

      g_list_free (db->modules);
      db->modules = NULL;
    }

  if (db->load_inhibit)
    {
      g_free (db->load_inhibit);
      db->load_inhibit = NULL;
    }

  G_OBJECT_CLASS (parent_class)->finalize (object);
}
Example #2
0
static void
gimp_module_db_module_initialize (const GimpDatafileData *file_data,
                                  gpointer                user_data)
{
    GimpModuleDB *db = GIMP_MODULE_DB (user_data);
    GimpModule   *module;
    gboolean      load_inhibit;

    if (! gimp_datafiles_check_extension (file_data->filename,
                                          "." G_MODULE_SUFFIX))
        return;

    /* don't load if we already know about it */
    if (gimp_module_db_module_find_by_path (db, file_data->filename))
        return;

    load_inhibit = is_in_inhibit_list (file_data->filename,
                                       db->load_inhibit);

    module = gimp_module_new (file_data->filename,
                              load_inhibit,
                              db->verbose);

    g_signal_connect (module, "modified",
                      G_CALLBACK (gimp_module_db_module_modified),
                      db);

    db->modules = g_list_append (db->modules, module);
    g_signal_emit (db, db_signals[ADD], 0, module);
}
Example #3
0
static void
gimp_module_db_finalize (GObject *object)
{
  GimpModuleDB *db = GIMP_MODULE_DB (object);

  if (db->modules)
    {
      g_list_free (db->modules);
      db->modules = NULL;
    }

  if (db->load_inhibit)
    {
      g_free (db->load_inhibit);
      db->load_inhibit = NULL;
    }

  G_OBJECT_CLASS (parent_class)->finalize (object);
}