bluetoothengine/btui/Ecom/src/BTUIPairedDevicesView.cpp
changeset 23 988cddd6adbd
parent 22 4255033c5d30
child 14 f7fbeaeb166a
child 26 b78e66e88238
--- a/bluetoothengine/btui/Ecom/src/BTUIPairedDevicesView.cpp	Fri Apr 23 23:23:50 2010 +0300
+++ b/bluetoothengine/btui/Ecom/src/BTUIPairedDevicesView.cpp	Fri Apr 23 23:38:44 2010 +0300
@@ -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