diff --git a/qml/components/Librespot.qml b/qml/components/Librespot.qml index ce844d0..2a024f6 100644 --- a/qml/components/Librespot.qml +++ b/qml/components/Librespot.qml @@ -11,7 +11,7 @@ import org.nemomobile.dbus 2.0 Item { property alias serviceEnabled: manager.librespotServiceEnabled - property alias serviceRunning: librespotService.serviceRunning + property alias serviceRunning: librespotUnit.serviceRunning /*onLibrespotServiceEnabled: { console.log("onLibrespotServiceEnabled: " + librespotServiceEnabled) @@ -21,7 +21,7 @@ Item { }*/ DBusInterface { - id: librespotService + id: librespotUnit property bool serviceRunning: false @@ -32,9 +32,9 @@ Item { signalsEnabled: true function updateState() { - console.log("librespotService.updateState: path=" + path) + console.log("librespotUnit.updateState: path=" + path) if (path !== "") { - var activeState = librespotService.getProperty("ActiveState") + var activeState = librespotUnit.getProperty("ActiveState") if (activeState === "active") { serviceRunning = true } else if(activeState === "inactive") { @@ -52,6 +52,46 @@ Item { } } + function getName() { + return getEnvironmentVariable("DEVICE_NAME") + } + + function getEnvironmentVariable(name) { + var i + if(!librespotService.environment) + return "" + for(i=0;i