From 82e0f27fd1f85aa5558e75a8d980f101df8cb229 Mon Sep 17 00:00:00 2001 From: Tobias Hunger <tobias.hunger@nokia.com> Date: Tue, 27 Mar 2012 18:39:31 +0200 Subject: [PATCH] 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> --- src/plugins/qtsupport/exampleslistmodel.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index 36324d3c3b7..68bd4682c06 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -134,10 +134,12 @@ QList<ExampleItem> ExamplesListModel::parseExamples(QXmlStreamReader* reader, co } break; case QXmlStreamReader::EndElement: - if (reader->name() == QLatin1String("example")) - examples.append(item); - else if (reader->name() == QLatin1String("examples")) + if (reader->name() == QLatin1String("example")) { + if (!item.projectPath.isEmpty() && QFileInfo(item.projectPath).exists()) + examples.append(item); + } else if (reader->name() == QLatin1String("examples")) { return examples; + } break; default: // nothing break; -- GitLab