bluetoothengine/btnotif/btnotifsrv/src/bluetoothnotification.cpp
changeset 40 997690c3397a
parent 33 837dcc42fd6a
child 41 0b2439c3e397
--- a/bluetoothengine/btnotif/btnotifsrv/src/bluetoothnotification.cpp	Fri Jun 11 13:48:51 2010 +0300
+++ b/bluetoothengine/btnotif/btnotifsrv/src/bluetoothnotification.cpp	Wed Jun 23 18:23:52 2010 +0300
@@ -161,7 +161,6 @@
     {
     BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, aType );
     TBuf16<6> key;
-    TInt err = 0;
     CHbSymbianVariant* value = NULL;
     switch( aType )
         {
@@ -191,12 +190,7 @@
                     TPtrC16 *ptr = (TPtrC16 *)value->Data();
                     BOstraceExt2( TRACE_DEBUG, DUMMY_DEVLIST, "SetData [%S] = [%S]", &p, ptr);
                     );
-            err = iNotificationData->Add( key, value );   // Takes ownership of value
-            if ( err )
-                {
-                // Note: need a proper exception handling. 
-                // NOTIF_NOTHANDLED( err )
-                }
+            User::LeaveIfError(iNotificationData->Add( key, value ));   // Takes ownership of value
             break;
         case TBluetoothDialogParams::EResource:
         case TBluetoothDeviceDialog::EDeviceClass:
@@ -220,7 +214,6 @@
     {
     BOstraceFunctionEntryExt( DUMMY_DEVLIST, this, aType );
     TBuf<6> key;
-    TInt err = 0;
     CHbSymbianVariant* value = NULL;
     switch( aType )
         {
@@ -251,13 +244,7 @@
                     TInt *intPtr = (TInt *)value->Data();
                     BOstraceExt2( TRACE_DEBUG, DUMMY_DEVLIST, "SetData [%S] = [%d]", &p, *intPtr);
                     );
-			err = iNotificationData->Add( key, value );   // Takes ownership of value
-	         if ( err )
-	             {
-                 // need a proper exception handling.
-                 //NOTIF_NOTHANDLED( !err )
-	             }
-            
+			User::LeaveIfError(iNotificationData->Add( key, value ));   // Takes ownership of value
             break;
         case TBluetoothDialogParams::EAddress:
         case TBluetoothDeviceDialog::EDeviceName:
@@ -297,7 +284,10 @@
                 }
             }
         }
-    iObserver->MBRDataReceived( aData );
+    if( iObserver )
+        {
+    	iObserver->MBRDataReceived( aData );
+        }
     BOstraceFunctionExit1( DUMMY_DEVLIST, this );
     }