@@ -34,6 +34,8 @@ PreviewWidget {
35 property Item rootItem: QuickUtils.rootItem(root)
35 property Item rootItem: QuickUtils.rootItem(root)
37+ readonly property var imageUrl: widgetData["source"] || widgetData["fallback"] || ""
37 LazyImage {
39 LazyImage {
38 id: lazyImage
40 id: lazyImage
39 objectName: "lazyImage"
41 objectName: "lazyImage"
@@ -42,7 +44,7 @@ PreviewWidget {
42 right: parent.right
44 right: parent.right
44 scaleTo: "width"
46 scaleTo: "width"
45− source: widgetData["source"] || widgetData["fallback"] || ""
47+ source: root.imageUrl
46 asynchronous: true
48 asynchronous: true
47 useUbuntuShape: false
49 useUbuntuShape: false
48 pressed: mouseArea.pressed
50 pressed: mouseArea.pressed
@@ -59,11 +61,12 @@ PreviewWidget {
60 Connections {
62 Connections {
61 target: lazyImage.sourceImage
63 target: lazyImage.sourceImage
62− // If modelData would change after failing to load it would not be
63− // reloaded since the source binding is destroyed by the source = fallback
64− // But at the moment the model never changes
65 onStatusChanged: if (lazyImage.sourceImage.status === Image.Error) lazyImage.sourceImage.source = widgetData["fallback"];
64 onStatusChanged: if (lazyImage.sourceImage.status === Image.Error) lazyImage.sourceImage.source = widgetData["fallback"];
68+ onImageUrlChanged: lazyImage.sourceImage.source = root.imageUrl;
68 PreviewMediaToolbar {
71 PreviewMediaToolbar {
69 id: toolbar
72 id: toolbar
@@ -86,12 +89,14 @@ PreviewWidget {
87 delegate: ZoomableImage {
90 delegate: ZoomableImage {
88 anchors.fill: parent
91 anchors.fill: parent
89− source: widgetData["source"] || widgetData["fallback"] || ""
92+ source: root.imageUrl
90 zoomable: widgetData["zoomable"] ? widgetData["zoomable"] : false
93 zoomable: widgetData["zoomable"] ? widgetData["zoomable"] : false
91− // If modelData would change after failing to load it would not be
92− // reloaded since the source binding is destroyed by the source = fallback
93− // But at the moment the model never changes
94 onStatusChanged: if (status === Image.Error) source = widgetData["fallback"];
94 onStatusChanged: if (status === Image.Error) source = widgetData["fallback"];
98+ onImageUrlChanged: source = root.imageUrl;