From 9447d7e5def9f3a2d2bcaab10e7b646faaf041a3 Mon Sep 17 00:00:00 2001 From: Simon Redman Date: Sun, 5 May 2019 12:11:23 -0600 Subject: [PATCH] Rearrange ConversationListModel to not set deviceID when it has been determined to be invalid --- smsapp/conversationlistmodel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/smsapp/conversationlistmodel.cpp b/smsapp/conversationlistmodel.cpp index 5b545a7b5..7a0c6af4a 100644 --- a/smsapp/conversationlistmodel.cpp +++ b/smsapp/conversationlistmodel.cpp @@ -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)));