bluetoothengine/btui/Ecom/src/BTUIPairedDevicesView.cpp
branchRCL_3
changeset 8 0707dd69d236
parent 6 6a29d5ad0713
child 11 f7fbeaeb166a
--- a/bluetoothengine/btui/Ecom/src/BTUIPairedDevicesView.cpp	Fri Feb 19 22:59:18 2010 +0200
+++ b/bluetoothengine/btui/Ecom/src/BTUIPairedDevicesView.cpp	Fri Mar 12 15:43:23 2010 +0200
@@ -289,6 +289,11 @@
             TBTDevice device;
             device.iIndex = iContainer->CurrentItemIndex();
             iModel->GetDevice(device);
+            if ( device.iStatus & EStatusBtuiConnected )
+                {
+                // If device is already connected, we do nothing here. 
+                break;
+                }
             device.iOperation = EOpConnect;
             ConnectL( device, ETrue );
 	        break;            	
@@ -1069,6 +1074,13 @@
     TBTDevice device;
     device.iIndex = index;
     iModel->GetDevice(device);
+    
+    if ( !( device.iStatus & EStatusBtuiConnected) )
+        {
+        // If device is already disconnected, return immediately.
+        return;
+        }
+    
 	iDisconnectQueryDevice = device;//remember device related with query dialog
 
     // Create confirmation query