Changeset View
Changeset View
Standalone View
Standalone View
smsapp/conversationmodel.cpp
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | |||||
56 | } | 56 | } | ||
57 | 57 | | |||
58 | void ConversationModel::setDeviceId(const QString& deviceId) | 58 | void ConversationModel::setDeviceId(const QString& deviceId) | ||
59 | { | 59 | { | ||
60 | if (deviceId == m_deviceId) | 60 | if (deviceId == m_deviceId) | ||
61 | return; | 61 | return; | ||
62 | 62 | | |||
63 | qCDebug(KDECONNECT_SMS_CONVERSATION_MODEL) << "setDeviceId" << "of" << this; | 63 | qCDebug(KDECONNECT_SMS_CONVERSATION_MODEL) << "setDeviceId" << "of" << this; | ||
64 | if (m_conversationsInterface) delete m_conversationsInterface; | 64 | if (m_conversationsInterface) { | ||
65 | disconnect(m_conversationsInterface, SIGNAL(conversationMessageReceived(QVariantMap, int)), this, SLOT(createRowFromMessage(QVariantMap, int))); | ||||
66 | disconnect(m_conversationsInterface, SIGNAL(conversationUpdated(QVariantMap)), this, SLOT(handleConversationUpdate(QVariantMap))); | ||||
67 | delete m_conversationsInterface; | ||||
68 | } | ||||
65 | 69 | | |||
66 | m_deviceId = deviceId; | 70 | m_deviceId = deviceId; | ||
67 | 71 | | |||
68 | m_conversationsInterface = new DeviceConversationsDbusInterface(deviceId, this); | 72 | m_conversationsInterface = new DeviceConversationsDbusInterface(deviceId, this); | ||
69 | connect(m_conversationsInterface, SIGNAL(conversationMessageReceived(QVariantMap,int)), this, SLOT(createRowFromMessage(QVariantMap,int))); | 73 | connect(m_conversationsInterface, SIGNAL(conversationMessageReceived(QVariantMap,int)), this, SLOT(createRowFromMessage(QVariantMap,int))); | ||
70 | connect(m_conversationsInterface, SIGNAL(conversationUpdated(QVariantMap)), this, SLOT(handleConversationUpdate(QVariantMap))); | 74 | connect(m_conversationsInterface, SIGNAL(conversationUpdated(QVariantMap)), this, SLOT(handleConversationUpdate(QVariantMap))); | ||
71 | } | 75 | } | ||
72 | 76 | | |||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |