bluetoothengine/btui/btuidelegate/btdelegatepair.cpp
changeset 57 5ebadcda06cb
parent 42 b72428996822
child 67 16e4b9007960
--- a/bluetoothengine/btui/btuidelegate/btdelegatepair.cpp	Fri Aug 06 16:43:21 2010 +0300
+++ b/bluetoothengine/btui/btuidelegate/btdelegatepair.cpp	Fri Sep 03 16:17:59 2010 +0300
@@ -47,6 +47,15 @@
     delete mLoader;
 }
 
+/*!
+    Returns the supported editor types.
+    \return the sum of supported editor types
+ */
+int BtDelegatePair::supportedEditorTypes() const
+{
+    return BtDelegate::PairDevice;
+}
+
 void BtDelegatePair::exec( const QVariant &params )
 {
     
@@ -60,8 +69,8 @@
         //todo: Do we ask for user confirmation here..?
         if (!mAbstractDelegate) { 
             mAbstractDelegate = BtDelegateFactory::newDelegate(BtDelegate::ManagePower, 
-                    getSettingModel(), getDeviceModel() ); 
-            connect( mAbstractDelegate, SIGNAL(commandCompleted(int)), this, SLOT(powerDelegateCompleted(int)) );
+                    settingModel(), deviceModel() ); 
+            connect( mAbstractDelegate, SIGNAL(delegateCompleted(int,BtAbstractDelegate*)), this, SLOT(powerDelegateCompleted(int)) );
             mAbstractDelegate->exec(QVariant(BtPowerOn));
         }
     }
@@ -71,7 +80,6 @@
 void BtDelegatePair::powerDelegateCompleted(int error)
 {
     if (mAbstractDelegate) {
-        disconnect(mAbstractDelegate);
         delete mAbstractDelegate;
         mAbstractDelegate = 0;
     }
@@ -87,10 +95,10 @@
 void BtDelegatePair::exec_pair()
 {
     int error = KErrNone;
-    mdeviceName = getDeviceModel()->data(deviceIndex,BtDeviceModel::NameAliasRole).toString();
+    mdeviceName = deviceModel()->data(deviceIndex,BtDeviceModel::NameAliasRole).toString();
     
-    QString strBtAddr = getDeviceModel()->data(deviceIndex,BtDeviceModel::ReadableBdaddrRole).toString();
-    int cod = getDeviceModel()->data(deviceIndex,BtDeviceModel::CoDRole).toInt();
+    QString strBtAddr = deviceModel()->data(deviceIndex,BtDeviceModel::ReadableBdaddrRole).toString();
+    int cod = deviceModel()->data(deviceIndex,BtDeviceModel::CoDRole).toInt();
     
     if ( ! mBtengConnMan ){
         TRAP( error, mBtengConnMan = CBTEngConnMan::NewL(this) );
@@ -166,7 +174,7 @@
 void BtDelegatePair::emitCommandComplete(int error)
 {
 
-    emit commandCompleted(error);
+    emit delegateCompleted(error, this);
 }
 
 void BtDelegatePair::cancel()