qdoc: Revised logic for which example file to open in Qt Creator
authorTopi Reinio <topi.reinio@digia.com>
Tue, 3 Jun 2014 11:23:38 +0000 (13:23 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 10 Jun 2014 08:16:56 +0000 (10:16 +0200)
commit1a3d149174efca50de812c4f336a7ebfe069243c
tree6b66ad82b060ff07ae97615023eac82ce781905e
parent360fd4a278a8827d9727b295a753e623502c7445
qdoc: Revised logic for which example file to open in Qt Creator

qdoc stores the 'files to open' into the example manifest. These
files are opened in Qt Creator's editor when an example is selected
from the Welcome / Examples list.

This change uses the following criteria (case insensitive), in
order of preference:
    - .qml file matching the project name
    - .cpp file matching the project name
    - .h file matching the project name
    - main.qml
    - main.cpp

A 'mainFile = "true"' argument is written for the file that is
preferred to be the top-most file.

Having a main.qml file take precedence over main.cpp ensures that
most Qt Quick examples open into the relevant QML code instead of
the boilerplate C++ used for launching the application.

Task-number: QTBUG-37203
Change-Id: I2ea58a31b1284f4f7d424dd35d49a84a23a88c23
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
src/tools/qdoc/htmlgenerator.cpp