WelcomePage: Do not list examples that do not exist

Do not list examples that point to non-existing project files.

Change-Id: I6b7fdff3831a5a1845cf8c8d8429287abb1f86ab
Reviewed-by: Daniel Molkentin <daniel.molkentin@nokia.com>
This commit is contained in:
Tobias Hunger
2012-03-27 18:39:31 +02:00
committed by Daniel Molkentin
parent 177ed96b35
commit 82e0f27fd1

View File

@@ -134,10 +134,12 @@ QList<ExampleItem> ExamplesListModel::parseExamples(QXmlStreamReader* reader, co
} }
break; break;
case QXmlStreamReader::EndElement: case QXmlStreamReader::EndElement:
if (reader->name() == QLatin1String("example")) if (reader->name() == QLatin1String("example")) {
if (!item.projectPath.isEmpty() && QFileInfo(item.projectPath).exists())
examples.append(item); examples.append(item);
else if (reader->name() == QLatin1String("examples")) } else if (reader->name() == QLatin1String("examples")) {
return examples; return examples;
}
break; break;
default: // nothing default: // nothing
break; break;