406 */ |
407 */ |
407 void NmHsWidgetEmailEngine::launchMailAppInboxView() |
408 void NmHsWidgetEmailEngine::launchMailAppInboxView() |
408 { |
409 { |
409 NM_FUNCTION; |
410 NM_FUNCTION; |
410 |
411 |
411 XQApplicationManager appManager; |
412 QT_TRY{ |
412 XQAiwRequest* request = appManager.create( |
413 if (!mAiwRequest) { |
413 XQI_EMAIL_INBOX_VIEW, XQOP_EMAIL_INBOX_VIEW, |
414 XQApplicationManager appManager; |
414 false); |
415 mAiwRequest = appManager.create( |
415 |
416 XQI_EMAIL_INBOX_VIEW, XQOP_EMAIL_INBOX_VIEW, |
416 if (request) { |
417 false); |
417 QList<QVariant> list; |
418 |
418 list.append(QVariant(mMailboxId.id())); |
419 if (mAiwRequest) { |
419 |
420 connect(mAiwRequest, SIGNAL( requestError(int, const QString&) ), |
420 request->setArguments(list); |
421 this, SLOT( aiwRequestError(int, const QString&) )); |
421 request->send(); |
422 connect(mAiwRequest, SIGNAL( requestOk(const QVariant&) ), |
|
423 this, SLOT( aiwRequestOk(const QVariant&) )); |
|
424 QList<QVariant> list; |
|
425 list.append(QVariant(mMailboxId.id())); |
|
426 |
|
427 mAiwRequest->setSynchronous(false); |
|
428 mAiwRequest->setArguments(list); |
|
429 mAiwRequest->send(); |
|
430 } |
|
431 } |
|
432 } |
|
433 QT_CATCH(...){ |
|
434 // no actions taken. |
|
435 // try-catch mechanism added to avoid crashing widget, in case XQAiwRequest |
|
436 // creation raise exception. |
422 } |
437 } |
423 } |
438 } |
424 |
439 |
425 /*! |
440 /*! |
426 launchMailAppMailViewer slot. |
441 launchMailAppMailViewer slot. |
429 */ |
444 */ |
430 void NmHsWidgetEmailEngine::launchMailAppMailViewer(const NmId &messageId) |
445 void NmHsWidgetEmailEngine::launchMailAppMailViewer(const NmId &messageId) |
431 { |
446 { |
432 NM_FUNCTION; |
447 NM_FUNCTION; |
433 |
448 |
434 XQApplicationManager appManager; |
449 QT_TRY{ |
435 XQAiwRequest* request = appManager.create( |
450 if (!mAiwRequest) { |
436 XQI_EMAIL_MESSAGE_VIEW, XQOP_EMAIL_MESSAGE_VIEW, |
451 XQApplicationManager appManager; |
437 false); |
452 mAiwRequest = appManager.create( |
438 |
453 XQI_EMAIL_MESSAGE_VIEW, XQOP_EMAIL_MESSAGE_VIEW, |
439 if (request) { |
454 false); |
440 QList<QVariant> list; |
455 |
441 list.append(QVariant(mMailboxId.id())); |
456 if (mAiwRequest) { |
442 list.append(QVariant(mFolderId.id())); |
457 connect(mAiwRequest, SIGNAL( requestError(int, const QString&) ), |
443 list.append(QVariant(messageId.id())); |
458 this, SLOT( aiwRequestError(int, const QString&) )); |
444 |
459 connect(mAiwRequest, SIGNAL( requestOk(const QVariant&) ), |
445 request->setArguments(list); |
460 this, SLOT( aiwRequestOk(const QVariant&) )); |
446 request->send(); |
461 QList<QVariant> list; |
447 } |
462 list.append(QVariant(mMailboxId.id())); |
448 } |
463 list.append(QVariant(mFolderId.id())); |
|
464 list.append(QVariant(messageId.id())); |
|
465 |
|
466 mAiwRequest->setSynchronous(false); |
|
467 mAiwRequest->setArguments(list); |
|
468 mAiwRequest->send(); |
|
469 } |
|
470 } |
|
471 } |
|
472 QT_CATCH(...){ |
|
473 // no actions taken. |
|
474 // try-catch mechanism added to avoid crashing widget, in case XQAiwRequest |
|
475 // creation raise exception. |
|
476 } |
|
477 } |
|
478 |
|
479 /*! |
|
480 aiwRequestOk slot. |
|
481 */ |
|
482 void NmHsWidgetEmailEngine::aiwRequestOk(const QVariant& result) |
|
483 { |
|
484 NM_FUNCTION; |
|
485 |
|
486 Q_UNUSED(result); |
|
487 |
|
488 deleteAiwRequest(); |
|
489 } |
|
490 |
|
491 /*! |
|
492 aiwRequestError slot. |
|
493 */ |
|
494 void NmHsWidgetEmailEngine::aiwRequestError(int errorCode, const QString& errorMessage) |
|
495 { |
|
496 NM_FUNCTION; |
|
497 |
|
498 Q_UNUSED(errorCode); |
|
499 Q_UNUSED(errorMessage); |
|
500 |
|
501 deleteAiwRequest(); |
|
502 } |
|
503 |
|
504 /*! |
|
505 deleteAiwRequest function. |
|
506 */ |
|
507 void NmHsWidgetEmailEngine::deleteAiwRequest() |
|
508 { |
|
509 NM_FUNCTION; |
|
510 |
|
511 delete mAiwRequest; |
|
512 mAiwRequest = NULL; |
|
513 } |
|
514 |