[applets/batterymonitor] Add more syntax sugar

GIT_SILENT
wilder-5.24
ivan tkachenko 4 years ago
parent 8dac78d8ea
commit 4fffe342fc
No known key found for this signature in database
GPG Key ID: 4D197017E61437CF
  1. 12
      applets/batterymonitor/package/contents/ui/batterymonitor.qml

@ -229,7 +229,7 @@ Item {
property int cookie1: -1
property int cookie2: -1
onPowermanagementChanged: {
onPowermanagementChanged: disabled => {
var service = pmSource.serviceForSource("PowerDevil");
if (disabled) {
var reason = i18n("The battery applet has enabled system-wide inhibition");
@ -239,12 +239,12 @@ Item {
op2.reason = reason;
var job1 = service.startOperationCall(op1);
job1.finished.connect(function(job) {
job1.finished.connect(job => {
cookie1 = job.result;
});
var job2 = service.startOperationCall(op2);
job2.finished.connect(function(job) {
job2.finished.connect(job => {
cookie2 = job.result;
});
} else {
@ -254,12 +254,12 @@ Item {
op2.cookie = cookie2;
var job1 = service.startOperationCall(op1);
job1.finished.connect(function(job) {
job1.finished.connect(job => {
cookie1 = -1;
});
var job2 = service.startOperationCall(op2);
job2.finished.connect(function(job) {
job2.finished.connect(job => {
cookie2 = -1;
});
}
@ -278,7 +278,7 @@ Item {
op.profile = profile;
let job = service.startOperationCall(op);
job.finished.connect((job) => {
job.finished.connect(job => {
dialogItem.activeProfile = Qt.binding(() => actuallyActiveProfile)
if (!job.result) {
var notifications = notificationSource.serviceForSource("notification")

Loading…
Cancel
Save