Warning, /network/kdeconnect-kde/declarativeplugin/qml/PluginChecker.qml is written in an unsupported language. File is not indexed.

0001 /**
0002  * SPDX-FileCopyrightText: 2014 Samoilenko Yuri <kinnalru@gmail.com>
0003  * SPDX-FileCopyrightText: 2016 David Kahles <david.kahles96@gmail.com>
0004  *
0005  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0006  */
0007 
0008 import QtQml 2.2
0009 import org.kde.kdeconnect 1.0
0010 
0011 QtObject {
0012 
0013     id: root
0014 
0015     property alias device: conn.target
0016     property string pluginName: ""
0017     property bool available: false
0018     property string iconName: ""
0019 
0020     readonly property Connections connection: Connections {
0021         id: conn
0022         function onPluginsChanged() {
0023             root.pluginsChanged();
0024         }
0025     }
0026 
0027     Component.onCompleted: pluginsChanged()
0028 
0029     readonly property var v: DBusAsyncResponse {
0030         id: availableResponse
0031         autoDelete: false
0032         onSuccess: (result) => { root.available = result; }
0033         onError: () => { root.available = false }
0034     }
0035 
0036     function pluginsChanged() {
0037         availableResponse.setPendingCall(device.hasPlugin("kdeconnect_" + pluginName))
0038         iconResponse.setPendingCall(device.pluginIconName("kdeconnect_" + pluginName))
0039 
0040     }
0041 
0042     readonly property var vv: DBusAsyncResponse {
0043         id: iconResponse
0044         autoDelete: false
0045         onSuccess: (result) => { root.iconName = result; }
0046         onError: () => { root.iconName = "" }
0047     }
0048 }