From e9c835f4774b20ab20bd16a2602df35cecf3281b Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Wed, 23 Nov 2016 18:44:26 +0100 Subject: [PATCH] Prefer properties to functions --- plasmoid/package/contents/ui/main.qml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plasmoid/package/contents/ui/main.qml b/plasmoid/package/contents/ui/main.qml index fc522f415..33c3e03ce 100644 --- a/plasmoid/package/contents/ui/main.qml +++ b/plasmoid/package/contents/ui/main.qml @@ -28,10 +28,6 @@ Item width: units.gridUnit * 20 height: units.gridUnit * 32 - function isConstrained() { - return (plasmoid.formFactor == PlasmaCore.Types.Vertical || plasmoid.formFactor == PlasmaCore.Types.Horizontal); - } - DevicesModel { id: connectDeviceModel displayFilter: DevicesModel.Paired | DevicesModel.Reachable @@ -49,7 +45,9 @@ Item devicesModel: connectDeviceModel } - Plasmoid.preferredRepresentation: isConstrained() ? Plasmoid.compactRepresentation : Plasmoid.fullRepresentation + readonly property bool isConstrained: (plasmoid.formFactor == PlasmaCore.Types.Vertical || plasmoid.formFactor == PlasmaCore.Types.Horizontal) + + Plasmoid.preferredRepresentation: isConstrained ? Plasmoid.compactRepresentation : Plasmoid.fullRepresentation ProcessRunner { id: processRunner