Commit dc6f30fd authored by Daniel Molkentin's avatar Daniel Molkentin

Don't show fallback examples if we do not have any installed.

Change-Id: I296888ce0c98a38afc4b21554942aa579a56c95a
Reviewed-by: default avatarEike Ziller <eike.ziller@nokia.com>
parent a0134647
......@@ -269,14 +269,18 @@ QStringList ExamplesListModel::exampleSources() const
}
settings->endArray();
bool anyQtVersionHasExamplesFolder = false;
if (sources.isEmpty()) {
// Try to get dir from first Qt Version
QtVersionManager *versionManager = QtVersionManager::instance();
foreach (BaseQtVersion *version, versionManager->validVersions()) {
QDir examplesDir(version->examplesPath());
if (examplesDir.exists())
if (examplesDir.exists()) {
sources << examplesDir.entryInfoList(pattern);
anyQtVersionHasExamplesFolder = true;
}
QDir demosDir(version->demosPath());
if (demosDir.exists())
......@@ -290,7 +294,7 @@ QStringList ExamplesListModel::exampleSources() const
QString resourceDir = Core::ICore::instance()->resourcePath() + QLatin1String("/welcomescreen/");
// Try Creator-provided XML file only
if (sources.isEmpty()) {
if (sources.isEmpty() && anyQtVersionHasExamplesFolder) {
// qDebug() << Q_FUNC_INFO << "falling through to Creator-provided XML file";
sources << QString(resourceDir + QLatin1String("/examples_fallback.xml"));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment