~ubuntu-branches/ubuntu/quantal/gnome-documents/quantal

« back to all changes in this revision

Viewing changes to src/documents.js

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2012-07-19 14:23:33 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120719142333-0gr0rqv0yu7vp8ny
Tags: 0.5.4-0ubuntu1
* New upstream release (LP: #1026423)
* debian/control:
  - Bump build-depends on libclutter-gtk-1.0-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
494
494
                            function(object, res) {
495
495
                                try {
496
496
                                    this.pixbuf = GdkPixbuf.Pixbuf.new_from_stream_finish(res);
 
497
 
497
498
                                    this.thumbnailed = true;
498
499
                                    this.checkEffectsAndUpdateInfo();
499
500
                                } catch (e) {
500
501
                                    this._failedThumbnailing = true;
501
502
                                }
 
503
 
 
504
                                // close the underlying stream immediately
 
505
                                stream.close_async(0, null, null);
502
506
                            }));
503
507
                } catch (e) {
504
508
                    this._failedThumbnailing = true;
607
611
        return retval;
608
612
    },
609
613
 
610
 
    _finishLoad: function(document, callback, exception) {
611
 
        let docModel = null;
612
 
        if (exception) {
 
614
    _finishLoad: function(docModel, callback, exception) {
 
615
        if (exception)
613
616
            Global.errorHandler.addLoadError(this, exception);
614
 
        } else {
615
 
            docModel = EvView.DocumentModel.new_with_document(document);
616
 
        }
617
617
 
618
618
        callback(this, docModel, exception);
619
619
    }
649
649
        Gd.pdf_loader_load_uri_async(this.uri, cancellable, Lang.bind(this,
650
650
            function(source, res) {
651
651
                try {
652
 
                    let document = Gd.pdf_loader_load_uri_finish(res);
653
 
                    this._finishLoad(document, callback, null);
 
652
                    let docModel = Gd.pdf_loader_load_uri_finish(res);
 
653
                    this._finishLoad(docModel, callback, null);
654
654
                } catch (e) {
655
655
                    this._finishLoad(null, callback, e);
656
656
                }
720
720
                    Gd.pdf_loader_load_uri_async(this.identifier, cancellable, Lang.bind(this,
721
721
                        function(source, res) {
722
722
                            try {
723
 
                                let document = Gd.pdf_loader_load_uri_finish(res);
724
 
                                this._finishLoad(document, callback, null);
 
723
                                let docModel = Gd.pdf_loader_load_uri_finish(res);
 
724
                                this._finishLoad(docModel, callback, null);
725
725
                            } catch (e) {
726
726
                                // report the outmost error only
727
727
                                this._finishLoad(null, callback, exception);
735
735
                    (entry, service, cancellable, Lang.bind(this,
736
736
                        function(source, res) {
737
737
                            try {
738
 
                                let document = Gd.pdf_loader_load_uri_finish(res);
739
 
                                this._finishLoad(document, callback, null);
 
738
                                let docModel = Gd.pdf_loader_load_uri_finish(res);
 
739
                                this._finishLoad(docModel, callback, null);
740
740
                            } catch (e) {
741
741
                                this._finishLoad(null, callback, e);
742
742
                            }
859
859
                    Gd.pdf_loader_load_uri_async(this.identifier, cancellable, Lang.bind(this,
860
860
                        function(source, res) {
861
861
                            try {
862
 
                                let document = Gd.pdf_loader_load_uri_finish(res);
863
 
                                this._finishLoad(document, callback, null);
 
862
                                let docModel = Gd.pdf_loader_load_uri_finish(res);
 
863
                                this._finishLoad(docModel, callback, null);
864
864
                            } catch (e) {
865
865
                                // report the outmost error only
866
866
                                this._finishLoad(null, callback, exception);
874
874
                    (entry, service, cancellable, Lang.bind(this,
875
875
                        function(source, res) {
876
876
                            try {
877
 
                                let document = Gd.pdf_loader_load_zpj_entry_finish(res);
878
 
                                this._finishLoad(document, callback, null);
 
877
                                let docModel = Gd.pdf_loader_load_zpj_entry_finish(res);
 
878
                                this._finishLoad(docModel, callback, null);
879
879
                            } catch (e) {
880
880
                                this._finishLoad(null, callback, e);
881
881
                            }