mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-05 15:25:51 +02:00
devicemodel: do not lock when emitting signal
This can cause a deadlock, also use onAccepted to avoid sporadic changes Change-Id: Ic7ff97b7e8fdd64da981eaf0b3148edd6d4eccd6 GitLab: #1011
This commit is contained in:
parent
b9f2ebd1a5
commit
9f42301b5c
2 changed files with 3 additions and 3 deletions
|
@ -89,7 +89,7 @@ ItemDelegate {
|
||||||
loseFocusWhenEnterPressed: true
|
loseFocusWhenEnterPressed: true
|
||||||
backgroundColor: JamiTheme.transparentColor
|
backgroundColor: JamiTheme.transparentColor
|
||||||
|
|
||||||
onEditingFinished: {
|
onAccepted: {
|
||||||
AvAdapter.setDeviceName(editDeviceName.text)
|
AvAdapter.setDeviceName(editDeviceName.text)
|
||||||
editable = !editable
|
editable = !editable
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,12 +105,12 @@ DeviceModel::setCurrentDeviceName(const QString& newName)
|
||||||
config.deviceName = newName;
|
config.deviceName = newName;
|
||||||
owner.accountModel->setAccountConfig(owner.id, config);
|
owner.accountModel->setAccountConfig(owner.id, config);
|
||||||
// Update model
|
// Update model
|
||||||
std::lock_guard<std::mutex> lock(pimpl_->devicesMtx_);
|
std::unique_lock<std::mutex> lock(pimpl_->devicesMtx_);
|
||||||
for (auto& device : pimpl_->devices_) {
|
for (auto& device : pimpl_->devices_) {
|
||||||
if (device.id == config.deviceId) {
|
if (device.id == config.deviceId) {
|
||||||
device.name = newName;
|
device.name = newName;
|
||||||
|
lock.unlock();
|
||||||
Q_EMIT deviceUpdated(device.id);
|
Q_EMIT deviceUpdated(device.id);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue