WelcomeScreen: Avoid loading of invalid pictures

Apparently the QML engine also loads pictures for invisible Image
objects. The pictures icons for examples and tutorials on the welcome
screen thus always try to load an extra video icon, which always fails.
By setting the URL to an empty string if the example or tutorial being
loaded is no video we can avoid that.

Change-Id: Ibafc11ed233f386bbbf1e7a4830fcb34bc1cd55d
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
Ulf Hermann
2013-12-03 13:39:47 +01:00
parent afb0f8772b
commit b7ac243c3b

View File

@@ -47,8 +47,8 @@ GridView {
property string mockupSource: model.imageSource property string mockupSource: model.imageSource
property string helpSource: model.imageUrl !== "" ? sourcePrefix + encodeURI(model.imageUrl) : "" property string helpSource: model.imageUrl !== "" ? sourcePrefix + encodeURI(model.imageUrl) : ""
imageSource: model.imageSource === undefined ? helpSource : mockupSource imageSource: isVideo ? "" : (model.imageSource === undefined ? helpSource : mockupSource)
videoSource: model.imageSource === undefined ? model.imageUrl : mockupSource videoSource: isVideo ? (model.imageSource === undefined ? model.imageUrl : mockupSource) : ""
caption: model.name; caption: model.name;
description: model.description description: model.description