mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectproplist.cpp
branchRCL_3
changeset 67 16db3449d7ba
parent 53 e42293e811d8
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectproplist.cpp	Wed Sep 15 12:45:22 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectproplist.cpp	Wed Oct 13 15:06:09 2010 +0300
@@ -500,11 +500,29 @@
         properties = iDpConfig.GetSupportedPropertiesL( formatCode );
 
     const TInt count = properties->Count();
+
+    TInt err = KErrNone;
+    TBool successQuery = EFalse;
     for ( TInt i = 0; i < count; i++ )
         {
-        ServiceOneObjectPropertyL( aHandle, (*properties)[i] );
+        // no need to do the trap anymore, this is being handle internally in Media DP's ServiceSpecificObjectPropertyL,
+        // also, this base class should not know too much of different handling between different formats
+        err = ServiceOneObjectPropertyL( aHandle, (*properties)[i] );
+        if ( err == KErrNone )
+            successQuery = ETrue;
+        if ( err == KErrNotSupported || err == KErrNotFound )  // Skip
+            err = KErrNone;
+        if ( err != KErrNone )
+            break;
         }
-    return KErrNone;
+
+    // In PC Suite combined mode, a file that was found at the beginning could be deleted by PC Suite protocol
+    // Need to fail it here.
+    if ( successQuery == EFalse )
+        err = KErrNotFound;
+
+    PRINT1( _L( "MM MTP <= CGetObjectPropList::ServiceAllPropertiesL err = %d" ), err );
+    return err;
     }
 
 // -----------------------------------------------------------------------------
@@ -608,10 +626,17 @@
         // Filename
         case EMTPObjectPropCodeObjectFileName:
             {
+#ifdef  _DEBUG
+            HBufC* log = iObject->DesC( CMTPObjectMetaData::ESuid ).Alloc();
+            PRINT1( _L( "MM MTP <> CGetObjectPropList::ServiceOneObjectPropertyL FileName = %S" ), log );
+            delete log;
+            log = NULL;
+#endif // _DEBUG
             TParsePtrC parse( iObject->DesC( CMTPObjectMetaData::ESuid ) );
-            PRINT1( _L( "MM MTP <> CGetObjectPropList::ServiceOneObjectPropertyL FileName = %S" ), &parse.FullName() );
+            textData = CMTPTypeString::NewLC( parse.NameAndExt() );    // + textData
             iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode) );
-            iPropertyElement->SetStringL( CMTPTypeObjectPropListElement::EValue, parse.NameAndExt() );
+            iPropertyElement->SetStringL( CMTPTypeObjectPropListElement::EValue, textData->StringChars() );
+            CleanupStack::PopAndDestroy( textData );    // - textData
             }
             break;
 
@@ -619,13 +644,7 @@
         case EMTPObjectPropCodeParentObject:
             {
             iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode ) );
-            TUint32 parentHandle = iObject->Uint( CMTPObjectMetaData::EParentHandle );
-            // refer to 5.3.1.9 of MTP Spec 1.0
-            if ( parentHandle == KMTPHandleNoParent )
-                {
-                parentHandle = KMTPHandleNone;
-                }
-            iPropertyElement->SetUint32L( CMTPTypeObjectPropListElement::EValue, parentHandle );
+            iPropertyElement->SetUint32L( CMTPTypeObjectPropListElement::EValue, iObject->Uint( CMTPObjectMetaData::EParentHandle ) );
             }
             break;