14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 #include "conversationsengine.h" |
17 #include "conversationsengine.h" |
18 |
18 |
|
19 #include <ccsconversationentry.h> |
|
20 #include <ccsclientconversation.h> |
|
21 |
19 #include "conversationsenginedefines.h" |
22 #include "conversationsenginedefines.h" |
20 #include "convergedmessage.h" |
23 #include "convergedmessage.h" |
21 #include "conversationmsgstorehandler.h" |
24 #include "conversationmsgstorehandler.h" |
22 #include "conversationssummarymodel.h" |
25 #include "conversationssummarymodel.h" |
23 #include "conversationsmodel.h" |
26 #include "conversationsmodel.h" |
50 this); |
53 this); |
51 |
54 |
52 d_ptr = new ConversationsEnginePrivate(mConversationMsgStoreHandler, |
55 d_ptr = new ConversationsEnginePrivate(mConversationMsgStoreHandler, |
53 mConversationsSummaryModel, |
56 mConversationsSummaryModel, |
54 mConversationsModel); |
57 mConversationsModel); |
|
58 |
|
59 connect (mConversationsModel, |
|
60 SIGNAL(conversationViewEmpty()), |
|
61 this, |
|
62 SIGNAL(conversationViewEmpty())); |
|
63 |
55 } |
64 } |
56 |
65 |
57 //--------------------------------------------------------------- |
66 //--------------------------------------------------------------- |
58 // ConversationsEngine::~ConversationsEngine |
67 // ConversationsEngine::~ConversationsEngine |
59 // @see header |
68 // @see header |
210 |
219 |
211 if(indexList.count() > 0) |
220 if(indexList.count() > 0) |
212 { |
221 { |
213 displayName = indexList[0].data(DisplayName).toString(); |
222 displayName = indexList[0].data(DisplayName).toString(); |
214 address = indexList[0].data(ConversationAddress).toString(); |
223 address = indexList[0].data(ConversationAddress).toString(); |
215 } |
224 } |
|
225 else |
|
226 { |
|
227 int error; |
|
228 CCsClientConversation* clientConv = NULL; |
|
229 TRAP(error, clientConv = d_ptr->getConversationFromConversationIdL(conversationId)); |
|
230 |
|
231 HBufC *name = clientConv->GetDisplayName(); |
|
232 if (name && name->Length()) |
|
233 { |
|
234 displayName = XQConversions::s60DescToQString(*name); |
|
235 } |
|
236 |
|
237 HBufC *addr = clientConv->GetConversationEntry()->Contact(); |
|
238 if (addr && addr->Length()) |
|
239 { |
|
240 address = XQConversions::s60DescToQString(*addr); |
|
241 } |
|
242 |
|
243 delete clientConv; |
|
244 } |
216 } |
245 } |
217 |
246 |
218 //--------------------------------------------------------------- |
247 //--------------------------------------------------------------- |
219 // ConversationsEngine::getConversationIdFromAddress |
248 // ConversationsEngine::getConversationIdFromAddress |
220 // @see header |
249 // @see header |
282 { |
311 { |
283 emit conversationListModelPopulated(); |
312 emit conversationListModelPopulated(); |
284 } |
313 } |
285 |
314 |
286 //--------------------------------------------------------------- |
315 //--------------------------------------------------------------- |
|
316 // ConversationsEngine::emitConversationListModelEntryDeleted |
|
317 // @see header |
|
318 //--------------------------------------------------------------- |
|
319 void ConversationsEngine::emitConversationListModelEntryDeleted( int conversationId ) |
|
320 { |
|
321 emit conversationListEntryDeleted( conversationId ); |
|
322 } |
|
323 |
|
324 //--------------------------------------------------------------- |
|
325 // ConversationsEngine::emitOpenConversationViewIdUpdate |
|
326 // @see header |
|
327 //--------------------------------------------------------------- |
|
328 void ConversationsEngine::emitOpenConversationViewIdUpdate( |
|
329 int newConversationId) |
|
330 { |
|
331 //also register for subscription now |
|
332 d_ptr->registerAgainForConversationUpdatesL(newConversationId); |
|
333 } |
|
334 |
|
335 //--------------------------------------------------------------- |
|
336 // ConversationsEngine::disableRegisterationForCVEvents |
|
337 // @see header |
|
338 //--------------------------------------------------------------- |
|
339 void ConversationsEngine::disableRegisterationForCVEvents() |
|
340 { |
|
341 d_ptr->deRegisterCVUpdatesTemporary(); |
|
342 } |
|
343 |
|
344 //--------------------------------------------------------------- |
287 // ConversationsEngine::fetchMoreConversations |
345 // ConversationsEngine::fetchMoreConversations |
288 // @see header |
346 // @see header |
289 //--------------------------------------------------------------- |
347 //--------------------------------------------------------------- |
290 void ConversationsEngine::fetchMoreConversations() |
348 void ConversationsEngine::fetchMoreConversations() |
291 { |
349 { |