Do not show examples that do not have a projectPath associated.

Tutorials are handled differently, these can still only have
documentation or video.

Task-number: QTBUG-28396
Change-Id: Ief79756c44633b1d105357b385595a1267f730f4
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Christiaan Janssen <christiaan.janssen@digia.com>
This commit is contained in:
Eike Ziller
2012-12-12 13:16:42 +01:00
parent 2b3bc1fa33
commit 990ddf2c71

View File

@@ -121,7 +121,7 @@ static bool isValidExampleOrDemo(ExampleItem &item)
static QString invalidPrefix = QLatin1String("qthelp:////"); /* means that the qthelp url static QString invalidPrefix = QLatin1String("qthelp:////"); /* means that the qthelp url
doesn't have any namespace */ doesn't have any namespace */
bool ok = true; bool ok = true;
if (item.hasSourceCode && !QFileInfo(item.projectPath).exists()) if (!item.hasSourceCode || !QFileInfo(item.projectPath).exists())
ok = false; ok = false;
else if (item.imageUrl.startsWith(invalidPrefix) || !QUrl(item.imageUrl).isValid()) else if (item.imageUrl.startsWith(invalidPrefix) || !QUrl(item.imageUrl).isValid())
ok = false; ok = false;