Fixed KCM updating the wrong device if selection was changed
Info displayed when pairing was always shown in the currently selected device
This commit is contained in:
parent
8883b2770e
commit
95cbc13fa9
1 changed files with 7 additions and 3 deletions
10
kcm/kcm.cpp
10
kcm/kcm.cpp
|
@ -86,7 +86,6 @@ void KdeConnectKcm::resetSelection()
|
|||
kcmUi->deviceList->selectionModel()->setCurrentIndex(sortProxyModel->mapFromSource(currentIndex), QItemSelectionModel::ClearAndSelect);
|
||||
}
|
||||
|
||||
|
||||
void KdeConnectKcm::deviceSelected(const QModelIndex& current)
|
||||
{
|
||||
|
||||
|
@ -182,6 +181,8 @@ void KdeConnectKcm::unpair()
|
|||
|
||||
void KdeConnectKcm::pairingFailed(const QString& error)
|
||||
{
|
||||
if (sender() != currentDevice) return;
|
||||
|
||||
kcmUi->messages->setText(i18n("Error trying to pair: %1",error));
|
||||
kcmUi->messages->animatedShow();
|
||||
kcmUi->progressBar->setVisible(false);
|
||||
|
@ -190,14 +191,17 @@ void KdeConnectKcm::pairingFailed(const QString& error)
|
|||
|
||||
void KdeConnectKcm::pairingSuccesful()
|
||||
{
|
||||
DeviceDbusInterface* sender = (DeviceDbusInterface*) sender();
|
||||
devicesModel->deviceStatusChanged(sender->id());
|
||||
|
||||
if (sender != currentDevice) return;
|
||||
|
||||
kcmUi->progressBar->setVisible(false);
|
||||
kcmUi->unpair_button->setVisible(true);
|
||||
kcmUi->pair_button->setVisible(false);
|
||||
kcmUi->ping_button->setVisible(true);
|
||||
|
||||
kcmUi->status_label->setText(i18n("(paired)"));
|
||||
|
||||
devicesModel->deviceStatusChanged(currentDevice->id());
|
||||
}
|
||||
|
||||
void KdeConnectKcm::pluginsConfigChanged()
|
||||
|
|
Loading…
Reference in a new issue