diff -r 3aa774c655ac -r f1030a78d563 cpsecplugins/cpadvancedsecplugin/src/cpcerttrustview.cpp --- a/cpsecplugins/cpadvancedsecplugin/src/cpcerttrustview.cpp Tue Jun 29 10:29:16 2010 +0300 +++ b/cpsecplugins/cpadvancedsecplugin/src/cpcerttrustview.cpp Thu Jul 08 20:04:36 2010 +0300 @@ -110,6 +110,7 @@ // TCertificateAppInfo's Name() function. // --------------------------------------------------------------------------- // + void CpCertTrustView::updateListBoxL() { RDEBUG("0", 0); @@ -152,21 +153,16 @@ { mClientUids.Append( KCertManUIViewTrustJavaInstallingId ); } - - clientCount = mClientUids.Count(); - - QList itemArray; - for(int i=0;iCertificateFormat() ) { return; } TInt resIndex = KErrNotFound; - if ( mClientUids.Count() > 0 ) + QList itemArray; + QList trustValue; + clientCount = mClientUids.Count(); + if ( clientCount > 0 ) { for ( TInt k = 0; k < clientCount; k++ ) { @@ -180,9 +176,16 @@ TBool trustState = EFalse; QString item = mTrustedClients[ resIndex ]; trustState = checkCertificateClientTrustL( mClientUids[k], *entry ); + // insert the index which would be used to retrieve the value from mTrustedClients + itemArray.insert(k,resIndex); + if ( trustState ) { - itemArray.replace(resIndex,1); + trustValue.insert(k,1); + } + else + { + trustValue.insert(k,0); } } } @@ -198,15 +201,17 @@ certLabel->setText(QString( (QChar*)label.Ptr(),label.Length() ) ); mCertLabelList->addItem(certLabel.get()); certLabel.release(); + RDEBUG("0", 0); - int count = mTrustedClients.size(); + + int count = itemArray.size(); for( int index = 0 ;index < count; ++index) { std::auto_ptr item (q_check_ptr(new HbDataFormModelItem( HbDataFormModelItem::ToggleValueItem, - mTrustedClients[index] ) )); - - if( itemArray[index] == 1) + mTrustedClients[itemArray[index]] ) )); + + if( trustValue[index] == 1) { item->setContentWidgetData("text",mTrustValues[0]); item->setContentWidgetData("additionalText",mTrustValues[1]); @@ -226,6 +231,7 @@ form.release(); } + void CpCertTrustView::saveTrustSettings() { RDEBUG("0", 0); @@ -234,19 +240,25 @@ { TInt itemCount = mFormModel->rowCount(); RArray newUids; - QT_TRAP_THROWING( CleanupClosePushL( newUids )); - - for(int index = 0;indexitem(index); - QString trustValue = item->contentWidgetData("text").toString(); - if(trustValue == "On") + QT_TRAP_THROWING + ( + CleanupClosePushL( newUids ); + + for(int index = 0;indexitem(index); + QString trustValue = item->contentWidgetData("text").toString(); + if(trustValue == "On") + { + newUids.Append(trusterId(mTrustedClients[index])); + } } - } - QT_TRAP_THROWING( mCertDataContainer.iWrapper->SetApplicabilityL( mCertDataContainer.CertManager(), entry, newUids )); - CleanupStack::PopAndDestroy(&newUids); + if(newUids.Count() > 0 ) + { + mCertDataContainer.iWrapper->SetApplicabilityL( mCertDataContainer.CertManager(), entry, newUids ); + } + CleanupStack::PopAndDestroy(&newUids); + ) } }