appinstaller/AppinstUi/sisxsifplugin/src/sisxsifplugininstallparams.cpp
changeset 69 b18a4bf55ddb
parent 50 c6e8afe0ba85
child 80 9dcba1ee99f7
equal deleted inserted replaced
64:48c14c385b0e 69:b18a4bf55ddb
    53 // CSisxSifPluginInstallParams::~CSisxSifPluginInstallParams()
    53 // CSisxSifPluginInstallParams::~CSisxSifPluginInstallParams()
    54 // ---------------------------------------------------------------------------
    54 // ---------------------------------------------------------------------------
    55 //
    55 //
    56 CSisxSifPluginInstallParams::~CSisxSifPluginInstallParams()
    56 CSisxSifPluginInstallParams::~CSisxSifPluginInstallParams()
    57     {
    57     {
       
    58     iDrives.Close();
       
    59     iLanguages.Close();
    58     delete iOCSPUrl;
    60     delete iOCSPUrl;
    59     }
    61     }
    60 
    62 
    61 // ---------------------------------------------------------------------------
    63 // ---------------------------------------------------------------------------
    62 // CSisxSifPluginInstallParams::IsSilentMode()
    64 // CSisxSifPluginInstallParams::IsSilentMode()
    75     {
    77     {
    76     return iIsInstallInactive;
    78     return iIsInstallInactive;
    77     }
    79     }
    78 
    80 
    79 // ---------------------------------------------------------------------------
    81 // ---------------------------------------------------------------------------
    80 // CSisxSifPluginInstallParams::Drive()
    82 // CSisxSifPluginInstallParams::Drives()
    81 // ---------------------------------------------------------------------------
    83 // ---------------------------------------------------------------------------
    82 //
    84 //
    83 TUint CSisxSifPluginInstallParams::Drive() const
    85 const RArray<TUint>& CSisxSifPluginInstallParams::Drives() const
    84     {
    86     {
    85     return iDrive;
    87     return iDrives;
    86     }
    88     }
    87 
    89 
    88 // ---------------------------------------------------------------------------
    90 // ---------------------------------------------------------------------------
    89 // CSisxSifPluginInstallParams::Language()
    91 // CSisxSifPluginInstallParams::Languages()
    90 // ---------------------------------------------------------------------------
    92 // ---------------------------------------------------------------------------
    91 //
    93 //
    92 TLanguage CSisxSifPluginInstallParams::Language() const
    94 const RArray<TLanguage>& CSisxSifPluginInstallParams::Languages() const
    93     {
    95     {
    94     return iLanguage;
    96     return iLanguages;
    95     }
    97     }
    96 
    98 
    97 // ---------------------------------------------------------------------------
    99 // ---------------------------------------------------------------------------
    98 // CSisxSifPluginInstallParams::OCSPUrl()
   100 // CSisxSifPluginInstallParams::OCSPUrl()
    99 // ---------------------------------------------------------------------------
   101 // ---------------------------------------------------------------------------
   220 //
   222 //
   221 void CSisxSifPluginInstallParams::ConstructL( const COpaqueNamedParams& aParams )
   223 void CSisxSifPluginInstallParams::ConstructL( const COpaqueNamedParams& aParams )
   222     {
   224     {
   223     iUseSilentMode = GetIntParam( aParams, KSifInParam_InstallSilently, EFalse );
   225     iUseSilentMode = GetIntParam( aParams, KSifInParam_InstallSilently, EFalse );
   224     iIsInstallInactive = GetIntParam( aParams, KSifInParam_InstallInactive, EFalse );
   226     iIsInstallInactive = GetIntParam( aParams, KSifInParam_InstallInactive, EFalse );
   225     // TODO: change drive and language params as arrays when available
   227     TRAPD( err, DoProcessDriveParamL( aParams ) );
   226     iDrive = static_cast<TUint>( GetIntParam( aParams, KSifInParam_Drive, EDriveC ) );
   228     if( err )
   227     iLanguage = static_cast<TLanguage>( GetIntParam( aParams, KSifInParam_Languages,
   229         {
   228             ELangNone ) );
   230         TInt defaultDrive = GetIntParam( aParams, KSifInParam_Drive, EDriveC );
       
   231         iDrives.AppendL( defaultDrive );
       
   232         }
       
   233     TRAP_IGNORE( DoProcessLangParamL( aParams ) );  // no default language
   229     GetStringParamL( aParams, KSifInParam_OCSPUrl, iOCSPUrl );
   234     GetStringParamL( aParams, KSifInParam_OCSPUrl, iOCSPUrl );
   230     GetPolicyParam( aParams, KSifInParam_PerformOCSP, iPerformOCSP, EAllowed );
   235     GetPolicyParam( aParams, KSifInParam_PerformOCSP, iPerformOCSP, EAllowed );
   231     GetPolicyParam( aParams, KSifInParam_IgnoreOCSPWarnings, iIgnoreOCSPWarnings, EAllowed );
   236     GetPolicyParam( aParams, KSifInParam_IgnoreOCSPWarnings, iIgnoreOCSPWarnings, EAllowed );
   232     GetPolicyParam( aParams, KSifInParam_AllowUpgrade, iAllowUpgrade, EAllowed );
   237     GetPolicyParam( aParams, KSifInParam_AllowUpgrade, iAllowUpgrade, EAllowed );
   233     GetPolicyParam( aParams, KSifInParam_InstallOptionalItems, iInstallOptionalItems, EAllowed );
   238     GetPolicyParam( aParams, KSifInParam_InstallOptionalItems, iInstallOptionalItems, EAllowed );
   247 //
   252 //
   248 void CSisxSifPluginInstallParams::ConstructL( const CSisxSifPluginInstallParams& aParams )
   253 void CSisxSifPluginInstallParams::ConstructL( const CSisxSifPluginInstallParams& aParams )
   249     {
   254     {
   250 	iUseSilentMode = aParams.iUseSilentMode;
   255 	iUseSilentMode = aParams.iUseSilentMode;
   251 	iIsInstallInactive = aParams.iIsInstallInactive;
   256 	iIsInstallInactive = aParams.iIsInstallInactive;
   252     iDrive = aParams.iDrive;
   257 	for( TInt index = 0; index < aParams.iDrives.Count(); index++ )
   253     iLanguage = aParams.iLanguage;
   258 	    {
       
   259 	    iDrives.AppendL( aParams.iDrives[ index ] );
       
   260 	    }
       
   261 	for( TInt index = 0; index < aParams.iLanguages.Count(); index++ )
       
   262 	    {
       
   263 	    iLanguages.AppendL( aParams.iLanguages[ index ] );
       
   264 	    }
   254     if( aParams.iOCSPUrl )
   265     if( aParams.iOCSPUrl )
   255         {
   266         {
   256         iOCSPUrl = aParams.iOCSPUrl->AllocL();
   267         iOCSPUrl = aParams.iOCSPUrl->AllocL();
   257         }
   268         }
   258     iPerformOCSP = aParams.iPerformOCSP;
   269     iPerformOCSP = aParams.iPerformOCSP;
   318             }
   329             }
   319         aBuf = value.AllocL();
   330         aBuf = value.AllocL();
   320         }
   331         }
   321     }
   332     }
   322 
   333 
       
   334 // ---------------------------------------------------------------------------
       
   335 // CSisxSifPluginInstallParams::DoProcessDriveParamL()
       
   336 // ---------------------------------------------------------------------------
       
   337 //
       
   338 void CSisxSifPluginInstallParams::DoProcessDriveParamL( const COpaqueNamedParams& aParams )
       
   339     {
       
   340     const RArray<TInt>& driveArray = aParams.IntArrayByNameL( KSifInParam_Drive );
       
   341     iDrives.Reset();
       
   342     for( TInt index = 0; index < driveArray.Count(); index++ )
       
   343         {
       
   344         iDrives.AppendL( driveArray[ index ] );
       
   345         }
       
   346     }
       
   347 
       
   348 // ---------------------------------------------------------------------------
       
   349 // CSisxSifPluginInstallParams::DoProcessLangParamL()
       
   350 // ---------------------------------------------------------------------------
       
   351 //
       
   352 void CSisxSifPluginInstallParams::DoProcessLangParamL( const COpaqueNamedParams& aParams )
       
   353     {
       
   354     const RArray<TInt>& langArray = aParams.IntArrayByNameL( KSifInParam_Languages );
       
   355     iLanguages.Reset();
       
   356     for( TInt index = 0; index < langArray.Count(); index++ )
       
   357         {
       
   358         iLanguages.AppendL( static_cast<TLanguage>( langArray[ index ] ) );
       
   359         }
       
   360     }
       
   361