Пример #1
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);
}
Пример #2
0
static void
gimp_module_db_load_module (GimpModuleDB *db,
                            GFile        *file)
{
  GimpModule *module;
  gchar      *path;
  gboolean    load_inhibit;

  if (! gimp_file_has_extension (file, "." G_MODULE_SUFFIX))
    return;

  path = g_file_get_path (file);

  /* don't load if we already know about it */
  if (gimp_module_db_module_find_by_path (db, path))
    {
      g_free (path);
      return;
    }

  load_inhibit = is_in_inhibit_list (path, db->load_inhibit);

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

  g_free (path);

  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);
}