phonebookui/phonebookservices/src/cntservicecontactcardview.cpp
changeset 50 77bc263e1626
parent 27 de1630741fbe
child 54 47627ab5d7a4
equal deleted inserted replaced
49:74b30151afd6 50:77bc263e1626
    14 * Description:
    14 * Description:
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include "cntservicecontactcardview.h"
    18 #include "cntservicecontactcardview.h"
    19 #include "cntservicehandler.h"
    19 #include "cntabstractserviceprovider.h"
    20 #include <QCoreApplication>
    20 #include "cntdebug.h"
    21 
    21 
    22 /*!
    22 /*!
    23 Constructor, initialize member variables.
    23 Constructor, initialize member variables.
    24 \a viewManager is the parent that creates this view. \a parent is a pointer to parent QGraphicsItem (by default this is 0)
    24 \a viewManager is the parent that creates this view. \a parent is a pointer to parent QGraphicsItem (by default this is 0)
    25 */
    25 */
    26 CntServiceContactCardView::CntServiceContactCardView(CntServiceHandler *aServiceHandler) : 
    26 CntServiceContactCardView::CntServiceContactCardView( CntAbstractServiceProvider& aServiceProvider ) : 
    27     CntContactCardView(),
    27     CntContactCardView(),
    28     mServiceHandler(aServiceHandler)
    28     mProvider( aServiceProvider )
    29 {
    29 {
    30     connect(this, SIGNAL(backPressed()), this, SLOT(doShowPreviousView()));
    30     CNT_ENTRY
       
    31     connect(this, SIGNAL(backPressed()), this, SLOT(closeContactCard()));
       
    32     CNT_EXIT
    31 }
    33 }
    32 
    34 
    33 /*!
    35 /*!
    34 Destructor
    36 Destructor
    35 */
    37 */
    36 CntServiceContactCardView::~CntServiceContactCardView()
    38 CntServiceContactCardView::~CntServiceContactCardView()
    37 {
    39 {
    38 
    40     CNT_ENTRY
       
    41     CNT_EXIT
    39 }
    42 }
    40 
    43 
    41 /*!
    44 /*!
    42 Close the view (quits the service as well)
    45 Close the view (quits the service as well)
    43 */
    46 */
    44 void CntServiceContactCardView::doShowPreviousView()
    47 void CntServiceContactCardView::closeContactCard()
    45 {
    48 {
    46     int result = -2;
    49     CNT_ENTRY
    47     connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
    50     int retValue = -2; // Dummy return value. Not relevant.
    48     mServiceHandler->completeEdit(result);
    51     QVariant variant;
       
    52     variant.setValue(retValue);
       
    53     mProvider.CompleteServiceAndCloseApp(variant);
       
    54     CNT_EXIT
    49 }
    55 }
    50 
    56 
    51 // end of file
    57 // end of file