mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectproplist.cpp
branchRCL_3
changeset 67 16db3449d7ba
parent 53 e42293e811d8
equal deleted inserted replaced
63:91d5ad76f5c6 67:16db3449d7ba
   498         properties = iDpConfig.GetAllSupportedProperties();
   498         properties = iDpConfig.GetAllSupportedProperties();
   499     else
   499     else
   500         properties = iDpConfig.GetSupportedPropertiesL( formatCode );
   500         properties = iDpConfig.GetSupportedPropertiesL( formatCode );
   501 
   501 
   502     const TInt count = properties->Count();
   502     const TInt count = properties->Count();
       
   503 
       
   504     TInt err = KErrNone;
       
   505     TBool successQuery = EFalse;
   503     for ( TInt i = 0; i < count; i++ )
   506     for ( TInt i = 0; i < count; i++ )
   504         {
   507         {
   505         ServiceOneObjectPropertyL( aHandle, (*properties)[i] );
   508         // no need to do the trap anymore, this is being handle internally in Media DP's ServiceSpecificObjectPropertyL,
   506         }
   509         // also, this base class should not know too much of different handling between different formats
   507     return KErrNone;
   510         err = ServiceOneObjectPropertyL( aHandle, (*properties)[i] );
       
   511         if ( err == KErrNone )
       
   512             successQuery = ETrue;
       
   513         if ( err == KErrNotSupported || err == KErrNotFound )  // Skip
       
   514             err = KErrNone;
       
   515         if ( err != KErrNone )
       
   516             break;
       
   517         }
       
   518 
       
   519     // In PC Suite combined mode, a file that was found at the beginning could be deleted by PC Suite protocol
       
   520     // Need to fail it here.
       
   521     if ( successQuery == EFalse )
       
   522         err = KErrNotFound;
       
   523 
       
   524     PRINT1( _L( "MM MTP <= CGetObjectPropList::ServiceAllPropertiesL err = %d" ), err );
       
   525     return err;
   508     }
   526     }
   509 
   527 
   510 // -----------------------------------------------------------------------------
   528 // -----------------------------------------------------------------------------
   511 // CGetObjectPropList::ServiceGroupPropertiesL
   529 // CGetObjectPropList::ServiceGroupPropertiesL
   512 // Get the grouped object properties for specific object
   530 // Get the grouped object properties for specific object
   606             break;
   624             break;
   607 
   625 
   608         // Filename
   626         // Filename
   609         case EMTPObjectPropCodeObjectFileName:
   627         case EMTPObjectPropCodeObjectFileName:
   610             {
   628             {
       
   629 #ifdef  _DEBUG
       
   630             HBufC* log = iObject->DesC( CMTPObjectMetaData::ESuid ).Alloc();
       
   631             PRINT1( _L( "MM MTP <> CGetObjectPropList::ServiceOneObjectPropertyL FileName = %S" ), log );
       
   632             delete log;
       
   633             log = NULL;
       
   634 #endif // _DEBUG
   611             TParsePtrC parse( iObject->DesC( CMTPObjectMetaData::ESuid ) );
   635             TParsePtrC parse( iObject->DesC( CMTPObjectMetaData::ESuid ) );
   612             PRINT1( _L( "MM MTP <> CGetObjectPropList::ServiceOneObjectPropertyL FileName = %S" ), &parse.FullName() );
   636             textData = CMTPTypeString::NewLC( parse.NameAndExt() );    // + textData
   613             iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode) );
   637             iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode) );
   614             iPropertyElement->SetStringL( CMTPTypeObjectPropListElement::EValue, parse.NameAndExt() );
   638             iPropertyElement->SetStringL( CMTPTypeObjectPropListElement::EValue, textData->StringChars() );
       
   639             CleanupStack::PopAndDestroy( textData );    // - textData
   615             }
   640             }
   616             break;
   641             break;
   617 
   642 
   618         // Parent Object
   643         // Parent Object
   619         case EMTPObjectPropCodeParentObject:
   644         case EMTPObjectPropCodeParentObject:
   620             {
   645             {
   621             iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode ) );
   646             iPropertyElement = &( iPropertyList->ReservePropElemL( aHandle, aPropCode ) );
   622             TUint32 parentHandle = iObject->Uint( CMTPObjectMetaData::EParentHandle );
   647             iPropertyElement->SetUint32L( CMTPTypeObjectPropListElement::EValue, iObject->Uint( CMTPObjectMetaData::EParentHandle ) );
   623             // refer to 5.3.1.9 of MTP Spec 1.0
       
   624             if ( parentHandle == KMTPHandleNoParent )
       
   625                 {
       
   626                 parentHandle = KMTPHandleNone;
       
   627                 }
       
   628             iPropertyElement->SetUint32L( CMTPTypeObjectPropListElement::EValue, parentHandle );
       
   629             }
   648             }
   630             break;
   649             break;
   631 
   650 
   632         // PUID
   651         // PUID
   633         case EMTPObjectPropCodePersistentUniqueObjectIdentifier:
   652         case EMTPObjectPropCodePersistentUniqueObjectIdentifier: