WelcomePage: Fix warning if searching in examples

During search/filtering the model returns undefined values
for delegates.

Task-number: QTCREATORBUG-11579
Task-number: QTCREATORBUG-11847

Change-Id: Ia15acd54991373f5bdebe4407e4f4a39503f6966
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Thomas Hartmann
2014-03-25 16:46:49 +01:00
parent d390f6e397
commit c3e027e5b0

View File

@@ -54,7 +54,15 @@ GridView {
property string mockupSource: model.imageSource
property string helpSource: model.imageUrl !== "" ? sourcePrefix + encodeURI(model.imageUrl) : ""
imageSource: isVideo ? "" : (model.imageSource === undefined ? helpSource : mockupSource)
imageSource: getImageSource()
function getImageSource() {
var value = delegate.isVideo ? "" : (model.imageSource === undefined ? delegate.helpSource : delegate.mockupSource)
if (value === undefined)
value = "";
}
videoSource: isVideo ? (model.imageSource === undefined ? model.imageUrl : mockupSource) : ""
caption: model.name;