Fixed crash
This commit is contained in:
parent
1cbc067205
commit
51e4116886
1 changed files with 3 additions and 1 deletions
|
@ -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"));
|
||||
|
|
Loading…
Reference in a new issue