Comment 4 for bug 1525147

Revision history for this message
Peter Bittner (peter-bittner) wrote :

The call to `printUsage()` happens in `BrowserApplication::initialize()`, which is after the constructor has been called. The base class `QApplication` seems to require a Mir server (or X server) running.

Conclusion
----------

- In order to be able to print the usage on the console without requiring a Mir server this call needs to be made before the constructor is called.

- It may also be a good idea to check all the command line arguments and reject invalid ones. (Is there no module available for this, similar to Python's argparse? Can we use QCommandLineParser? http://doc.qt.io/qt-5/qcommandlineparser.html)

References
----------

- http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/wily/webbrowser-app/wily/view/head:/src/app/browserapplication.cpp#L121
- http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/wily/webbrowser-app/wily/view/head:/src/app/browserapplication.cpp#L42
- http://doc.qt.io/qt-5/qcommandlineparser.html