~jbicha/ubuntu/oneiric/gjs/1.29.18

« back to all changes in this revision

Viewing changes to gi/foreign.c

  • Committer: Bazaar Package Importer
  • Author(s): Laurent Bigonville
  • Date: 2011-02-06 13:01:02 UTC
  • mfrom: (1.3.10 experimental)
  • Revision ID: james.westby@ubuntu.com-20110206130102-69xpqq0gql9fob01
Tags: 0.7.10-1
* New upstream release.
* debian/control.in:
  - Drop build-depend on libmozjs-dev
  - Make libgjs-dev depend on xulrunner-dev and libdbus-1-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
    GIBaseInfo *base_info;
115
115
    GjsForeignInfo *retval = NULL;
116
116
    GHashTable *hash_table;
 
117
    char *key;
117
118
 
118
119
    base_info = g_type_info_get_interface(type_info);
119
 
    if (base_info) {
120
 
        char *key = g_strdup_printf("%s.%s", g_base_info_get_namespace(base_info),
121
 
                                    g_base_info_get_name(base_info));
122
 
        hash_table = get_foreign_structs();
123
 
        retval = (GjsForeignInfo*)g_hash_table_lookup(hash_table, key);
124
 
        if (!retval) {
125
 
            if (gjs_foreign_load_foreign_module(context, g_base_info_get_namespace(base_info))) {
126
 
                retval = (GjsForeignInfo*)g_hash_table_lookup(hash_table, key);
127
 
            }
 
120
    g_assert (base_info != NULL);
 
121
 
 
122
    key = g_strdup_printf("%s.%s", g_base_info_get_namespace(base_info),
 
123
                          g_base_info_get_name(base_info));
 
124
    hash_table = get_foreign_structs();
 
125
    retval = (GjsForeignInfo*)g_hash_table_lookup(hash_table, key);
 
126
    if (!retval) {
 
127
        if (gjs_foreign_load_foreign_module(context, g_base_info_get_namespace(base_info))) {
 
128
            retval = (GjsForeignInfo*)g_hash_table_lookup(hash_table, key);
128
129
        }
129
 
        g_base_info_unref(base_info);
130
 
        g_free(key);
131
 
    }
 
130
    }
 
131
 
 
132
    if (!retval) {
 
133
        gjs_throw(context, "Unable to find module implementing foreign type %s.%s",
 
134
                  g_base_info_get_namespace(base_info),
 
135
                  g_base_info_get_name(base_info));
 
136
    }
 
137
 
 
138
    g_base_info_unref(base_info);
 
139
    g_free(key);
 
140
 
132
141
    return retval;
133
142
}
134
143