homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp
branchRCL_3
changeset 130 67f2ed48ad91
parent 118 8baec10861af
equal deleted inserted replaced
122:6cadd6867c17 130:67f2ed48ad91
   949 // -----------------------------------------------------------------------------
   949 // -----------------------------------------------------------------------------
   950 //
   950 //
   951 void hspsServerUtil::FindUniquePluginsL( 
   951 void hspsServerUtil::FindUniquePluginsL( 
   952         ChspsODT& aOdt, 
   952         ChspsODT& aOdt, 
   953         RArray<TInt>& aPluginArray )
   953         RArray<TInt>& aPluginArray )
   954     {
   954     {    
   955     aPluginArray.Reset();
   955     aPluginArray.Reset();          
   956     CleanupClosePushL( aPluginArray );
       
   957 
       
   958     ChspsDomDocument& dom = aOdt.DomDocument();
   956     ChspsDomDocument& dom = aOdt.DomDocument();
   959     ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *dom.RootNode() );
   957     ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *dom.RootNode() );
   960     CleanupStack::PushL( iter );
   958     CleanupStack::PushL( iter );
   961     
   959     
   962     ChspsDomNode* node = iter->First();
   960     ChspsDomNode* node = iter->First();
   963     ChspsDomNode* prevNode = NULL;
   961     ChspsDomNode* prevNode = NULL;
   964     while( node && prevNode != node )
   962     while( node && prevNode != node )
   965         {
   963        {                
   966         const TDesC8& name = node->Name();
   964        const TDesC8& name = node->Name();
   967        
   965        
   968         // Plugin element was found 
   966        // Plugin element was found 
   969         if ( name == KPluginElement )
   967        if ( name == KPluginElement )
   970             {           
   968            {           
   971             ChspsDomList& attrList = node->AttributeList();                    
   969            ChspsDomList& attrList = node->AttributeList();                    
   972             ChspsDomAttribute* uidAttr = static_cast<ChspsDomAttribute*>( attrList.FindByName(KPluginAttrUid) );            
   970            ChspsDomAttribute* uidAttr = static_cast<ChspsDomAttribute*>( attrList.FindByName(KPluginAttrUid) );            
   973             if ( uidAttr )
   971            if ( uidAttr )
   974                 {     
   972                {     
   975                 // Convert from hex to int
   973                // Convert from hex to int
   976                 const TUid pluginUid = ConvertDescIntoUid( uidAttr->Value() );               
   974                const TUid pluginUid = ConvertDescIntoUid( uidAttr->Value() );               
   977                 if ( pluginUid.iUid > 0 )
   975                if ( pluginUid.iUid > 0 )
   978                     {
   976                    {
   979                     TBool isUnique = ETrue;
   977                    TBool isUnique = ETrue;
   980                     for( TInt i=0; isUnique && i<aPluginArray.Count();i++ )
   978                    for( TInt i=0; isUnique && i<aPluginArray.Count();i++ )
   981                         {
   979                        {
   982                         if ( aPluginArray[i] == pluginUid.iUid )
   980                        if ( aPluginArray[i] == pluginUid.iUid )
   983                             {
   981                            {
   984                             isUnique=EFalse;
   982                            isUnique=EFalse;
   985                             }
   983                            }
   986                         }
   984                        }
   987                     if ( isUnique )
   985                    if ( isUnique )
   988                         {
   986                        {
   989                         aPluginArray.AppendL( pluginUid.iUid );
   987                        aPluginArray.Append( pluginUid.iUid );
   990                         }
   988                        }
   991                    }               
   989                    }               
   992                }
   990                }
   993            }
   991            }
   994            
   992            
   995            prevNode = node;        
   993            prevNode = node;        
   996            node = iter->NextL();        
   994            node = iter->NextL();        
   997            }
   995            }
   998 
   996    CleanupStack::PopAndDestroy( iter );      
   999     CleanupStack::PopAndDestroy( iter );
   997 }
  1000     CleanupStack::Pop( &aPluginArray );
       
  1001     }
       
  1002 
   998 
  1003 //----------------------------------------------------------------------------
   999 //----------------------------------------------------------------------------
  1004 // CHspsServiceUtilities::HexString2Uint
  1000 // CHspsServiceUtilities::HexString2Uint
  1005 // ----------------------------------------------------------------------------
  1001 // ----------------------------------------------------------------------------
  1006 //
  1002 //
  1278         // Add found file with full path to file array
  1274         // Add found file with full path to file array
  1279         const TEntry& fileEntry = (*fileList)[k];
  1275         const TEntry& fileEntry = (*fileList)[k];
  1280         TFileName file;
  1276         TFileName file;
  1281         file.Append( aDirName );
  1277         file.Append( aDirName );
  1282         file.Append( fileEntry.iName );
  1278         file.Append( fileEntry.iName );
  1283         aFiles.AppendL( file );
  1279         aFiles.Append( file );
  1284         }
  1280         }
  1285     CleanupStack::PopAndDestroy( fileList );
  1281     CleanupStack::PopAndDestroy( fileList );
       
  1282 
  1286     CleanupStack::PopAndDestroy(); // fs
  1283     CleanupStack::PopAndDestroy(); // fs
  1287     }
  1284     }
  1288 
  1285 
  1289 // -----------------------------------------------------------------------------
  1286 // -----------------------------------------------------------------------------
  1290 // hspsServerUtil::SetAttributeValueL
  1287 // hspsServerUtil::SetAttributeValueL
  2046              TInt drive = hspsServerUtil::GetEmmcDrivePath( aFs );
  2043              TInt drive = hspsServerUtil::GetEmmcDrivePath( aFs );
  2047              if ( drive != KErrNotFound )
  2044              if ( drive != KErrNotFound )
  2048                  {
  2045                  {
  2049                  aFs.SetSessionToPrivate( drive );
  2046                  aFs.SetSessionToPrivate( drive );
  2050                  }
  2047                  }
  2051 // When Emmc drive is not present in emulator it is replaced by D drive
       
  2052 #ifdef __WINSCW__
       
  2053              else 
       
  2054                  {
       
  2055                  aFs.SetSessionToPrivate( EDriveD );
       
  2056                  }
       
  2057 #endif
       
  2058              }
  2048              }
  2059          else 
  2049          else 
  2060              {
  2050              {
  2061              aFs.SetSessionToPrivate( EDriveZ );
  2051              aFs.SetSessionToPrivate( EDriveZ );
  2062              }
  2052              }
  2214               if( entry.IsDir() && aRecursive )
  2204               if( entry.IsDir() && aRecursive )
  2215                   {                   
  2205                   {                   
  2216                   // Find files from the subdirectory and the drive
  2206                   // Find files from the subdirectory and the drive
  2217                   RArray<TInt> driveArray;
  2207                   RArray<TInt> driveArray;
  2218                   CleanupClosePushL( driveArray );                  
  2208                   CleanupClosePushL( driveArray );                  
  2219                   driveArray.AppendL( aDriveArray[driveIndex] );                                   
  2209                   driveArray.Append( aDriveArray[driveIndex] );                                   
  2220                   FindResourcesL( aFs, driveArray, file, aFileArray, NULL );   
  2210                   FindResourcesL( aFs, driveArray, file, aFileArray, NULL );   
  2221                   CleanupStack::PopAndDestroy( &driveArray );
  2211                   CleanupStack::PopAndDestroy( &driveArray );
  2222                   }
  2212                   }
  2223               else
  2213               else
  2224                   {              
  2214                   {