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

« back to all changes in this revision

Viewing changes to avogadro/src/main.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:
104
104
  // This also works for the Windows package, but BABEL_LIBDIR is ignored
105
105
  QByteArray babelDataDir(("BABEL_DATADIR="
106
106
                           + QCoreApplication::applicationDirPath()
107
 
                           + "/../share/openbabel/"
108
 
                           + BABEL_VERSION).toAscii());
 
107
                           + "/../share/openbabel/").toAscii());
109
108
  QByteArray babelLibDir(("BABEL_LIBDIR="
110
109
                          + QCoreApplication::applicationDirPath()
111
110
                          + "/../lib/openbabel").toAscii());
229
228
    QPoint p(100, 100), offset(40,40);
230
229
    QList<QString>::const_iterator i = arguments.constBegin();
231
230
    for (++i; i != arguments.constEnd(); ++i) {
232
 
      window->openFile(*i);
233
 
      // this costs us a few more function calls
234
 
      // but makes our loading look nicer
235
 
      window->show();
236
 
      app.processEvents();
 
231
      if (QFile::exists(*i)) {
 
232
        window->openFile(*i);
 
233
        // this costs us a few more function calls
 
234
        // but makes our loading look nicer
 
235
        window->show();
 
236
        app.processEvents();
 
237
      }
 
238
      else {
 
239
        std::cout << "Warning: file '" << (*i).toLocal8Bit().data()
 
240
                  << "'' does not exist!\n";
 
241
      }
237
242
    }
238
243
  }
239
244
  window->show();