bluetoothengine/btui/btcpplugin/btcpuideviceview.cpp
changeset 67 16e4b9007960
parent 57 5ebadcda06cb
child 70 f5508c13dfe0
equal deleted inserted replaced
65:001a94c71129 67:16e4b9007960
    28 #include <hblabel.h>
    28 #include <hblabel.h>
    29 #include <hbicon.h>
    29 #include <hbicon.h>
    30 #include <hblineedit.h>
    30 #include <hblineedit.h>
    31 #include <hblistview.h>
    31 #include <hblistview.h>
    32 #include <hbmenu.h>
    32 #include <hbmenu.h>
    33 #include <qstring>
    33 #include <QString>
    34 #include <qstringlist>
    34 #include <QStringList>
    35 #include <qdebug>
    35 #include <QDebug>
    36 #include <bluetoothuitrace.h>
    36 #include <bluetoothuitrace.h>
    37 #include <btabstractdelegate.h>
    37 #include <btabstractdelegate.h>
    38 #include <btdelegatefactory.h>
    38 #include <btdelegatefactory.h>
    39 #include "btuiiconutil.h"
    39 #include "btuiiconutil.h"
    40 #include "btuidevtypemap.h"
    40 #include "btuidevtypemap.h"
    42 #include "btcpuidevicedetail.h"
    42 #include "btcpuidevicedetail.h"
    43 #include "btcpuiviewmgr.h"
    43 #include "btcpuiviewmgr.h"
    44 
    44 
    45 // docml to load
    45 // docml to load
    46 const char* BTUI_DEVICEVIEW_DOCML = ":/docml/bt-device-view.docml";
    46 const char* BTUI_DEVICEVIEW_DOCML = ":/docml/bt-device-view.docml";
       
    47 
       
    48 
       
    49 // ToDo:  should use base class delegate instead of mAbstractDelegate, also base class createDelegate()
       
    50 // and createExecuteDelegate()
    47 
    51 
    48 BtcpuiDeviceView::BtcpuiDeviceView(BtSettingModel &settingModel, 
    52 BtcpuiDeviceView::BtcpuiDeviceView(BtSettingModel &settingModel, 
    49         BtDeviceModel &deviceModel, 
    53         BtDeviceModel &deviceModel, 
    50         QGraphicsItem *parent) :
    54         QGraphicsItem *parent) :
    51     BtcpuiBaseView(settingModel,deviceModel,parent),
    55     BtcpuiBaseView(settingModel,deviceModel,parent),
   560     BOstraceFunctionExit0(DUMMY_DEVLIST);
   564     BOstraceFunctionExit0(DUMMY_DEVLIST);
   561 }
   565 }
   562 
   566 
   563 void BtcpuiDeviceView::pairDelegateCompleted(int status)
   567 void BtcpuiDeviceView::pairDelegateCompleted(int status)
   564 {
   568 {
   565     BOstraceFunctionEntry1( DUMMY_DEVLIST, this );
   569     BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, status );
   566     Q_UNUSED(status);
   570     Q_UNUSED(status);
   567     //TODO: handle the error here
   571     //TODO: handle the error here
   568     if (mAbstractDelegate)
   572     if (mAbstractDelegate)
   569     {
   573     {
   570         delete mAbstractDelegate;
   574         delete mAbstractDelegate;
   639         list.append(mDeviceBdAddr);
   643         list.append(mDeviceBdAddr);
   640         
   644         
   641         mAbstractDelegate = BtDelegateFactory::newDelegate(
   645         mAbstractDelegate = BtDelegateFactory::newDelegate(
   642                 BtDelegate::DisconnectService, mSettingModel, mDeviceModel); 
   646                 BtDelegate::DisconnectService, mSettingModel, mDeviceModel); 
   643         // todo: check return value of connect
   647         // todo: check return value of connect
   644         connect( mAbstractDelegate, SIGNAL(delegateCompleted(int,BtAbstractDelegate*)), this, SLOT(disconnectDelegateCompleted(int)) );
   648         connect( mAbstractDelegate, SIGNAL(delegateCompleted(int,BtAbstractDelegate*)), this, 
       
   649                 SLOT(disconnectDelegateCompleted(int)) );
   645         mAbstractDelegate->exec(QVariant(list));
   650         mAbstractDelegate->exec(QVariant(list));
   646     }
   651     }
   647     BOstraceFunctionExit0(DUMMY_DEVLIST);
   652     BOstraceFunctionExit0(DUMMY_DEVLIST);
   648 }
   653 }
   649 
   654