2 * Copyright (C) 2015 Canonical Ltd.
3 * Copyright (C) 2021 UBports Foundation
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 3.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19import Lomiri.Components 1.3
24 // Provide a list of wallpapers to resolve here, preferred ones first
25 property var candidates: []
27 property bool cache: true
29 readonly property url background: {
30 for (var i = 0; i < repeater.count; i++) {
31 var image = repeater.itemAt(i);
32 var expectedImageSource = Qt.resolvedUrl(candidates[i]);
33 if (image.source != expectedImageSource)
35 if (image.status === Image.Ready)
37 if (image.status === Image.Loading)
40 if (candidates.length > 0) {
41 return candidates.slice(-1)[0]; // last item is last resort
49 model: root.candidates.slice(0, -1)