mmappcomponents/harvester/metadataextractor/src/mpxmetadataextractor.cpp
changeset 57 f4fd77a452f2
parent 51 e61a04404bdf
child 61 3b098142db83
--- a/mmappcomponents/harvester/metadataextractor/src/mpxmetadataextractor.cpp	Wed Aug 18 10:16:02 2010 +0300
+++ b/mmappcomponents/harvester/metadataextractor/src/mpxmetadataextractor.cpp	Thu Sep 02 20:56:29 2010 +0300
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description:  Extracts metadata from a file
-*  Version     : %version: da1mmcf#38.1.4.2.6.1.5.3.6 % << Don't touch! Updated by Synergy at check-out.
+*  Version     : %version: da1mmcf#38.1.4.2.6.1.5.3.8 % << Don't touch! Updated by Synergy at check-out.
 *
 */
 
@@ -251,6 +251,10 @@
     // URL
     aMediaProp.SetTextValueL( KMPXMediaMusicURL,
                               KNullDesC );
+    // AlbumArtist
+    aMediaProp.SetTextValueL( KMPXMediaMusicAlbumArtist,
+                              KNullDesC );
+    
     }
 
 // ---------------------------------------------------------------------------
@@ -473,6 +477,18 @@
                     }
                 break;
                 }
+            case EMetaDataAlbumArtist:
+                {
+                TPtr valptr = value->Des();
+                valptr.Trim();
+                TInt vallen = value->Length();
+                if (vallen>0)
+                    {
+                    FindAndReplaceForbiddenChars(valptr, vallen);
+                    iMedia->SetTextValueL(KMPXMediaMusicAlbumArtist, *value);
+                    }
+                break;
+                }
             case EMetaDataOriginalArtist:  // fall through
             case EMetaDataVendor:          // fall through
             case EMetaDataRating:          // fall through
@@ -923,7 +939,20 @@
         {
         TDataType dataType;
         TUid dummyUid(KNullUid);
-        iAppArc.AppForDocument(iFileName, dummyUid, dataType);
+        // File handle based mime type recogniton required , because AppArc does 
+        // not have All Files capa required for files in private folders 
+        TDataRecognitionResult result;
+        RFs fs;
+		RFile rFile;
+        User::LeaveIfError(fs.Connect());
+		CleanupClosePushL(fs);
+        User::LeaveIfError(fs.ShareProtected());
+        User::LeaveIfError(rFile.Open(fs, iFileName, EFileShareReadersOrWriters));
+		CleanupClosePushL(rFile);
+        User::LeaveIfError(iAppArc.RecognizeData(rFile, result)); 
+        CleanupStack::PopAndDestroy(&rFile);
+        CleanupStack::PopAndDestroy(&fs);
+        dataType = result.iDataType;
         iMedia->SetTextValueL( KMPXMediaGeneralMimeType,dataType.Des() );
         }