~ubuntu-branches/ubuntu/saucy/gjs/saucy-proposed

« back to all changes in this revision

Viewing changes to modules/overrides/Gio.js

  • Committer: Package Import Robot
  • Author(s): Emilio Pozuelo Monfort
  • Date: 2013-03-28 03:08:20 UTC
  • mfrom: (1.3.19 experimental)
  • Revision ID: package-import@ubuntu.com-20130328030820-ci0s4uz3dssf0uip
Tags: 1.36.0-1
* New upstream release.
  + debian/control.in:
    - Update build dependencies.
  + debian/libgjs0c.install:
    - Stop installing the modules, they are built into libgjs now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
        }
77
77
    }
78
78
 
79
 
    var inVariant = GLib.Variant.new('(' + inSignature.join('') + ')', arg_array);
 
79
    var inVariant = new GLib.Variant('(' + inSignature.join('') + ')', arg_array);
80
80
 
81
81
    var asyncCallback = function (proxy, result) {
 
82
        var outVariant = null, succeeded = false;
82
83
        try {
83
 
            var outVariant = proxy.call_finish(result);
 
84
            outVariant = proxy.call_finish(result);
 
85
            succeeded = true;
 
86
        } catch (e) {
 
87
            replyFunc(null, e);
 
88
        }
 
89
 
 
90
        if (succeeded)
84
91
            replyFunc(outVariant.deep_unpack(), null);
85
 
        } catch (e) {
86
 
            replyFunc(null, e);
87
 
        }
88
92
    };
89
93
 
90
94
    if (sync) {
132
136
}
133
137
 
134
138
function _propertySetter(value, name, signature) {
135
 
    let variant = GLib.Variant.new(signature, value);
 
139
    let variant = new GLib.Variant(signature, value);
136
140
    this.set_cached_property(name, variant);
137
141
 
138
142
    this.call('org.freedesktop.DBus.Properties.Set',
139
 
              GLib.Variant.new('(ssv)',
 
143
              new GLib.Variant('(ssv)',
140
144
                               [this.g_interface_name,
141
145
                                name, variant]),
142
146
              Gio.DBusCallFlags.NONE, -1, null,
188
192
            cancellable = null;
189
193
        if (asyncCallback)
190
194
            obj.init_async(GLib.PRIORITY_DEFAULT, cancellable, function(initable, result) {
 
195
                let caughtErrorWhenInitting = null;
191
196
                try {
192
197
                    initable.init_finish(result);
 
198
                } catch(e) {
 
199
                    caughtErrorWhenInitting = e;
 
200
                }
 
201
 
 
202
                if (caughtErrorWhenInitting === null) {
193
203
                    asyncCallback(initable, null);
194
 
                } catch(e) {
195
 
                    asyncCallback(null, e);
 
204
                } else {
 
205
                    asyncCallback(null, caughtErrorWhenInitting);
196
206
                }
197
207
            });
198
208
        else
221
231
        throw TypeError('Invalid type ' + Object.prototype.toString.call(value));
222
232
 
223
233
    var node;
224
 
    if (value.name() == 'interface') {
 
234
    if (xml.name() == 'interface') {
225
235
        // wrap inside a node
226
236
        node = <node/>;
227
237
        node.node += xml;
280
290
        }
281
291
        if (retval === undefined) {
282
292
            // undefined (no return value) is the empty tuple
283
 
            retval = GLib.Variant.new('()', []);
 
293
            retval = new GLib.Variant('()', []);
284
294
        }
285
295
        try {
286
296
            if (!(retval instanceof GLib.Variant)) {
293
303
                    // into an Array
294
304
                    retval = [retval];
295
305
                }
296
 
                retval = GLib.Variant.new(outSignature, retval);
 
306
                retval = new GLib.Variant(outSignature, retval);
297
307
            }
298
308
            invocation.return_value(retval);
299
309
        } catch(e) {
314
324
    let propInfo = info.lookup_property(property_name);
315
325
    let jsval = this[property_name];
316
326
    if (jsval != undefined)
317
 
        return GLib.Variant.new(propInfo.signature, jsval);
 
327
        return new GLib.Variant(propInfo.signature, jsval);
318
328
    else
319
329
        return null;
320
330
}