Commit 5784e2ad authored by Daniel Molkentin's avatar Daniel Molkentin
Browse files

prefer adding Qt versions shipping with QML examples

Reviewed-by: dt
parent 43c892d3
...@@ -228,23 +228,30 @@ void QtVersionManager::updateDocumentation() ...@@ -228,23 +228,30 @@ void QtVersionManager::updateDocumentation()
void QtVersionManager::updateExamples() void QtVersionManager::updateExamples()
{ {
QList<QtVersion *> versions;
versions.append(m_versions);
QString examplesPath;
QString demosPath;
QtVersion *version = 0; QtVersion *version = 0;
QList<QtVersion*> candidates;
// try to find a version which has both, demos and examples // try to find a version which has both, demos and examples
foreach (version, versions) { foreach (version, m_versions) {
if (version->hasExamples()) if (version->hasExamples() && version->hasDemos())
examplesPath = version->examplesPath(); candidates.append(version);
if (version->hasDemos()) }
demosPath = version->demosPath();
if (!examplesPath.isEmpty() && !demosPath.isEmpty()) { // prefer versions with declarative examples
emit updateExamples(examplesPath, demosPath, version->sourcePath()); foreach (version, candidates) {
if (QDir(version->examplesPath()+"/declarative").exists()) {
emit updateExamples(version->examplesPath(), version->demosPath(), version->sourcePath());
return; return;
} }
} }
if (!candidates.isEmpty()) {
version = candidates.first();
emit updateExamples(version->examplesPath(), version->demosPath(), version->sourcePath());
return;
}
return;
} }
int QtVersionManager::getUniqueId() int QtVersionManager::getUniqueId()
......
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