Rearrange ConversationListModel to not set deviceID when it has been determined to be invalid
This commit is contained in:
parent
4a4e06f12b
commit
9447d7e5de
1 changed files with 3 additions and 3 deletions
|
@ -70,9 +70,6 @@ void ConversationListModel::setDeviceId(const QString& deviceId)
|
|||
m_conversationsInterface = nullptr;
|
||||
}
|
||||
|
||||
m_deviceId = deviceId;
|
||||
Q_EMIT deviceIdChanged();
|
||||
|
||||
// This method still gets called *with a valid deviceID* when the device is not connected while the component is setting up
|
||||
// Detect that case and don't do anything.
|
||||
DeviceDbusInterface device(deviceId);
|
||||
|
@ -80,6 +77,9 @@ void ConversationListModel::setDeviceId(const QString& deviceId)
|
|||
return;
|
||||
}
|
||||
|
||||
m_deviceId = deviceId;
|
||||
Q_EMIT deviceIdChanged();
|
||||
|
||||
m_conversationsInterface = new DeviceConversationsDbusInterface(deviceId, this);
|
||||
connect(m_conversationsInterface, SIGNAL(conversationCreated(QVariantMap)), this, SLOT(handleCreatedConversation(QVariantMap)));
|
||||
connect(m_conversationsInterface, SIGNAL(conversationUpdated(QVariantMap)), this, SLOT(handleConversationUpdated(QVariantMap)));
|
||||
|
|
Loading…
Reference in a new issue