Fixed crash

This commit is contained in:
Albert Vaca 2017-02-21 00:08:03 +01:00
parent 1cbc067205
commit 51e4116886

View file

@ -68,8 +68,10 @@ DeviceIndicator::DeviceIndicator(DeviceDbusInterface* device)
connect(device, SIGNAL(nameChanged(QString)), this, SLOT(setText(QString)));
auto battery = new BatteryAction(device);
addAction(battery);
setWhenAvailable(device->hasPlugin("kdeconnect_battery"),
[this, device](bool available) { if (available) addAction(new BatteryAction(device)); }
[this, battery](bool available) { battery->setVisible(available); }
, this);
auto browse = addAction(i18n("Browse device"));