~ubuntu-branches/ubuntu/trusty/avogadro/trusty-proposed

« back to all changes in this revision

Viewing changes to libavogadro/src/pythonengine_p.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Rohan Garg
  • Date: 2011-05-20 18:55:49 UTC
  • mfrom: (3.2.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110520185549-berzu8h9f9330xji
Tags: 1.0.3-1ubuntu1
* Merge from debian, remaining changes (LP: #787458, #784267)
  - Disable builds for ARM as build dependency on libOpenGL and 
    libQtOpenGL

Show diffs side-by-side

added added

removed removed

Lines of Context:
173
173
    
174
174
    PythonThread pt;
175
175
 
 
176
    if (!PyObject_HasAttrString(m_instance.ptr(), "writeSettings"))
 
177
      return;
 
178
 
 
179
    try {
 
180
      prepareToCatchError();
 
181
 
 
182
      boost::python::return_by_value::apply<QSettings*>::type qconverter;
 
183
      PyObject *qobj = qconverter(&settings);
 
184
      object real_qobj = object(handle<>(qobj));
 
185
 
 
186
      m_instance.attr("writeSettings")(real_qobj);
 
187
    } catch(error_already_set const &) {
 
188
      catchError();
 
189
    }
 
190
  }
 
191
 
 
192
  void PythonEngine::readSettings(QSettings &settings)
 
193
  {
 
194
    Engine::readSettings(settings);
 
195
 
 
196
    if (!m_script)
 
197
      return;
 
198
 
176
199
    if (!PyObject_HasAttrString(m_instance.ptr(), "readSettings"))
177
200
      return;
178
201
 
189
212
    }
190
213
  }
191
214
 
192
 
  void PythonEngine::readSettings(QSettings &settings)
193
 
  {
194
 
    Engine::readSettings(settings);
195
 
 
196
 
    if (!m_script)
197
 
      return;
198
 
 
199
 
    if (!PyObject_HasAttrString(m_instance.ptr(), "writeSettings"))
200
 
      return;
201
 
 
202
 
    try {
203
 
      prepareToCatchError();
204
 
 
205
 
      boost::python::return_by_value::apply<QSettings*>::type qconverter;
206
 
      PyObject *qobj = qconverter(&settings);
207
 
      object real_qobj = object(handle<>(qobj));
208
 
 
209
 
      m_instance.attr("writeSettings")(real_qobj);
210
 
    } catch(error_already_set const &) {
211
 
      catchError();
212
 
    }
213
 
  }
214
 
 
215
215
  void PythonEngine::loadScript(const QString &filename)
216
216
  {
217
217
    QFileInfo info(filename);