~ubuntu-branches/ubuntu/saucy/gnash/saucy-proposed

« back to all changes in this revision

Viewing changes to libcore/LoadVariablesThread.cpp

  • Committer: Package Import Robot
  • Author(s): Micah Gersten
  • Date: 2012-03-04 03:19:06 UTC
  • mfrom: (1.1.18) (3.1.24 sid)
  • Revision ID: package-import@ubuntu.com-20120304031906-p6q5rnb0xhgpof7o
Tags: 0.8.10-3ubuntu1
* Merge from Debian testing (FFe: LP: #940876), remaining changes:
  - Use mozilla-flashplugin as the alternative for now
  - Change xulrunner-dev build dep to firefox-dev
* Drop the plugin API porting patch, this has been fixed upstream
  - drop debian/patches*
* Drop the following change as we want Adobe's player to take priority
  if it's installed
  - Set alternative priority to 50 so that it matches Adobe Flash's priority

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// 
2
 
//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010,
3
 
//   2011 Free Software Foundation, Inc
 
2
//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
 
3
//   Free Software Foundation, Inc
4
4
//
5
5
// This program is free software; you can redistribute it and/or modify
6
6
// it under the terms of the GNU General Public License as published by
34
34
LoadVariablesThread::completeLoad()
35
35
{
36
36
#ifdef DEBUG_LOAD_VARIABLES
37
 
        log_debug("completeLoad called");
 
37
    log_debug("completeLoad called");
38
38
#endif
39
39
 
40
40
 
54
54
        while ( size_t bytesRead = _stream->read(buf.get(), chunkSize) )
55
55
        {
56
56
#ifdef DEBUG_LOAD_VARIABLES
57
 
                log_debug("Read %u bytes", bytesRead);
 
57
            log_debug("Read %u bytes", bytesRead);
58
58
#endif
59
59
 
60
60
                if ( _bytesLoaded )
71
71
                        if ( encoding != utf8::encUTF8 &&
72
72
                             encoding != utf8::encUNSPECIFIED )
73
73
                        {
74
 
                                log_unimpl("%s to utf8 conversion in "
 
74
                  log_unimpl(_("%s to UTF8 conversion in "
75
75
                                            "MovieClip.loadVariables "
76
 
                                            "input parsing",
 
76
                                         "input parsing"),
77
77
                                            utf8::textEncodingName(encoding));
78
78
                        }
79
79
                        std::string chunk(ptr, dataSize);
105
105
                // eof, get out !
106
106
                if ( _stream->eof() ) break;
107
107
 
108
 
                if ( cancelRequested() )
109
 
                {
110
 
                        log_debug("Cancelling LoadVariables download thread...");
 
108
                if ( cancelRequested() ) {
 
109
                    log_debug("Cancelling LoadVariables download thread...");
111
110
                        _stream.reset();
112
111
                        return;
113
112
                }
114
113
        }
115
114
 
116
 
        if ( ! toparse.empty() )
117
 
        {
 
115
        if ( ! toparse.empty() ) {
118
116
                parse(toparse);
119
117
        }
120
118
 
121
119
        try {
122
120
                _stream->go_to_end();
123
121
        }
124
 
    catch (IOException& ex) {
125
 
                log_error("Stream couldn't seek to end: %s", ex.what());
 
122
        catch (IOException& ex) {
 
123
        log_error(_("Stream couldn't seek to end: %s"), ex.what());
126
124
        }
127
125
        
128
126
    _bytesLoaded = _stream->tell();
129
 
        if ( _bytesTotal !=  _bytesLoaded )
130
 
        {
131
 
                log_error("Size of 'variables' stream advertised to be %d bytes,"
132
 
                         " but turned out to be %d bytes.",
 
127
        if ( _bytesTotal !=  _bytesLoaded ) {
 
128
            log_error(_("Size of 'variables' stream advertised to be %d bytes,"
 
129
                          " but turned out to be %d bytes."),
133
130
                        _bytesTotal, _bytesLoaded);
134
131
                _bytesTotal = _bytesLoaded;
135
132
        }