2 * Copyright (C) 2015 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 property string usageMode: "Staged"
25 // FIXME: Works around a bug where if we change a Loader's source in response to a GSettings
26 // property change in the same event loop, the Loader's previously loaded component does not
27 // get destroyed and its bindings continue to operate!
29 // Shouldn't be needed after
30 // https://code.launchpad.net/~lukas-kde/gsettings-qt/queued-processing/+merge/259883 gets
32 property var timer: Timer {
34 onTriggered: { root.usageMode = root.wrapped.usageMode; }
36 property var wrappedConnections: Connections {
38 ignoreUnknownSignals: true // don't spam us
39 onUsageModeChanged: { root.timer.start(); }
41 property var wrapped: GSettings {
42 schema.id: "com.canonical.Unity8"
43 Component.onCompleted: {
44 // init the value. it's a dynamic prop, so we have to check first
46 root.usageMode = root.wrapped.usageMode;