# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1277306402 -10800 # Node ID 92f864ef0288fe5e55fb32718037268c16048e6b # Parent d17dc5398051db4ea27fffd60c952f50df6734bc Revision: 201023 Kit: 2010125 diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/Daemon/Src/daemonbehaviour.cpp --- a/appinstaller/AppinstUi/Daemon/Src/daemonbehaviour.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/Daemon/Src/daemonbehaviour.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -398,8 +398,7 @@ } } // for loop - FLOG_1( _L("Daemon: appInfoArray.Count = %d"), appInfoArray.Count() ); - + FLOG_1( _L("Daemon: appInfoArray.Count = %d"), appInfoArray.Count() ); // Check do we have updated some application info. if ( appInfoArray.Count() ) { @@ -476,20 +475,6 @@ // Check if component or part of it is in the media. if ( isInTargetDrive ) { - FLOG( _L("Daemon: Set component status to SCR") ); - // Update component flag to SCR. - if ( aChangeType == EMediaInserted ) - { - FLOG( _L("Daemon: Set component present = TRUE") ); - TRAP( err, aScrServer.SetIsComponentPresentL( aComponentId, ETrue ) ); - } - else if ( aChangeType==EMediaRemoved ) - { - FLOG( _L("Daemon: Set component present = FALSE") ); - TRAP( err, aScrServer.SetIsComponentPresentL( aComponentId, EFalse ) ); - } - FLOG_1( _L("Daemon: SetIsComponentPresentL TRAP err = %d"), err ); - // We need to update applications status to AppArc when // there is some media change. AppArc needs application // UID (not package UID) so we need to get all app. UIDs @@ -499,16 +484,16 @@ FLOG( _L("Daemon: Get applications UIDs from SCR") ); RArray appUidArray; CleanupClosePushL( appUidArray ); - + TRAP( err, aScrServer.GetAppUidsForComponentL( aComponentId, appUidArray ) ); FLOG_1( _L("Daemon: GetAppUidsForComponentL TRAP err = %d"), err ); FLOG_1( _L("Daemon: UID array count = %d"), appUidArray.Count() ); - + for (TInt index = 0; index < appUidArray.Count(); index++) { FLOG_1( _L("Daemon: Add app UID = 0x%x"), - appUidArray[index].iUid ); - + appUidArray[index].iUid ); + TApaAppUpdateInfo appInfo; appInfo.iAppUid = appUidArray[index]; @@ -525,7 +510,23 @@ aAppInfoArray.Append( appInfo ); } - CleanupStack::PopAndDestroy(&appUidArray); + CleanupStack::PopAndDestroy(&appUidArray); +// Set do not work, it will leave. +/* + FLOG( _L("Daemon: Set component status to SCR") ); + // Update component flag to SCR. + if ( aChangeType == EMediaInserted ) + { + FLOG( _L("Daemon: Set component present = TRUE") ); + TRAP( err, aScrServer.SetIsComponentPresentL( aComponentId, ETrue ) ); + } + else if ( aChangeType==EMediaRemoved ) + { + FLOG( _L("Daemon: Set component present = FALSE") ); + TRAP( err, aScrServer.SetIsComponentPresentL( aComponentId, EFalse ) ); + } + FLOG_1( _L("Daemon: SetIsComponentPresentL TRAP err = %d"), err ); +*/ } // if isInTargetDrive } // if err diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/Plugin/CommonUI/Src/CUICertificateDetailsDialog.cpp --- a/appinstaller/AppinstUi/Plugin/CommonUI/Src/CUICertificateDetailsDialog.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/Plugin/CommonUI/Src/CUICertificateDetailsDialog.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -18,10 +18,10 @@ // INCLUDE FILES -#include -#include +//#include +//#include #include -#include +//#include #include #include "CUICertificateDetailsDialog.h" @@ -88,6 +88,7 @@ TInt aHeaderResourceId, const TDesC& aValue ) { + /* HBufC* headerString = StringLoader::LoadLC( aHeaderResourceId ); HBufC* newMessage; @@ -119,7 +120,8 @@ CleanupStack::PopAndDestroy( aMessage ); aMessage = newMessage; - CleanupStack::PushL( aMessage ); + CleanupStack::PushL( aMessage ); + */ } // ----------------------------------------------------------------------------- @@ -130,6 +132,7 @@ // void CCUICertificateDetailsDialog::ExecuteLD( const CCUICertificateInfo& aCertInfo ) { + /* CleanupStack::PushL( this ); // Valid from @@ -184,6 +187,7 @@ dlg->RunLD(); CleanupStack::PopAndDestroy( 7 ); // message, fingerprint_md, fingerprint, serial, validTo, validFrom + */ } // ----------------------------------------------------------------------------- @@ -194,6 +198,7 @@ // HBufC* CCUICertificateDetailsDialog::DateToStringLC( const TDateTime& aDate ) { + /* // Create date descriptors. // We use Avkon date format string to format the date into correct format. HBufC* dateFormatString = StringLoader::LoadLC( R_QTN_DATE_USUAL_WITH_ZERO ); @@ -208,7 +213,9 @@ TPtr ptr = tmp->Des(); AknTextUtils::DisplayTextLanguageSpecificNumberConversion( ptr ); - return tmp; + return tmp; + */ + return NULL; } // ----------------------------------------------------------------------------- diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/Plugin/CommonUI/Src/CUIDetailsDialog.cpp --- a/appinstaller/AppinstUi/Plugin/CommonUI/Src/CUIDetailsDialog.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/Plugin/CommonUI/Src/CUIDetailsDialog.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -18,15 +18,15 @@ // INCLUDE FILES -#include -#include // remove -#include +//#include +//#include // remove +//#include #include #include #include #include #include -#include +//#include #include #include "CUIDetailsDialog.h" @@ -49,7 +49,7 @@ // ----------------------------------------------------------------------------- // CCUIDetailsDialog::CCUIDetailsDialog() - : iCbaResourceId( R_AVKON_SOFTKEYS_OK_EMPTY ) +// : iCbaResourceId( R_AVKON_SOFTKEYS_OK_EMPTY ) { } @@ -233,7 +233,7 @@ TInt CCUIDetailsDialog::ShowDialogL( MCUIInfoIterator& aIterator ) { TInt result( 0 ); - +/* CleanupStack::PushL( this ); PopulateArrayL( aIterator ); @@ -279,7 +279,7 @@ result = dlg->RunLD(); CleanupStack::PopAndDestroy( 2 ); // message, this - +*/ return result; } @@ -344,6 +344,7 @@ // HBufC* CCUIDetailsDialog::GetMessageDescriptorLC() { + /* TInt size( 0 ); TInt index( 0 ); @@ -380,8 +381,10 @@ CleanupStack::Pop( message ); CleanupStack::PopAndDestroy( 2, type ); CleanupStack::PushL( message ); - - return message; + + return message; + */ + return NULL; } // ----------------------------------------------------------------------------- @@ -392,6 +395,7 @@ // void CCUIDetailsDialog::AddCertificatesLC( HBufC*& aMessage ) { + /* HBufC* certHeading = StringLoader::LoadLC( R_SWCOMMON_DETAIL_CERTIFICATES ); HBufC* certificateLink = LoadLinkLC( R_SWCOMMON_DETAIL_VALUE_VIEW_CERT ); HBufC* newString = HBufC::NewL( certHeading->Length() + @@ -411,6 +415,7 @@ aMessage = newString; CleanupStack::PushL( aMessage ); + */ } // ----------------------------------------------------------------------------- @@ -421,6 +426,7 @@ // void CCUIDetailsDialog::AddDrmLC( HBufC*& aMessage ) { + /* HBufC* drmHeading = StringLoader::LoadLC( R_SWCOMMON_DETAIL_DRM ); HBufC* drmLink = LoadLinkLC( R_SWCOMMON_DETAIL_VALUE_VIEW_DRM ); HBufC* newString = HBufC::NewL( drmHeading->Length() + @@ -440,6 +446,7 @@ aMessage = newString; CleanupStack::PushL( aMessage ); + */ } // ----------------------------------------------------------------------------- @@ -478,6 +485,7 @@ // void CCUIDetailsDialog::DoShowCertificatesL() { + /* if ( iCommonCertificates.Count() > 1 ) { CDesCArrayFlat *itemArray = new( ELeave ) CDesCArrayFlat( 2 ); @@ -520,7 +528,8 @@ CCUICertificateDetailsDialog::NewL(); certDlg->ExecuteLD( *( iCommonCertificates[0] ) ); - } + } + */ } // ----------------------------------------------------------------------------- @@ -544,6 +553,7 @@ // HBufC* CCUIDetailsDialog::LoadLinkLC( TInt aResourceId ) { + /* HBufC* link = StringLoader::LoadLC( aResourceId ); HBufC* tmp = link->ReAllocL( link->Length() + KLinkTagOpen().Length() + KLinkTagClose().Length() ); @@ -554,7 +564,9 @@ link->Des().Insert(0, KLinkTagOpen); link->Des().Append( KLinkTagClose ); - return link; + return link; + */ + return NULL; } // End of File diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/Plugin/CommonUI/Src/CUIDialogs.cpp --- a/appinstaller/AppinstUi/Plugin/CommonUI/Src/CUIDialogs.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/Plugin/CommonUI/Src/CUIDialogs.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -21,12 +21,12 @@ #include #include #include -#include +//#include #include -#include +//#include #include #include -#include +//#include #include //#include #include @@ -35,7 +35,7 @@ #ifdef RD_MULTIPLE_DRIVE #include #endif //RD_MULTIPLE_DRIVE -#include +//#include #include "CUIDialogs.h" #include "CUIDriveUtils.h" @@ -80,8 +80,8 @@ fileName.Append( KCUIResourceFileName ); iResourceFileOffset = CUIUtils::LoadResourceFileL( fileName, iCoeEnv ); - iAbsorber = CAknInputBlock::NewLC(); - CleanupStack::Pop( iAbsorber ); +// iAbsorber = CAknInputBlock::NewLC(); +// CleanupStack::Pop( iAbsorber ); FeatureManager::InitializeLibL(); } @@ -112,7 +112,7 @@ iCoeEnv->DeleteResourceFile( iResourceFileOffset ); } - delete iAbsorber; +// delete iAbsorber; FeatureManager::UnInitializeLib(); } @@ -285,7 +285,7 @@ TInt aSoftkeyResourceId ) const { TBool response( EFalse ); - +/* CAknQueryDialog* note = CAknQueryDialog::NewL( CAknQueryDialog::EConfirmationTone ); @@ -297,7 +297,7 @@ { response = ETrue; } - +*/ return response; } @@ -312,9 +312,10 @@ const RArray& aDriveUnits, const RArray& aDriveSpaces, TInt& aSelectionResult ) - { + { + TInt result( KErrNone ); - +/* // Sanity check if ( aSize <= 0 ) { @@ -439,7 +440,7 @@ } CleanupStack::PopAndDestroy( driveUtils ); - +*/ return result; } @@ -450,9 +451,10 @@ // ----------------------------------------------------------------------------- // EXPORT_C TBool CCUIDialogs::ShowSecurityWarningDialogL() - { + { + TBool result( EFalse ); - + /* // Load resources HBufC* text = StringLoader::LoadLC( R_SWCOMMON_SECURITY_WARNING ); HBufC* linkText = NULL; @@ -490,7 +492,7 @@ } CleanupStack::PopAndDestroy( 3, text ); // message, linkText, text - + */ return result; } @@ -515,8 +517,10 @@ // EXPORT_C void CCUIDialogs::ShowErrorNoteL( const TDesC& aErrorText ) const { + /* CAknErrorNote* note = new (ELeave) CAknErrorNote( ETrue ); note->ExecuteLD( aErrorText ); + */ } // ----------------------------------------------------------------------------- @@ -597,6 +601,7 @@ TInt& aIndexOfAppToBeStarted ) const { + /* aIndexOfAppToBeStarted = KErrNotFound; // Prepare for showing the installation complete query @@ -675,7 +680,9 @@ aIndexOfAppToBeStarted = KErrNotFound; } - return appIsStarted; + return appIsStarted; + */ + return EFalse; } // ----------------------------------------------------------------------------- @@ -689,6 +696,7 @@ const MDesCArray& aApplicationArray, TInt aSoftkeyResourceId ) const { + /* HBufC* appList = HBufC::NewLC( 0 ); TInt count = aApplicationArray.MdcaCount(); for ( TInt i = 0; i < count; i++ ) @@ -731,6 +739,8 @@ } CleanupStack::PopAndDestroy( message ); return response; + */ + return EFalse; } diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/Plugin/CommonUI/Src/CUIDriveUtils.cpp --- a/appinstaller/AppinstUi/Plugin/CommonUI/Src/CUIDriveUtils.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/Plugin/CommonUI/Src/CUIDriveUtils.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -22,13 +22,13 @@ #include #include #include -#include -#include +//#include // Removed since CR 548 +//#include // Removed since CR 548 #ifdef RD_MULTIPLE_DRIVE -#include -#include +//#include // Removed since CR 548 +//#include // Removed since CR 548 #else -#include +//#include // Removed since CR 548 #endif //RD_MULTIPLE_DRIVE #include "CUIDriveUtils.h" @@ -119,9 +119,12 @@ // ----------------------------------------------------------------------------- // TBool CCUIDriveUtils::ShowSelectionDialogL( TInt& aSelectedDrive ) - { + { + TBool result( EFalse ); + // Removed since CR 548 +/* aSelectedDrive = 0; #ifdef RD_MULTIPLE_DRIVE @@ -230,7 +233,7 @@ #endif //RD_MULTIPLE_DRIVE CleanupStack::PopAndDestroy( 2 ); // header, memoryDialog - +*/ return result; } diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/Plugin/CommonUI/Src/CUIProgressDialog.cpp --- a/appinstaller/AppinstUi/Plugin/CommonUI/Src/CUIProgressDialog.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/Plugin/CommonUI/Src/CUIProgressDialog.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -40,11 +40,13 @@ // Destructor CCUIProgressDialog::~CCUIProgressDialog() { + if (iSelfPtr) { *iSelfPtr = NULL; iSelfPtr = NULL; } + } // --------------------------------------------------------------------------- diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/group/SWInstCommonUI.mmp --- a/appinstaller/AppinstUi/group/SWInstCommonUI.mmp Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/group/SWInstCommonUI.mmp Wed Jun 23 18:20:02 2010 +0300 @@ -67,7 +67,7 @@ LIBRARY eikdlg.lib LIBRARY eikctl.lib LIBRARY platformenv.lib -LIBRARY commondialogs.lib +//LIBRARY commondialogs.lib // Removed since CR 548 LIBRARY efsrv.lib LIBRARY X509CertNameParser.lib LIBRARY x509.lib diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/sifuidevicedialogplugin/inc/sifuidialog.h --- a/appinstaller/AppinstUi/sifuidevicedialogplugin/inc/sifuidialog.h Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/sifuidevicedialogplugin/inc/sifuidialog.h Wed Jun 23 18:20:02 2010 +0300 @@ -53,9 +53,6 @@ void closeDeviceDialog(bool byClient); HbDialog *deviceDialogWidget() const; -protected: // from HbDialog - void closeEvent(QCloseEvent *event); - signals: void deviceDialogClosed(); void deviceDialogData(const QVariantMap &data); @@ -92,7 +89,6 @@ SifUiDialogContentWidget *mContent; int mInstallError; QVariantMap mResultMap; - HbAction *mIgnoreCloseAction; HbAction *mPrimaryAction; HbAction *mSecondaryAction; HbIndicator *mIndicator; diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/sifuidevicedialogplugin/inc/sifuidialogcontentwidget.h --- a/appinstaller/AppinstUi/sifuidevicedialogplugin/inc/sifuidialogcontentwidget.h Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/sifuidevicedialogplugin/inc/sifuidialogcontentwidget.h Wed Jun 23 18:20:02 2010 +0300 @@ -54,6 +54,7 @@ void removeDetails(); void addDetails(const QStringList &detailList); void addDetail(const QString &detailText); + void createAppName(const QString &appName); void updateAppIcon(const QVariantMap ¶meters); void updateAppSize(const QVariantMap ¶meters); bool updateMemorySelection(const QVariantMap ¶meters); diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/sifuidevicedialogplugin/src/sifuidialog.cpp --- a/appinstaller/AppinstUi/sifuidevicedialogplugin/src/sifuidialog.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/sifuidevicedialogplugin/src/sifuidialog.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -44,9 +44,8 @@ SifUiDialog::SifUiDialog(const QVariantMap ¶meters) : HbDialog(), mCommonTranslator(0), mSifUITranslator(0), mLastDialogError(KErrNone), mShowEventReceived(false), mDialogType(SifUiUnspecifiedDialog), - mTitle(0), mContent(0), mResultMap(), - mIgnoreCloseAction(0), mPrimaryAction(0), mSecondaryAction(0), - mIndicator(0), mSubscriber(0) + mTitle(0), mContent(0), mResultMap(), mPrimaryAction(0), + mSecondaryAction(0), mIndicator(0), mSubscriber(0) { mCommonTranslator = new HbTranslator(KTranslationsPath, KCommonTranslationsFile); mSifUITranslator = new HbTranslator(KTranslationsPath, KSifUiTranslationsFile); @@ -62,7 +61,6 @@ delete mSubscriber; delete mPrimaryAction; delete mSecondaryAction; - mIgnoreCloseAction = 0; delete mSifUITranslator; delete mCommonTranslator; } @@ -127,23 +125,6 @@ } // ---------------------------------------------------------------------------- -// SifUiDialog::closeEvent() -// ---------------------------------------------------------------------------- -// -void SifUiDialog::closeEvent(QCloseEvent *event) -{ - if (mIgnoreCloseAction) { - HbAction *closingAction = qobject_cast(sender()); - if (closingAction == mIgnoreCloseAction) { - // Prevents the dialog from begin closed when "Ok" pressed - event->ignore(); - return; - } - } - HbDialog::closeEvent(event); -} - -// ---------------------------------------------------------------------------- // SifUiDialog::hideEvent() // ---------------------------------------------------------------------------- // @@ -232,7 +213,11 @@ updateButtons(parameters); } if (parameters.contains(KSifUiErrorCode)) { - mInstallError = parameters.value(KSifUiErrorCode).toInt(); + bool ok = false; + int errorCode = parameters.value(KSifUiErrorCode).toInt(&ok); + if (ok) { + mInstallError = errorCode; + } } return true; } @@ -243,8 +228,6 @@ // void SifUiDialog::updateButtons(const QVariantMap ¶meters) { - mIgnoreCloseAction = 0; - if (mPrimaryAction) { removeAction(mPrimaryAction); delete mPrimaryAction; @@ -254,21 +237,25 @@ case SifUiConfirmationQuery: //: Accepts the SW install confirmation query and starts installation. mPrimaryAction = new HbAction(hbTrId("txt_common_button_ok")); + addAction(mPrimaryAction); + disconnect(mPrimaryAction, SIGNAL(triggered()), this, SLOT(close())); connect(mPrimaryAction, SIGNAL(triggered()), this, SLOT(handleAccepted())); - mIgnoreCloseAction = mPrimaryAction; break; case SifUiProgressNote: if (!parameters.contains(KSifUiProgressNoteIsHideButtonHidden)) { //: Hides the progress dialog. Progress note moves into universal indicator. mPrimaryAction = new HbAction(hbTrId("txt_common_button_hide")); + addAction(mPrimaryAction); + disconnect(mPrimaryAction, SIGNAL(triggered()), this, SLOT(close())); connect(mPrimaryAction, SIGNAL(triggered()), this, SLOT(handleHidePressed())); - mIgnoreCloseAction = mPrimaryAction; } break; case SifUiCompleteNote: if (!parameters.contains(KSifUiCompleteNoteIsShowButtonHidden)) { //: Opens Application Library to view the installed application. mPrimaryAction = new HbAction(hbTrId("txt_installer_button_show")); + addAction(mPrimaryAction); + disconnect(mPrimaryAction, SIGNAL(triggered()), this, SLOT(close())); connect(mPrimaryAction, SIGNAL(triggered()), this, SLOT(handleShowInstalled())); } break; @@ -276,16 +263,14 @@ if (!parameters.contains(KSifUiErrorNoteIsDetailsButtonHidden)) { //: Shows a dialog with further info about the failure (i.e. why installation failed). mPrimaryAction = new HbAction(hbTrId("txt_installer_button_details")); + addAction(mPrimaryAction); + disconnect(mPrimaryAction, SIGNAL(triggered()), this, SLOT(close())); connect(mPrimaryAction, SIGNAL(triggered()), this, SLOT(handleErrorDetails())); - mIgnoreCloseAction = mPrimaryAction; } break; default: break; } - if (mPrimaryAction) { - addAction(mPrimaryAction); - } if (mSecondaryAction) { removeAction(mSecondaryAction); @@ -298,6 +283,8 @@ if (!parameters.contains(KSifUiProgressNoteIsCancelButtonHidden)) { //: Cancels the SW install confirmation query and closes the dialog. mSecondaryAction = new HbAction(hbTrId("txt_common_button_cancel")); + addAction(mSecondaryAction); + disconnect(mSecondaryAction, SIGNAL(triggered()), this, SLOT(close())); connect(mSecondaryAction, SIGNAL(triggered()), this, SLOT(handleCancelled())); } break; @@ -305,14 +292,11 @@ case SifUiErrorNote: //: Closes the dialog. Control returns back to where the installation was started. mSecondaryAction = new HbAction(hbTrId("txt_common_button_close")); - connect(mSecondaryAction, SIGNAL(triggered()), this, SLOT(close())); + addAction(mSecondaryAction); break; default: break; } - if (mSecondaryAction) { - addAction(mSecondaryAction); - } } // ---------------------------------------------------------------------------- @@ -343,6 +327,7 @@ void SifUiDialog::handleCancelled() { sendResult(SifUiCancel); + close(); } // ---------------------------------------------------------------------------- @@ -387,6 +372,8 @@ } delete request; } + + close(); } // ---------------------------------------------------------------------------- @@ -397,7 +384,7 @@ { // TODO: show proper error details dialog QString messageText; - messageText = tr("Not implemented yet.\n\nError code %1").arg(mInstallError); + messageText = tr("Error code %1").arg(mInstallError); if (QFile::exists(KSwiErrorsFile)) { messageText.append(KSwiErrorFormat.arg(mInstallError)); diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/sifuidevicedialogplugin/src/sifuidialogcontentwidget.cpp --- a/appinstaller/AppinstUi/sifuidevicedialogplugin/src/sifuidialogcontentwidget.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/sifuidevicedialogplugin/src/sifuidialogcontentwidget.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -138,8 +138,7 @@ // Application name and version Q_ASSERT(mAppDetailsLayout == 0); mAppDetailsLayout = new QGraphicsLinearLayout(Qt::Vertical); - Q_ASSERT(mAppName == 0); - mAppName = new HbLabel(applicationName(parameters)); + createAppName(applicationName(parameters)); mAppDetailsLayout->addItem(mAppName); // Application size @@ -199,9 +198,8 @@ mAppName->setPlainText(appNameStr); } } else { - HbLabel *appName = new HbLabel(appNameStr); - mAppDetailsLayout->insertItem(KAppNameIndex, appName); - mAppName = appName; + createAppName(appNameStr); + mAppDetailsLayout->insertItem(KAppNameIndex, mAppName); } } @@ -352,10 +350,24 @@ { Q_ASSERT(mAppDetailsLayout != 0); HbLabel *detailItem = new HbLabel(detailText); + detailItem->setTextWrapping(Hb::TextWordWrap); + detailItem->setFontSpec(HbFontSpec(HbFontSpec::Secondary)); mAppDetailsLayout->addItem(detailItem); } // ---------------------------------------------------------------------------- +// SifUiDialogContentWidget::createAppName() +// ---------------------------------------------------------------------------- +// +void SifUiDialogContentWidget::createAppName(const QString &appName) +{ + Q_ASSERT(mAppName == 0); + mAppName = new HbLabel(appName); + mAppName->setTextWrapping(Hb::TextWordWrap); + mAppName->setFontSpec(HbFontSpec(HbFontSpec::Secondary)); +} + +// ---------------------------------------------------------------------------- // SifUiDialogContentWidget::updateAppIcon() // ---------------------------------------------------------------------------- // @@ -402,6 +414,8 @@ } } else { HbLabel *appSize = new HbLabel(appSizeStr); + appSize->setTextWrapping(Hb::TextWordWrap); + appSize->setFontSpec(HbFontSpec(HbFontSpec::Secondary)); mAppDetailsLayout->insertItem(KAppSizeIndex, appSize); mAppSize = appSize; } @@ -431,14 +445,18 @@ //: Drive name for internal phone memory with megabytes of free space. //: %1 is replaced with drive letter (usually 'C') //: %2 is replaced with available free space (in megabytes, MB) - //TODO: use hbTrId("txt_sisxui_device_memory_mb") when available + //TODO: enable when available + //driveList.append(hbTrId("txt_installer_device_memory_mb") + // .arg(volume).arg(size/KSifUiMega)); driveList.append(tr("%1: Device (%L2 MB free)" ).arg(volume).arg(size/KSifUiMega)); } else { //: Drive name for internal phone memory with kilobytes of free space. //: %1 is replaced with drive letter (usually 'C') //: %2 is replaced with available free space (in kilobytes, kB) - //TODO: use hbTrId("txt_sisxui_device_memory_kb") when available + //TODO: enable when available + //driveList.append(hbTrId("txt_installer_device_memory_kb") + // .arg(volume).arg(size/KSifUiKilo)); driveList.append(tr("%1: Device (%L2 kB free)" ).arg(volume).arg(size/KSifUiKilo)); } @@ -448,14 +466,18 @@ //: Drive name for mass storage with megabytes of free space. //: %1 is replaced with drive letter (usually 'E') //: %2 is replaced with available free space (in megabytes, MB) - // TODO: use hbTrId("txt_sisxui_mass_storage_mb") when available + // TODO: enable when available + //driveList.append(hbTrId("txt_installer_mass_storage_mb") + // .arg(volume).arg(size/KSifUiMega)); driveList.append(tr("%1: Mass.mem (%L2 MB free)" ).arg(volume).arg(size/KSifUiMega)); } else { //: Drive name for mass storage with kilobytes of free space. //: %1 is replaced with drive letter (usually 'E') //: %2 is replaced with available free space (in kilobytes, kB) - // TODO: use hbTrId("txt_sisxui_mass_storage_kb") when available + // TODO: enable when available + //driveList.append(hbTrId("txt_installer_mass_storage_kb") + // .arg(volume).arg(size/KSifUiKilo)); driveList.append(tr("%1: Mass.mem (%L2 kB free)" ).arg(volume).arg(size/KSifUiKilo)); } @@ -465,14 +487,18 @@ //: Drive name for memory card with megabytes of free space. //: %1 is replaced with drive letter (usually 'F') //: %2 is replaced with available free space (in megabytes, MB) - // TODO: use hbTrId("txt_sisxui_memory_card_mb") when available + // TODO: enable when available + //driveList.append(hbTrId("txt_installer_memory_card_mb") + // .arg(volume).arg(size/KSifUiMega)); driveList.append(tr("%1: Mem.card (%L2 MB free)" ).arg(volume).arg(size/KSifUiMega)); } else { //: Drive name for memory card with kilobytes of free space. //: %1 is replaced with drive letter (usually 'F') //: %2 is replaced with available free space (in kilobytes, kB) - // TODO: use hbTrId("txt_sisxui_memory_card_kb") when available + // TODO: enable when available + //driveList.append(hbTrId("txt_installer_memory_card_kb") + // .arg(volume).arg(size/KSifUiKilo)); driveList.append(tr("%1: Mem.card (%L2 kB free)" ).arg(volume).arg(size/KSifUiKilo)); } diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/sifuiinstallindicatorplugin/sifuiinstallindicatorplugin.pro --- a/appinstaller/AppinstUi/sifuiinstallindicatorplugin/sifuiinstallindicatorplugin.pro Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/sifuiinstallindicatorplugin/sifuiinstallindicatorplugin.pro Wed Jun 23 18:20:02 2010 +0300 @@ -48,5 +48,5 @@ BLD_INF_RULES.prj_exports += \ "$${LITERAL_HASH}include " \ - "rom/sifuiinstallindicatorplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(sifuiinstallindicatorplugin.iby)" + "rom/sifuiinstallindicatorplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(sifuiinstallindicatorplugin.iby)" diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/sisxsifplugin/group/sisxsifplugin.mmp --- a/appinstaller/AppinstUi/sisxsifplugin/group/sisxsifplugin.mmp Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/sisxsifplugin/group/sisxsifplugin.mmp Wed Jun 23 18:20:02 2010 +0300 @@ -37,6 +37,7 @@ SOURCE sisxsifpluginuihandler.cpp SOURCE sisxsifpluginuihandlersilent.cpp SOURCE sisxsifplugininstallparams.cpp +SOURCE sisxsifpluginerrorhandler.cpp SOURCE sisxsifuiselectioncache.cpp USERINCLUDE ../inc diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/sisxsifplugin/inc/sisxsifpluginactiveimpl.h --- a/appinstaller/AppinstUi/sisxsifplugin/inc/sisxsifpluginactiveimpl.h Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/sisxsifplugin/inc/sisxsifpluginactiveimpl.h Wed Jun 23 18:20:02 2010 +0300 @@ -37,6 +37,7 @@ { class CSisxSifPluginUiHandlerBase; class CSisxSifPluginInstallParams; + class CSisxSifPluginErrorHandler; /** * SISX SIF plugin active implementation @@ -93,7 +94,6 @@ void DoActivateL( TComponentId aComponentId, TRequestStatus& aStatus ); void DoDeactivateL( TComponentId aComponentId, TRequestStatus& aStatus ); void DoHandleErrorL( TInt aError ); - TErrorCategory ErrorCategory( TInt aErrorCode ); void SetFileL( const TDesC& aFileName ); void SetFile( RFile& aFileHandle ); TComponentId GetLastInstalledComponentIdL(); @@ -113,6 +113,7 @@ const COpaqueNamedParams* iInputParams; // not owned COpaqueNamedParams* iOutputParams; // not owned CSisxSifPluginInstallParams* iInstallParams; + CSisxSifPluginErrorHandler* iErrorHandler; CComponentInfo* iComponentInfo; TBool iHasAllFilesCapability; HBufC* iFileName; diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/sisxsifplugin/inc/sisxsifpluginerrorhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/appinstaller/AppinstUi/sisxsifplugin/inc/sisxsifpluginerrorhandler.h Wed Jun 23 18:20:02 2010 +0300 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CSisxSifPluginErrorHandler collects information +* about errors. Error details are then passed to +* framework (USIF). +* +*/ + +#ifndef C_SISXSIFPLUGINERRORHANDLER_H +#define C_SISXSIFPLUGINERRORHANDLER_H + +#include // CBase +#include // TErrorCategory + +namespace Usif +{ + class COpaqueNamedParams; + + + /** + * Native SISX installation error class. + */ + class CSisxSifPluginErrorHandler : public CBase + { + public: // constructor and destructor + static CSisxSifPluginErrorHandler* NewL(); + ~CSisxSifPluginErrorHandler(); + + public: // new functions + TErrorCategory ErrorCategory() const; + void FillOutputParamsL( COpaqueNamedParams& aOutputParams ) const; + + TInt ErrorCode() const; + void SetErrorCode( TInt aErrorCode ); + TInt ExtendedErrorCode() const; + void SetExtendedErrorCode( TInt aExtendedErrorCode ); + const TDesC& ErrorMessage() const; + void SetErrorMessage( const TDesC& aErrorMessage ); + const TDesC& ErrorMessageDetails() const; + void SetErrorMessageDetails( const TDesC& aErrorMessageDetails ); + + private: // new functions + CSisxSifPluginErrorHandler(); + void ConstructL(); + + private: // data + TInt iErrorCode; + TInt iExtendedErrorCode; + HBufC* iErrorMessage; + HBufC* iErrorMessageDetails; + }; + +} // namespace Usif + +#endif // C_SISXSIFPLUGINERRORHANDLER_H diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/sisxsifplugin/inc/sisxsifpluginerrors.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/appinstaller/AppinstUi/sisxsifplugin/inc/sisxsifpluginerrors.h Wed Jun 23 18:20:02 2010 +0300 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Detailed error codes for KErrPermissionDenined errors. +* +*/ + +#ifndef SISXSIFPLUGINERRORS_H +#define SISXSIFPLUGINERRORS_H + +enum TSisxSifPluginErrors + { + ETrustedUICapabilityRequired = 1, // TrustedUI capability required + ENeedsAllowUntrustedParameter = 2, // AllowUntrusted parameter needed + ENeedsGrantCapabilitiesParameter = 3, // GrantCapabilities parameter needed + EAllFilesCapabilityRequired = 4 // AllFiles capability required + }; + +#endif // SISXSIFPLUGINERRORS_H + diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/sisxsifplugin/inc/sisxsifplugininstallparams.h --- a/appinstaller/AppinstUi/sisxsifplugin/inc/sisxsifplugininstallparams.h Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/sisxsifplugin/inc/sisxsifplugininstallparams.h Wed Jun 23 18:20:02 2010 +0300 @@ -49,6 +49,7 @@ TSifPolicy AllowAppBreakDependency() const; TSifPolicy AllowOverwrite() const; TSifPolicy PackageInfo() const; + TSifPolicy AllowIncompatible() const; private: // new functions CSisxSifPluginInstallParams(); @@ -77,6 +78,7 @@ TSifPolicy iAllowAppBreakDependency; TSifPolicy iAllowOverwrite; TSifPolicy iPackageInfo; + TSifPolicy iAllowIncompatible; }; } // namespace Usif diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/sisxsifplugin/inc/sisxsifpluginuihandler.h --- a/appinstaller/AppinstUi/sisxsifplugin/inc/sisxsifpluginuihandler.h Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/sisxsifplugin/inc/sisxsifpluginuihandler.h Wed Jun 23 18:20:02 2010 +0300 @@ -34,7 +34,8 @@ class CSisxSifPluginUiHandler : public CSisxSifPluginUiHandlerBase { public: // constructors and destructor - static CSisxSifPluginUiHandler* NewL( RFs& aFs ); + static CSisxSifPluginUiHandler* NewL( RFs& aFs, + CSisxSifPluginErrorHandler& aErrorHandler ); ~CSisxSifPluginUiHandler(); public: // from MUiHandler (via CSisxSifPluginUiHandlerBase) @@ -88,14 +89,13 @@ public: // from CSisxSifPluginUiHandlerBase void DisplayPreparingInstallL( const TDesC& aFileName ); void DisplayCompleteL(); - void DisplayFailedL( TErrorCategory aCategory, TInt aErrorCode, - const TDesC& aErrorMessage, const TDesC& aErrorDetails ); + void DisplayFailedL( const CSisxSifPluginErrorHandler& aError ); public: // new functions void SetDriveSelectionRequired( TBool aIsRequired ); private: // new functions - CSisxSifPluginUiHandler( RFs& aFs ); + CSisxSifPluginUiHandler( RFs& aFs, CSisxSifPluginErrorHandler& aErrorHandler ); void ConstructL(); void AddMemorySelectionL(); void AddCertificatesL( RPointerArray& aCertificates, diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/sisxsifplugin/inc/sisxsifpluginuihandlerbase.h --- a/appinstaller/AppinstUi/sisxsifplugin/inc/sisxsifpluginuihandlerbase.h Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/sisxsifplugin/inc/sisxsifpluginuihandlerbase.h Wed Jun 23 18:20:02 2010 +0300 @@ -29,6 +29,7 @@ namespace Usif { class CSisxSifPluginInstallParams; + class CSisxSifPluginErrorHandler; /** @@ -37,14 +38,13 @@ class CSisxSifPluginUiHandlerBase : public CBase, public Swi::MUiHandler { public: // constructors and destructor - CSisxSifPluginUiHandlerBase( RFs& aFs ); + CSisxSifPluginUiHandlerBase( RFs& aFs, CSisxSifPluginErrorHandler& aErrorHandler ); ~CSisxSifPluginUiHandlerBase(); public: // new functions virtual void DisplayPreparingInstallL( const TDesC& aFileName ) = 0; virtual void DisplayCompleteL() = 0; - virtual void DisplayFailedL( TErrorCategory aCategory, TInt aErrorCode, - const TDesC& aErrorMessage, const TDesC& aErrorDetails ) = 0; + virtual void DisplayFailedL( const CSisxSifPluginErrorHandler& aError ) = 0; public: // new functions void SetInstallParamsL( const CSisxSifPluginInstallParams& aInstallParams ); @@ -53,11 +53,14 @@ void PublishStartL( const CComponentInfo::CNode& aRootNode ); void PublishProgressL( TSifOperationPhase aPhase, TSifOperationSubPhase aSubPhase, TInt aCurrentProgress, TInt aTotal ); - void PublishCompletionL( TErrorCategory aErrorCategory, TInt aErrorCode, - const TDesC& aErrorMessage, const TDesC& aErrorDetails ); + void PublishCompletionL( const CSisxSifPluginErrorHandler& aError ); + + protected: // new functions + void SetDisplayErrorL( Swi::TErrorDialog aType, const TDesC& aParam ); protected: // data RFs& iFs; + CSisxSifPluginErrorHandler& iErrorHandler; TInt iMaxInstalledSize; TBool iIsDriveSelectionRequired; CSisxSifPluginInstallParams* iInstallParams; diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/sisxsifplugin/inc/sisxsifpluginuihandlersilent.h --- a/appinstaller/AppinstUi/sisxsifplugin/inc/sisxsifpluginuihandlersilent.h Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/sisxsifplugin/inc/sisxsifpluginuihandlersilent.h Wed Jun 23 18:20:02 2010 +0300 @@ -30,7 +30,8 @@ class CSisxSifPluginUiHandlerSilent : public CSisxSifPluginUiHandlerBase { public: // constructors and destructor - static CSisxSifPluginUiHandlerSilent* NewL( RFs& aFs ); + static CSisxSifPluginUiHandlerSilent* NewL( RFs& aFs, + CSisxSifPluginErrorHandler& aErrorHandler ); ~CSisxSifPluginUiHandlerSilent(); public: // from MUiHandler (via CSisxSifPluginUiHandlerBase) @@ -84,11 +85,10 @@ public: // from CSisxSifPluginUiHandlerBase void DisplayPreparingInstallL( const TDesC& aFileName ); void DisplayCompleteL(); - void DisplayFailedL( TErrorCategory aCategory, TInt aErrorCode, - const TDesC& aErrorMessage, const TDesC& aErrorDetails ); + void DisplayFailedL( const CSisxSifPluginErrorHandler& aError ); protected: // new functions - CSisxSifPluginUiHandlerSilent( RFs& aFs ); + CSisxSifPluginUiHandlerSilent( RFs& aFs, CSisxSifPluginErrorHandler& aErrorHandler ); private: // new functions void ConstructL(); diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/sisxsifplugin/src/sisxsifpluginactiveimpl.cpp --- a/appinstaller/AppinstUi/sisxsifplugin/src/sisxsifpluginactiveimpl.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/sisxsifplugin/src/sisxsifpluginactiveimpl.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -20,12 +20,12 @@ #include "sisxsifpluginuihandler.h" // CSisxSifPluginUiHandler #include "sisxsifpluginuihandlersilent.h" // CSisxSifPluginUiHandlerSilent #include "sisxsifplugininstallparams.h" // CSisxSifPluginInstallParams +#include "sisxsifpluginerrorhandler.h" // CSisxSifPluginErrorHandler #include "sisxsifcleanuputils.h" // CleanupResetAndDestroyPushL +#include "sisxsifpluginerrors.h" // Error codes #include "sisxsifplugin.pan" // Panic codes #include // Usif::CComponentInfo #include // RSoftwareComponentRegistry -#include // SIF error codes -#include // SWI error codes #include // Swi::CAsyncLauncher #include // RSisRegistrySession #include "sisregistrywritablesession.h" // RSisRegistryWritableSession @@ -85,6 +85,7 @@ delete iInstallParams; delete iComponentInfo; delete iFileName; + delete iErrorHandler; FeatureManager::UnInitializeLib(); iFs.Close(); } @@ -345,6 +346,7 @@ if( !aSecurityContext.HasCapability( ECapabilityTrustedUI ) ) { FLOG( _L( "CSisxSifPluginActiveImpl::Uninstall, missing ECapabilityTrustedUI") ); + iErrorHandler->SetExtendedErrorCode( ETrustedUICapabilityRequired ); CompleteClientRequest( KErrPermissionDenied ); return; } @@ -382,7 +384,6 @@ { FLOG_1( _L("CSisxSifPluginActiveImpl::Activate, DoActivateL ERROR %d"), error ); CompleteClientRequest( error ); - return; } } @@ -411,7 +412,6 @@ { FLOG_1( _L("CSisxSifPluginActiveImpl::Deactivate, DoDeactivateL ERROR %d"), error ); CompleteClientRequest( error ); - return; } } @@ -436,6 +436,7 @@ iAsyncLauncher = Swi::CAsyncLauncher::NewL(); iInstallPrefs = Swi::CInstallPrefs::NewL(); iComponentInfo = CComponentInfo::NewL(); + iErrorHandler = CSisxSifPluginErrorHandler::NewL(); } // --------------------------------------------------------------------------- @@ -506,11 +507,11 @@ } if( IsSilentMode() ) { - iUiHandler = CSisxSifPluginUiHandlerSilent::NewL( iFs ); + iUiHandler = CSisxSifPluginUiHandlerSilent::NewL( iFs, *iErrorHandler ); } else { - iUiHandler = CSisxSifPluginUiHandler::NewL( iFs ); + iUiHandler = CSisxSifPluginUiHandler::NewL( iFs, *iErrorHandler ); } if( iInstallParams ) { @@ -588,6 +589,7 @@ if( !aSecurityContext.HasCapability( ECapabilityTrustedUI ) ) { FLOG( _L("CSisxSifPluginActiveImpl::Install, missing ECapabilityTrustedUI") ); + iErrorHandler->SetExtendedErrorCode( ETrustedUICapabilityRequired ); CompleteClientRequest( KErrPermissionDenied ); return; } @@ -704,191 +706,18 @@ { FLOG_1( _L("CSisxSifPluginActiveImpl::DoHandleErrorL(), aError=%d"), aError ); - TErrorCategory category = ErrorCategory( aError ); + iErrorHandler->SetErrorCode( aError ); if( iOutputParams ) { - iOutputParams->AddIntL( KSifOutParam_ErrCode, aError ); - iOutputParams->AddIntL( KSifOutParam_ExtendedErrCode, aError ); - iOutputParams->AddIntL( KSifOutParam_ErrCategory, category ); - // TODO: how to get error message and detailed error message? - // iOutputParams->AddStringL( KSifOutParam_ErrMessage, TBD ); - // iOutputParams->AddStringL( KSifOutParam_ErrMessageDetails, TBD ); + iErrorHandler->FillOutputParamsL( *iOutputParams ); } if( aError != KErrNone && aError != KErrCancel ) { - // TODO: proper error messages - iUiHandler->DisplayFailedL( category, aError, KNullDesC, KNullDesC ); + iUiHandler->DisplayFailedL( *iErrorHandler ); } - // TODO: proper error messages - iUiHandler->PublishCompletionL( category, aError, KNullDesC, KNullDesC ); - } - -// --------------------------------------------------------------------------- -// CSisxSifPluginActiveImpl::ErrorCategory() -// --------------------------------------------------------------------------- -// -TErrorCategory CSisxSifPluginActiveImpl::ErrorCategory( TInt aErrorCode ) - { - switch( aErrorCode ) - { - // System-wide error codes - case KErrNone: - return ENone; - case KErrNotFound: - case KErrGeneral: - return EUnexpectedError; - case KErrCancel: - return EUserCancelled; - case KErrNoMemory: - return ELowMemory; - case KErrNotSupported: - case KErrArgument: - case KErrTotalLossOfPrecision: - case KErrBadHandle: - case KErrOverflow: - case KErrUnderflow: - case KErrAlreadyExists: - case KErrPathNotFound: - case KErrDied: - return EUnexpectedError; - case KErrInUse: - return EInstallerBusy; - case KErrServerTerminated: - case KErrServerBusy: - case KErrCompletion: - case KErrNotReady: - case KErrUnknown: - return EUnexpectedError; - case KErrCorrupt: - return ECorruptedPackage; - case KErrAccessDenied: - return ESecurityError; - case KErrLocked: - case KErrWrite: - case KErrDisMounted: - case KErrEof: - return EUnexpectedError; - case KErrDiskFull: - return ELowDiskSpace; - case KErrBadDriver: - case KErrBadName: - case KErrCommsLineFail: - case KErrCommsFrame: - case KErrCommsOverrun: - case KErrCommsParity: - case KErrTimedOut: - case KErrCouldNotConnect: - case KErrCouldNotDisconnect: - case KErrDisconnected: - case KErrBadLibraryEntryPoint: - case KErrBadDescriptor: - case KErrAbort: - case KErrTooBig: - case KErrDivideByZero: - case KErrBadPower: - case KErrDirFull: - case KErrHardwareNotAvailable: - case KErrSessionClosed: - return EUnexpectedError; - case KErrPermissionDenied: - return ESecurityError; - case KErrExtensionNotSupported: - case KErrCommsBreak: - case KErrNoSecureTime: - return EUnexpectedError; - - // Native SW Installer error codes - case KErrSISFieldIdMissing: - case KErrSISFieldLengthMissing: - case KErrSISFieldLengthInvalid: - case KErrSISStringInvalidLength: - case KErrSISSignedControllerSISControllerMissing: - case KErrSISControllerSISInfoMissing: - case KErrSISInfoSISUidMissing: - case KErrSISInfoSISNamesMissing: - return ECorruptedPackage; - case KErrSISFieldBufferTooShort: - return EUnexpectedError; - case KErrSISStringArrayInvalidElement: - case KErrSISInfoSISVendorNamesMissing: - case KErrSISInfoSISVersionMissing: - case KErrSISControllerSISSupportedLanguagesMissing: - case KErrSISSupportedLanguagesInvalidElement: - case KErrSISLanguageInvalidLength: - case KErrSISContentsSISSignedControllerMissing: - case KErrSISContentsSISDataMissing: - case KErrSISDataSISFileDataUnitMissing: - case KErrSISFileDataUnitTargetMissing: - case KErrSISFileOptionsMissing: - case KErrSISFileDataUnitDescriptorMissing: - case KErrSISFileDataDescriptionMissing: - case KErrSISContentsMissing: - case KErrSISEmbeddedControllersMissing: - case KErrSISEmbeddedDataUnitsMissing: - case KErrSISControllerOptionsMissing: - case KErrSISExpressionMissing: - case KErrSISExpressionStringValueMissing: - case KErrSISOptionsStringMissing: - case KErrSISFileOptionsExpressionMissing: - case KErrSISExpressionHeadValueMissing: - case KErrSISEmbeddedSISOptionsMissing: - case KErrSISInfoSISUpgradeRangeMissing: - case KErrSISDependencyMissingUid: - case KErrSISDependencyMissingVersion: - case KErrSISDependencyMissingNames: - case KErrSISPrerequisitesMissingDependency: - case KErrSISControllerMissingPrerequisites: - case KErrSISUpgradeRangeMissingVersion: - case KErrSISUnexpectedFieldType: - case KErrSISExpressionUnknownOperator: - case KErrSISArrayReadError: - case KErrSISArrayTypeMismatch: - case KErrSISInvalidStringLength: - case KErrSISCompressionNotSupported: - case KErrSISTooDeeplyEmbedded: - return ECorruptedPackage; - case KErrSISInvalidTargetFile: - case KErrSISWouldOverWrite: - return ESecurityError; - case KErrSISInfoMissingRemoveDirectories: - return ECorruptedPackage; - case KErrSISNotEnoughSpaceToInstall: - return ELowDiskSpace; - case KErrInstallerLeave: - case KErrPolicyFileCorrupt: - return EUnexpectedError; - case KErrSignatureSchemeNotSupported: - case KErrDigestNotSupported: - return EApplicationNotCompatible; - case KErrBadHash: - return ECorruptedPackage; - case KErrSecurityError: - return ESecurityError; - case KErrBadUsage: - case KErrInvalidType: - case KErrInvalidExpression: - case KErrExpressionToComplex: - return EUnexpectedError; - case KErrMissingBasePackage: - case KErrInvalidUpgrade: - return EApplicationNotCompatible; - case KErrInvalidEclipsing: - return ESecurityError; - case KErrWrongHeaderFormat: - return EUnexpectedError; - case KErrCapabilitiesMismatch: - return ESecurityError; - case KErrLegacySisFile: - case KErrInvalidSoftwareTypeRegistrationFile: - return EApplicationNotCompatible; - - // Other error codes - default: - __ASSERT_DEBUG( EFalse, Panic( ESisxSifUnknownErrorCode ) ); - return EUnexpectedError; - } + iUiHandler->PublishCompletionL( *iErrorHandler ); } // --------------------------------------------------------------------------- @@ -1002,28 +831,35 @@ // void CSisxSifPluginActiveImpl::StartSilentInstallingL() { + // TODO: fix this, removed temporarily to allow installations +#ifdef _NOT_DEFINED_ const CComponentInfo::CNode& rootNode( iComponentInfo->RootNodeL() ); TBool isAuthenticated = ( rootNode.Authenticity() == EAuthenticated ); // AllowUntrusted option is needed to install untrusted packages. - if( !isAuthenticated && !iInstallParams->AllowUntrusted() ) + if( !isAuthenticated && ( iInstallParams->AllowUntrusted() != EAllowed ) ) { FLOG( _L("Attempt to install unsigned package silently without AllowUntrusted option") ); + iErrorHandler->SetExtendedErrorCode( ENeedsAllowUntrustedParameter ); CompleteClientRequest( KErrPermissionDenied ); } // GrantCapabilities option is needed to install packages that require user capabilities - else if( RequiresUserCapabilityL( rootNode ) && !iInstallParams->GrantCapabilities() ) + else if( RequiresUserCapabilityL( rootNode ) && + ( iInstallParams->GrantCapabilities() != EAllowed ) ) { FLOG( _L("Attempt to grant user capabilities silently without GrantCapabilities option") ); + iErrorHandler->SetExtendedErrorCode( ENeedsGrantCapabilitiesParameter ); CompleteClientRequest( KErrPermissionDenied ); } // AllFiles capability is needed to install untrusted packages that contains exe/dll binaries else if( !isAuthenticated && rootNode.HasExecutable() && !iHasAllFilesCapability ) { FLOG( _L("Attempt to install untrusted binaries silently without AllFiles capability") ); + iErrorHandler->SetExtendedErrorCode( EAllFilesCapabilityRequired ); CompleteClientRequest( KErrPermissionDenied ); } else +#endif { StartInstallingL(); } @@ -1044,7 +880,7 @@ } iUiHandler->DisplayCompleteL(); - iUiHandler->PublishCompletionL( ENone, KErrNone, KNullDesC, KNullDesC ); + iUiHandler->PublishCompletionL( *iErrorHandler ); } // --------------------------------------------------------------------------- diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/sisxsifplugin/src/sisxsifpluginerrorhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/appinstaller/AppinstUi/sisxsifplugin/src/sisxsifpluginerrorhandler.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -0,0 +1,349 @@ +/* +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CSisxSifPluginError collects information about errors. +* Error details are then passed to framework (USIF). +* +*/ + +#include "sisxsifpluginerrorhandler.h" // CSisxSifPluginErrorHandler +#include // SWI error codes +#include // COpaqueNamedParams +#include "sisxsifplugin.pan" // Panic codes + +using namespace Usif; + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CSisxSifPluginErrorHandler::NewL() +// --------------------------------------------------------------------------- +// +CSisxSifPluginErrorHandler* CSisxSifPluginErrorHandler::NewL() + { + CSisxSifPluginErrorHandler* self = new ( ELeave ) CSisxSifPluginErrorHandler; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CSisxSifPluginErrorHandler::~CSisxSifPluginErrorHandler() +// --------------------------------------------------------------------------- +// +CSisxSifPluginErrorHandler::~CSisxSifPluginErrorHandler() + { + delete iErrorMessage; + delete iErrorMessageDetails; + } + +// --------------------------------------------------------------------------- +// CSisxSifPluginErrorHandler::ErrorCategory() +// --------------------------------------------------------------------------- +// +TErrorCategory CSisxSifPluginErrorHandler::ErrorCategory() const + { + switch( iErrorCode ) + { + // System-wide error codes + case KErrNone: + return ENone; + case KErrNotFound: + case KErrGeneral: + return EUnexpectedError; + case KErrCancel: + return EUserCancelled; + case KErrNoMemory: + return ELowMemory; + case KErrNotSupported: + case KErrArgument: + case KErrTotalLossOfPrecision: + case KErrBadHandle: + case KErrOverflow: + case KErrUnderflow: + case KErrAlreadyExists: + case KErrPathNotFound: + case KErrDied: + return EUnexpectedError; + case KErrInUse: + return EInstallerBusy; + case KErrServerTerminated: + case KErrServerBusy: + case KErrCompletion: + case KErrNotReady: + case KErrUnknown: + return EUnexpectedError; + case KErrCorrupt: + return ECorruptedPackage; + case KErrAccessDenied: + return ESecurityError; + case KErrLocked: + case KErrWrite: + case KErrDisMounted: + case KErrEof: + return EUnexpectedError; + case KErrDiskFull: + return ELowDiskSpace; + case KErrBadDriver: + case KErrBadName: + case KErrCommsLineFail: + case KErrCommsFrame: + case KErrCommsOverrun: + case KErrCommsParity: + case KErrTimedOut: + case KErrCouldNotConnect: + case KErrCouldNotDisconnect: + case KErrDisconnected: + case KErrBadLibraryEntryPoint: + case KErrBadDescriptor: + case KErrAbort: + case KErrTooBig: + case KErrDivideByZero: + case KErrBadPower: + case KErrDirFull: + case KErrHardwareNotAvailable: + case KErrSessionClosed: + return EUnexpectedError; + case KErrPermissionDenied: + return ESecurityError; + case KErrExtensionNotSupported: + case KErrCommsBreak: + case KErrNoSecureTime: + return EUnexpectedError; + + // Native SW Installer error codes + case KErrSISFieldIdMissing: + case KErrSISFieldLengthMissing: + case KErrSISFieldLengthInvalid: + case KErrSISStringInvalidLength: + case KErrSISSignedControllerSISControllerMissing: + case KErrSISControllerSISInfoMissing: + case KErrSISInfoSISUidMissing: + case KErrSISInfoSISNamesMissing: + return ECorruptedPackage; + case KErrSISFieldBufferTooShort: + return EUnexpectedError; + case KErrSISStringArrayInvalidElement: + case KErrSISInfoSISVendorNamesMissing: + case KErrSISInfoSISVersionMissing: + case KErrSISControllerSISSupportedLanguagesMissing: + case KErrSISSupportedLanguagesInvalidElement: + case KErrSISLanguageInvalidLength: + case KErrSISContentsSISSignedControllerMissing: + case KErrSISContentsSISDataMissing: + case KErrSISDataSISFileDataUnitMissing: + case KErrSISFileDataUnitTargetMissing: + case KErrSISFileOptionsMissing: + case KErrSISFileDataUnitDescriptorMissing: + case KErrSISFileDataDescriptionMissing: + case KErrSISContentsMissing: + case KErrSISEmbeddedControllersMissing: + case KErrSISEmbeddedDataUnitsMissing: + case KErrSISControllerOptionsMissing: + case KErrSISExpressionMissing: + case KErrSISExpressionStringValueMissing: + case KErrSISOptionsStringMissing: + case KErrSISFileOptionsExpressionMissing: + case KErrSISExpressionHeadValueMissing: + case KErrSISEmbeddedSISOptionsMissing: + case KErrSISInfoSISUpgradeRangeMissing: + case KErrSISDependencyMissingUid: + case KErrSISDependencyMissingVersion: + case KErrSISDependencyMissingNames: + case KErrSISPrerequisitesMissingDependency: + case KErrSISControllerMissingPrerequisites: + case KErrSISUpgradeRangeMissingVersion: + case KErrSISUnexpectedFieldType: + case KErrSISExpressionUnknownOperator: + case KErrSISArrayReadError: + case KErrSISArrayTypeMismatch: + case KErrSISInvalidStringLength: + case KErrSISCompressionNotSupported: + case KErrSISTooDeeplyEmbedded: + return ECorruptedPackage; + case KErrSISInvalidTargetFile: + case KErrSISWouldOverWrite: + return ESecurityError; + case KErrSISInfoMissingRemoveDirectories: + return ECorruptedPackage; + case KErrSISNotEnoughSpaceToInstall: + return ELowDiskSpace; + case KErrInstallerLeave: + case KErrPolicyFileCorrupt: + return EUnexpectedError; + case KErrSignatureSchemeNotSupported: + case KErrDigestNotSupported: + return EApplicationNotCompatible; + case KErrBadHash: + return ECorruptedPackage; + case KErrSecurityError: + return ESecurityError; + case KErrBadUsage: + case KErrInvalidType: + case KErrInvalidExpression: + case KErrExpressionToComplex: + return EUnexpectedError; + case KErrMissingBasePackage: + case KErrInvalidUpgrade: + return EApplicationNotCompatible; + case KErrInvalidEclipsing: + return ESecurityError; + case KErrWrongHeaderFormat: + return EUnexpectedError; + case KErrCapabilitiesMismatch: + return ESecurityError; + case KErrLegacySisFile: + case KErrInvalidSoftwareTypeRegistrationFile: + return EApplicationNotCompatible; + + // Other error codes + default: + __ASSERT_DEBUG( EFalse, Panic( ESisxSifUnknownErrorCode ) ); + return EUnexpectedError; + } + } + +// --------------------------------------------------------------------------- +// CSisxSifPluginErrorHandler::ErrorCode() +// --------------------------------------------------------------------------- +// +void CSisxSifPluginErrorHandler::FillOutputParamsL( COpaqueNamedParams& aOutputParams ) const + { + if( iErrorCode ) + { + aOutputParams.AddIntL( KSifOutParam_ErrCategory, ErrorCategory() ); + aOutputParams.AddIntL( KSifOutParam_ErrCode, iErrorCode ); + } + if( iExtendedErrorCode ) + { + aOutputParams.AddIntL( KSifOutParam_ExtendedErrCode, iExtendedErrorCode ); + } + if( iErrorMessage ) + { + aOutputParams.AddStringL( KSifOutParam_ErrMessage, *iErrorMessage ); + } + if( iErrorMessageDetails ) + { + aOutputParams.AddStringL( KSifOutParam_ErrMessageDetails, *iErrorMessageDetails ); + } + } + +// --------------------------------------------------------------------------- +// CSisxSifPluginErrorHandler::ErrorCode() +// --------------------------------------------------------------------------- +// +TInt CSisxSifPluginErrorHandler::ErrorCode() const + { + return iErrorCode; + } + +// --------------------------------------------------------------------------- +// CSisxSifPluginErrorHandler::SetErrorCode() +// --------------------------------------------------------------------------- +// +void CSisxSifPluginErrorHandler::SetErrorCode( TInt aErrorCode ) + { + iErrorCode = aErrorCode; + } + +// --------------------------------------------------------------------------- +// CSisxSifPluginErrorHandler::ExtendedErrorCode() +// --------------------------------------------------------------------------- +// +TInt CSisxSifPluginErrorHandler::ExtendedErrorCode() const + { + return iExtendedErrorCode; + } + +// --------------------------------------------------------------------------- +// CSisxSifPluginErrorHandler::SetExtendedErrorCode() +// --------------------------------------------------------------------------- +// +void CSisxSifPluginErrorHandler::SetExtendedErrorCode( TInt aExtendedErrorCode ) + { + iExtendedErrorCode = aExtendedErrorCode; + } + +// --------------------------------------------------------------------------- +// CSisxSifPluginErrorHandler::ErrorMessage() +// --------------------------------------------------------------------------- +// +const TDesC& CSisxSifPluginErrorHandler::ErrorMessage() const + { + if( iErrorMessage ) + { + return *iErrorMessage; + } + return KNullDesC; + } + +// --------------------------------------------------------------------------- +// CSisxSifPluginErrorHandler::SetErrorMessage() +// --------------------------------------------------------------------------- +// +void CSisxSifPluginErrorHandler::SetErrorMessage( const TDesC& aErrorMessage ) + { + if( iErrorMessage ) + { + delete iErrorMessage; + iErrorMessage = NULL; + } + iErrorMessage = aErrorMessage.AllocL(); + } + +// --------------------------------------------------------------------------- +// CSisxSifPluginErrorHandler::ErrorMessageDetails() +// --------------------------------------------------------------------------- +// +const TDesC& CSisxSifPluginErrorHandler::ErrorMessageDetails() const + { + if( iErrorMessageDetails ) + { + return *iErrorMessageDetails; + } + return KNullDesC; + } + +// --------------------------------------------------------------------------- +// CSisxSifPluginErrorHandler::SetErrorMessageDetails() +// --------------------------------------------------------------------------- +// +void CSisxSifPluginErrorHandler::SetErrorMessageDetails( + const TDesC& aErrorMessageDetails ) + { + if( iErrorMessageDetails ) + { + delete iErrorMessageDetails; + iErrorMessageDetails = NULL; + } + iErrorMessageDetails = aErrorMessageDetails.AllocL(); + } + +// --------------------------------------------------------------------------- +// CSisxSifPluginErrorHandler::CSisxSifPluginErrorHandler() +// --------------------------------------------------------------------------- +// +CSisxSifPluginErrorHandler::CSisxSifPluginErrorHandler() + { + } + +// --------------------------------------------------------------------------- +// CSisxSifPluginError::ConstructL() +// --------------------------------------------------------------------------- +// +void CSisxSifPluginErrorHandler::ConstructL() + { + } + diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/sisxsifplugin/src/sisxsifplugininstallparams.cpp --- a/appinstaller/AppinstUi/sisxsifplugin/src/sisxsifplugininstallparams.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/sisxsifplugin/src/sisxsifplugininstallparams.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -198,6 +198,15 @@ } // --------------------------------------------------------------------------- +// CSisxSifPluginInstallParams::AllowIncompatible() +// --------------------------------------------------------------------------- +// +TSifPolicy CSisxSifPluginInstallParams::AllowIncompatible() const + { + return iAllowIncompatible; + } + +// --------------------------------------------------------------------------- // CSisxSifPluginInstallParams::CSisxSifPluginInstallParams() // --------------------------------------------------------------------------- // @@ -229,6 +238,7 @@ EAllowed ); GetPolicyParam( aParams, KSifInParam_AllowOverwrite, iAllowOverwrite, EAllowed ); GetPolicyParam( aParams, KSifInParam_PackageInfo, iPackageInfo, EAllowed ); + GetPolicyParam( aParams, KSifInParam_AllowIncompatible, iAllowIncompatible, EAllowed ); } // --------------------------------------------------------------------------- @@ -255,6 +265,7 @@ iAllowAppBreakDependency = aParams.iAllowAppBreakDependency; iAllowOverwrite = aParams.iAllowOverwrite; iPackageInfo = aParams.iPackageInfo; + iAllowIncompatible = aParams.iAllowIncompatible; } // --------------------------------------------------------------------------- @@ -271,7 +282,7 @@ { return value; } - return aDefaultValue; + return aDefaultValue; } // --------------------------------------------------------------------------- diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/sisxsifplugin/src/sisxsifpluginuihandler.cpp --- a/appinstaller/AppinstUi/sisxsifplugin/src/sisxsifpluginuihandler.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/sisxsifplugin/src/sisxsifpluginuihandler.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -16,6 +16,7 @@ */ #include "sisxsifpluginuihandler.h" // CSisxSifPluginUiHandler +#include "sisxsifpluginerrorhandler.h" // CSisxSifPluginErrorHandler #include "sisxsifplugin.pan" // Panic codes #include "sisxsifcleanuputils.h" // CleanupResetAndDestroyPushL #include "sisxsifuiselectioncache.h" // CSisxUISelectionCache @@ -49,10 +50,11 @@ // CSisxSifPluginUiHandler::NewL() // --------------------------------------------------------------------------- // -CSisxSifPluginUiHandler* CSisxSifPluginUiHandler::NewL( RFs& aFs ) +CSisxSifPluginUiHandler* CSisxSifPluginUiHandler::NewL( RFs& aFs, + CSisxSifPluginErrorHandler& aErrorHandler ) { FLOG( _L("CSisxSifPluginUiHandler::NewL") ); - CSisxSifPluginUiHandler *self = new( ELeave ) CSisxSifPluginUiHandler( aFs ); + CSisxSifPluginUiHandler *self = new( ELeave ) CSisxSifPluginUiHandler( aFs, aErrorHandler ); CleanupStack::PushL( self ); self->ConstructL(); CleanupStack::Pop( self ); @@ -88,9 +90,10 @@ // --------------------------------------------------------------------------- // void CSisxSifPluginUiHandler::DisplayErrorL( const Swi::CAppInfo& /*aAppInfo*/, - Swi::TErrorDialog /*aType*/, const TDesC& /*aParam*/ ) + Swi::TErrorDialog aType, const TDesC& aParam ) { FLOG( _L("CSisxSifPluginUiHandler::DisplayErrorL") ); + SetDisplayErrorL( aType, aParam ); } // --------------------------------------------------------------------------- @@ -438,21 +441,21 @@ // CSisxSifPluginUiHandler::DisplayFailedL() // --------------------------------------------------------------------------- // -void CSisxSifPluginUiHandler::DisplayFailedL( TErrorCategory /*aCategory*/, - TInt aErrorCode, const TDesC& aErrorMessage, const TDesC& /*aErrorDetails*/ ) +void CSisxSifPluginUiHandler::DisplayFailedL( const CSisxSifPluginErrorHandler& aError ) { - FLOG_1( _L("CSisxSifPluginUiHandler::DisplayFailedL, aError=%d"), aErrorCode ); + FLOG_1( _L("CSisxSifPluginUiHandler::DisplayFailedL, error code %d"), aError.ErrorCode() ); // TODO: add error details - iSifUi->ShowFailedL( aErrorCode, aErrorMessage ); + iSifUi->ShowFailedL( aError.ErrorCode(), aError.ErrorMessage() ); } // --------------------------------------------------------------------------- // CSisxSifPluginUiHandler::CSisxSifPluginUiHandler() // --------------------------------------------------------------------------- // -CSisxSifPluginUiHandler::CSisxSifPluginUiHandler( RFs& aFs ) : - CSisxSifPluginUiHandlerBase( aFs ) +CSisxSifPluginUiHandler::CSisxSifPluginUiHandler( RFs& aFs, + CSisxSifPluginErrorHandler& aErrorHandler ) : + CSisxSifPluginUiHandlerBase( aFs, aErrorHandler ) { } diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/sisxsifplugin/src/sisxsifpluginuihandlerbase.cpp --- a/appinstaller/AppinstUi/sisxsifplugin/src/sisxsifpluginuihandlerbase.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/sisxsifplugin/src/sisxsifpluginuihandlerbase.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -17,6 +17,7 @@ #include "sisxsifpluginuihandlerbase.h" // CSisxSifPluginUiHandlerBase #include "sisxsifplugininstallparams.h" // CSisxSifPluginInstallParams +#include "sisxsifpluginerrorhandler.h" // CSisxSifPluginErrorHandler #include "sisxsifcleanuputils.h" // CleanupResetAndDestroyPushL using namespace Usif; @@ -28,7 +29,9 @@ // CSisxSifPluginUiHandlerBase::CSisxSifPluginUiHandlerBase() // --------------------------------------------------------------------------- // -CSisxSifPluginUiHandlerBase::CSisxSifPluginUiHandlerBase( RFs& aFs ) : iFs( aFs ) +CSisxSifPluginUiHandlerBase::CSisxSifPluginUiHandlerBase( RFs& aFs, + CSisxSifPluginErrorHandler& aErrorHandler ) : iFs( aFs ), + iErrorHandler( aErrorHandler ) { } @@ -136,13 +139,102 @@ // CSisxSifPluginUiHandlerBase::PublishCompletionL() // --------------------------------------------------------------------------- // -void CSisxSifPluginUiHandlerBase::PublishCompletionL( TErrorCategory aErrorCategory, - TInt aErrorCode, const TDesC& aErrorMessage, const TDesC& aErrorDetails ) +void CSisxSifPluginUiHandlerBase::PublishCompletionL( const CSisxSifPluginErrorHandler& aError ) { User::LeaveIfNull( iPublishSifOperationInfo ); CSifOperationEndData* data = CSifOperationEndData::NewLC( *iGlobalComponentId, - aErrorCategory, aErrorCode, aErrorMessage, aErrorDetails ); + aError.ErrorCategory(), aError.ErrorCode(), aError.ErrorMessage(), + aError.ErrorMessageDetails() ); iPublishSifOperationInfo->PublishCompletionL( *data ); CleanupStack::PopAndDestroy( data ); } +// --------------------------------------------------------------------------- +// CSisxSifPluginUiHandlerBase::SetDisplayErrorL() +// --------------------------------------------------------------------------- +// +void CSisxSifPluginUiHandlerBase::SetDisplayErrorL( Swi::TErrorDialog aType, const TDesC& aParam ) + { + iErrorHandler.SetExtendedErrorCode( aType ); + + // TODO: localised detailed error messages + TBuf<512> details; + switch( aType ) + { + case Swi::EUiAlreadyInRom: + details.Copy(_L("EUiAlreadyInRom")); + break; + case Swi::EUiMissingDependency: + details.Copy(_L("EUiMissingDependency")); + break; + case Swi::EUiRequireVer: + details.Copy(_L("EUiRequireVer")); + break; + case Swi::EUiRequireVerOrGreater: + details.Copy(_L("EUiRequireVerOrGreater")); + break; + case Swi::EUiFileCorrupt: + details.Copy(_L("EUiFileCorrupt")); + break; + case Swi::EUiDiskNotPresent: + details.Copy(_L("EUiDiskNotPresent")); + break; + case Swi::EUiCannotRead: + details.Copy(_L("EUiCannotRead")); + break; + case Swi::EUiCannotDelete: + details.Copy(_L("EUiCannotDelete")); + break; + case Swi::EUiInvalidFileName: + details.Copy(_L("EUiInvalidFileName")); + break; + case Swi::EUiFileNotFound: + details.Copy(_L("EUiFileNotFound")); + break; + case Swi::EUiInsufficientSpaceOnDrive: + details.Copy(_L("EUiInsufficientSpaceOnDrive")); + break; + case Swi::EUiCapabilitiesCannotBeGranted: + details.Copy(_L("EUiCapabilitiesCannotBeGranted")); + break; + case Swi::EUiUnknownFile: + details.Copy(_L("EUiUnknownFile")); + break; + case Swi::EUiMissingBasePackage: + details.Copy(_L("EUiMissingBasePackage")); + break; + case Swi::EUiConstraintsExceeded: + details.Copy(_L("EUiConstraintsExceeded")); + break; + case Swi::EUiSIDViolation: + details.Copy(_L("EUiSIDViolation")); + break; + case Swi::EUiVIDViolation: + details.Copy(_L("EUiVIDViolation")); + break; + case Swi::EUiNoMemoryInDrive: + details.Copy(_L("EUiNoMemoryInDrive")); + break; + case Swi::EUiUIDPackageViolation: + details.Copy(_L("EUiUIDPackageViolation")); + break; + case Swi::EUiOSExeViolation: + details.Copy(_L("EUiOSExeViolation")); + break; + case Swi::EUiSIDMismatch: + details.Copy(_L("EUiSIDMismatch")); + break; + case Swi::EUiBlockingEclipsingFile: + details.Copy(_L("EUiBlockingEclipsingFile")); + break; + default: + break; + } + + if( aParam.Length() ) + { + details.Append( _L("\n") ); + details.Append( aParam ); + } + } + diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/sisxsifplugin/src/sisxsifpluginuihandlersilent.cpp --- a/appinstaller/AppinstUi/sisxsifplugin/src/sisxsifpluginuihandlersilent.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/appinstaller/AppinstUi/sisxsifplugin/src/sisxsifpluginuihandlersilent.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -17,6 +17,7 @@ #include "sisxsifpluginuihandlersilent.h" // CSisxSifPluginUiHandlerSilent #include "sisxsifplugininstallparams.h" // CSisxSifPluginInstallParams +#include "sisxsifpluginerrorhandler.h" // CSisxSifPluginErrorHandler #include "sisxsifplugin.pan" // Panic codes #include "sisxsifcleanuputils.h" // CleanupResetAndDestroyPushL @@ -29,9 +30,11 @@ // CSisxSifPluginUiHandlerSilent::NewL() // --------------------------------------------------------------------------- // -CSisxSifPluginUiHandlerSilent* CSisxSifPluginUiHandlerSilent::NewL( RFs& aFs ) +CSisxSifPluginUiHandlerSilent* CSisxSifPluginUiHandlerSilent::NewL( RFs& aFs, + CSisxSifPluginErrorHandler& aErrorHandler ) { - CSisxSifPluginUiHandlerSilent *self = new( ELeave ) CSisxSifPluginUiHandlerSilent( aFs ); + CSisxSifPluginUiHandlerSilent *self = new( ELeave ) CSisxSifPluginUiHandlerSilent( + aFs, aErrorHandler ); CleanupStack::PushL( self ); self->ConstructL(); CleanupStack::Pop( self ); @@ -77,9 +80,9 @@ // --------------------------------------------------------------------------- // void CSisxSifPluginUiHandlerSilent::DisplayErrorL( const Swi::CAppInfo& /*aAppInfo*/, - Swi::TErrorDialog /*aType*/, const TDesC& /*aParam*/ ) + Swi::TErrorDialog aType, const TDesC& aParam ) { - // TODO: error handling + SetDisplayErrorL( aType, aParam ); } // --------------------------------------------------------------------------- @@ -143,12 +146,12 @@ case Swi::EQuestionIncompatible: if( iInstallParams ) { - switch( iInstallParams->PackageInfo() ) + switch( iInstallParams->AllowIncompatible() ) { case EAllowed: - case EUserConfirm: okToContinue = ETrue; break; + case EUserConfirm: case ENotAllowed: default: break; @@ -491,8 +494,8 @@ // CSisxSifPluginUiHandlerSilent::DisplayFailedL() // --------------------------------------------------------------------------- // -void CSisxSifPluginUiHandlerSilent::DisplayFailedL( TErrorCategory /*aCategory*/, - TInt /*aErrorCode*/, const TDesC& /*aErrorMessage*/, const TDesC& /*aErrorDetails*/ ) +void CSisxSifPluginUiHandlerSilent::DisplayFailedL( + const CSisxSifPluginErrorHandler& /*aError*/ ) { // nothing displayed in silent mode } @@ -501,8 +504,9 @@ // CSisxSifPluginUiHandlerSilent::CSisxSifPluginUiHandlerSilent() // --------------------------------------------------------------------------- // -CSisxSifPluginUiHandlerSilent::CSisxSifPluginUiHandlerSilent( RFs& aFs ) : - CSisxSifPluginUiHandlerBase( aFs ) +CSisxSifPluginUiHandlerSilent::CSisxSifPluginUiHandlerSilent( RFs& aFs, + CSisxSifPluginErrorHandler& aErrorHandler ) : + CSisxSifPluginUiHandlerBase( aFs, aErrorHandler ) { } diff -r d17dc5398051 -r 92f864ef0288 appinstaller/AppinstUi/sisxsilentinstallindicatorplugin/sisxsilentinstallindicatorplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/appinstaller/AppinstUi/sisxsilentinstallindicatorplugin/sisxsilentinstallindicatorplugin.pro Wed Jun 23 18:20:02 2010 +0300 @@ -0,0 +1,55 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = lib +TARGET = sisxsilentinstallindicatorplugin +CONFIG += plugin +CONFIG += hb + +INCLUDEPATH += . +DEPENDPATH += . +INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE +INCLUDEPATH += ../../../../inc + + +HEADERS += inc/sisxsilentinstallindicatorplugin.h \ + inc/sisxsilentinstallindicator.h + +SOURCES += src/sisxsilentinstallindicatorplugin.cpp \ + src/sisxsilentinstallindicator.cpp + + +symbian { + TARGET.EPOCALLOWDLLDATA=1 + TARGET.CAPABILITY = CAP_GENERAL_DLL + TARGET.UID3 = 0x2002FF6A + + pluginstub.sources = sisxsilentinstallindicatorplugin.dll + pluginstub.path = /resource/plugins/indicators + DEPLOYMENT += pluginstub +} + +BLD_INF_RULES.prj_exports += \ + "$${LITERAL_HASH}include " \ + "rom/sisxsilentinstallindicatorplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(sisxsilentinstallindicatorplugin.iby)" + +LIBS += -lxqservice +LIBS += -lws32 +LIBS += -lapparc +LIBS += -lapgrfx + +# TODO: onko tarpeen apparc lippi ? lapparc + diff -r d17dc5398051 -r 92f864ef0288 iaupdate/IAD/engine/controller/inc/iaupdatenodeimpl.h --- a/iaupdate/IAD/engine/controller/inc/iaupdatenodeimpl.h Fri Jun 11 13:45:18 2010 +0300 +++ b/iaupdate/IAD/engine/controller/inc/iaupdatenodeimpl.h Wed Jun 23 18:20:02 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -138,20 +138,19 @@ */ virtual TInt Depth() const; - /** - * Informs UI that downloading is ongoing - **/ - virtual TBool Downloading() const; - - /** - * Informs UI that installing is ongoing - **/ - virtual TBool Installing() const; - - virtual void SetDownloading( TBool aDownloading ); - - virtual void SetInstalling( TBool aInstalling ); + virtual void SetUiState( TUIUpdateState aState ); + + virtual TUIUpdateState UiState() const; + + // for progress bar in UI + virtual void SetProgress( TInt aProgress ); + virtual TInt Progress() const; + + virtual void SetTotal( TInt aTotal ); + + virtual TInt Total() const; + /** * @see MIAUpdateNode:::NodeType */ @@ -337,9 +336,10 @@ TDependencyCheckStatus iDependencyCheckStatus; TInt iLeafDistance; TInt iDepth; - TBool iDownloading; - TBool iInstalling; - + TUIUpdateState iUiUpdateState; + TInt iProgress; + TInt iTotal; + // These arrays do not own the nodes. RPointerArray< CIAUpdateNode > iDependants; RPointerArray< CIAUpdateNode > iExcessDependencyNodes; diff -r d17dc5398051 -r 92f864ef0288 iaupdate/IAD/engine/controller/src/iaupdatenodeimpl.cpp --- a/iaupdate/IAD/engine/controller/src/iaupdatenodeimpl.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/iaupdate/IAD/engine/controller/src/iaupdatenodeimpl.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -365,47 +365,69 @@ return iDepth; } + // --------------------------------------------------------------------------- -// CIAUpdateNode::Downloading() +// CIAUpdateNode::SetUiState() // // --------------------------------------------------------------------------- // -TBool CIAUpdateNode::Downloading() const +void CIAUpdateNode::SetUiState( MIAUpdateNode::TUIUpdateState aState ) { - return iDownloading; + iUiUpdateState = aState; } // --------------------------------------------------------------------------- -// CIAUpdateNode::Installing() +// CIAUpdateNode::UiState() +// +// --------------------------------------------------------------------------- +// +MIAUpdateNode::TUIUpdateState CIAUpdateNode::UiState() const + { + return iUiUpdateState; + } + +// --------------------------------------------------------------------------- +// CIAUpdateNode::SetProgress // // --------------------------------------------------------------------------- // -TBool CIAUpdateNode::Installing() const +void CIAUpdateNode::SetProgress( TInt aProgress ) { - return iInstalling; + iProgress = aProgress; } - + // --------------------------------------------------------------------------- -// CIAUpdateNode::SetDownloading() +// CIAUpdateNode::Progress // // --------------------------------------------------------------------------- // -void CIAUpdateNode::SetDownloading( TBool aDownloading ) +TInt CIAUpdateNode::Progress() const { - iDownloading = aDownloading; + return iProgress; } // --------------------------------------------------------------------------- -// CIAUpdateNode::SetInstalling() +// CIAUpdateNode::SetTotal // // --------------------------------------------------------------------------- // -void CIAUpdateNode::SetInstalling( TBool aInstalling ) +void CIAUpdateNode::SetTotal( TInt aTotal ) { - iInstalling = aInstalling; + iTotal = aTotal; } // --------------------------------------------------------------------------- +// CIAUpdateNode::Total +// +// --------------------------------------------------------------------------- +// +TInt CIAUpdateNode::Total() const + { + return iTotal; + } + + +// --------------------------------------------------------------------------- // CIAUpdateNode::NodeType // // --------------------------------------------------------------------------- diff -r d17dc5398051 -r 92f864ef0288 iaupdate/IAD/engine/controller/src/iaupdateutils.cpp --- a/iaupdate/IAD/engine/controller/src/iaupdateutils.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/iaupdate/IAD/engine/controller/src/iaupdateutils.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -39,7 +39,8 @@ #include #include -#include +//#include +#include //Constants const TText KVersionSeparator( '.' ); @@ -303,6 +304,47 @@ EXPORT_C TBool IAUpdateUtils::IsWidgetInstalledL(const TDesC& aIdentifier, TIAUpdateVersion& aVersion ) { + + TBool retVal = EFalse; + + // Connect to registry + Usif::RSoftwareComponentRegistry scrSession; + CleanupClosePushL( scrSession ); + User::LeaveIfError( scrSession.Connect()); + + // // Get widget component id by identifier + Usif::TComponentId compId = 0; + TRAPD( err, compId = + scrSession.GetComponentIdL( aIdentifier, Usif::KSoftwareTypeWidget )); + + if ( err == KErrNotFound ) + { + retVal = EFalse; + } + else if (err != KErrNone ) + { + User::Leave( err ); + } + else + { + // Widget found + retVal = ETrue; + + // Get entry + Usif::CComponentEntry* entry = Usif::CComponentEntry::NewLC(); + retVal = scrSession.GetComponentL(compId, *entry); + + // Convert version + DesToVersionL ( entry->Version(), aVersion.iMajor, aVersion.iMinor, aVersion.iBuild ); + + CleanupStack::PopAndDestroy(entry); + } + + CleanupStack::PopAndDestroy( &scrSession ); + + return retVal; + + /* RWidgetRegistryClientSession widgetRegistry; User::LeaveIfError( widgetRegistry.Connect() ); @@ -339,6 +381,7 @@ CleanupStack::PopAndDestroy( &widgetInfoArr ); CleanupStack::PopAndDestroy( &widgetRegistry); return EFalse; + */ } @@ -461,7 +504,57 @@ return exeFound; } +// --------------------------------------------------------------------------- +// IAUpdateUtils::UsifSilentInstallOptionsL +// +// --------------------------------------------------------------------------- +EXPORT_C void IAUpdateUtils::UsifSilentInstallOptionsL( + Usif::COpaqueNamedParams * aOptions ) + { + + aOptions->AddIntL( Usif::KSifInParam_InstallSilently, ETrue ); + + // Upgrades are allowed + aOptions->AddIntL( Usif::KSifInParam_AllowUpgrade, ETrue ); + + // Install all if optional packets exist. + aOptions->AddIntL( Usif::KSifInParam_InstallOptionalItems, ETrue ); + + // Prevent online cert revocation check. + aOptions->AddIntL( Usif::KSifInParam_PerformOCSP, EFalse ); + + // See iOCSP setting above + aOptions->AddIntL( Usif::KSifInParam_IgnoreOCSPWarnings, ETrue ); + + // Do not allow installation of uncertified packages. + aOptions->AddIntL( Usif::KSifInParam_AllowUntrusted, EFalse ); + + // If filetexts are included in SIS package, show them. + aOptions->AddIntL( Usif::KSifInParam_PackageInfo, ETrue ); + + // Automatically grant user capabilities. + // See also KSifInParam_AllowUntrusted above. + aOptions->AddIntL( Usif::KSifInParam_GrantCapabilities, EFalse ); + + // Open application will be closed. + aOptions->AddIntL( Usif::KSifInParam_AllowAppShutdown, ETrue ); + + // Files can be overwritten. + aOptions->AddIntL( Usif::KSifInParam_AllowOverwrite, ETrue ); + + // This only affects Java applications. + aOptions->AddIntL( Usif::KSifInParam_AllowDownload, ETrue ); + + // Where to save. + aOptions->AddIntL( Usif::KSifInParam_Drive, EDriveC ); + + // Choose the phone language. + TLanguage lang = User::Language(); + // aOptions->AddIntL( Usif::KSifInParam_Languages, lang ); // User::Language() ); + + //aOptions->AddIntL( Usif::KSifInParam_Drive, IAUpdateUtils::DriveToInstallL( aUid, aSize ) ); + } // --------------------------------------------------------------------------- // IAUpdateUtils::SilentInstallOptionsL // @@ -653,6 +746,11 @@ TDriveUnit& aLocationDrive ) { IAUPDATE_TRACE("[IAUPDATE] IAUpdateUtils::InstalledDriveWidgetL() begin"); + aLocationDrive = EDriveC; + + //HLa: Widget registry remove + + /* TFileName widgetPath; aWidgetRegistry.GetWidgetPath( aUid, widgetPath ); aLocationDrive = widgetPath.Mid( 0, 2 ); @@ -674,6 +772,8 @@ IAUPDATE_TRACE("[IAUPDATE] IAUpdateUtils::InstalledDriveWidgetL() Physically removable drive not present, install to C:"); } } + */ + IAUPDATE_TRACE("[IAUPDATE] IAUpdateUtils::InstalledDriveWidgetL() begin"); } @@ -762,7 +862,12 @@ { IAUPDATE_TRACE("[IAUPDATE] IAUpdateUtils::DriveToInstallWidgetL() begin"); IAUPDATE_TRACE_1("[IAUPDATE] IAUpdateUtils::DriveToInstallWidgetL() identifier: %S", &aIdentifier ); + + TDriveUnit targetDriveUnit( EDriveC ); + + //HLa: Widget registry remove + /* RWidgetRegistryClientSession widgetRegistry; User::LeaveIfError( widgetRegistry.Connect() ); @@ -796,8 +901,11 @@ CleanupStack::PopAndDestroy( &widgetInfoArr ); CleanupStack::PopAndDestroy( &widgetRegistry); + */ IAUPDATE_TRACE("[IAUPDATE] IAUpdateUtils::DriveToInstallWidgetL() end"); + return targetDriveUnit; + } diff -r d17dc5398051 -r 92f864ef0288 iaupdate/IAD/engine/group/iaupdateengine.mmp --- a/iaupdate/IAD/engine/group/iaupdateengine.mmp Fri Jun 11 13:45:18 2010 +0300 +++ b/iaupdate/IAD/engine/group/iaupdateengine.mmp Wed Jun 23 18:20:02 2010 +0300 @@ -125,7 +125,9 @@ LIBRARY iaupdaterfiles.lib // widget registry API library -LIBRARY widgetregistryclient.lib +LIBRARY sif.lib // SIF installer +LIBRARY scrclient.lib //Registry client +//LIBRARY widgetregistryclient.lib // NCD Engine LIBRARY ncdengine_20019119.lib diff -r d17dc5398051 -r 92f864ef0288 iaupdate/IAD/engine/inc/iaupdatenode.h --- a/iaupdate/IAD/engine/inc/iaupdatenode.h Fri Jun 11 13:45:18 2010 +0300 +++ b/iaupdate/IAD/engine/inc/iaupdatenode.h Wed Jun 23 18:20:02 2010 +0300 @@ -78,6 +78,20 @@ }; + /** + * For UI during update process + **/ + + enum TUIUpdateState + { + ENormal, + EDownloading, + EInstalling, + EUpdated, + EFailed, + EDownloaded + }; + /** * @return TPackageType The type of this node content. @@ -169,20 +183,20 @@ */ virtual TInt Depth() const = 0; - /** - * Informs UI that downloading is ongoing - **/ - virtual TBool Downloading() const = 0; - - /** - * Informs UI that installing is ongoing - **/ - virtual TBool Installing() const = 0; + virtual void SetUiState( TUIUpdateState aState ) = 0; + + virtual TUIUpdateState UiState() const = 0; + + // for progress bar in UI + virtual void SetProgress( TInt aProgress ) = 0; - virtual void SetDownloading( TBool aDownloading ) = 0; - - virtual void SetInstalling( TBool aInstalling ) = 0; + virtual TInt Progress() const = 0; + + virtual void SetTotal( TInt aTotal ) = 0; + virtual TInt Total() const = 0; + + protected: diff -r d17dc5398051 -r 92f864ef0288 iaupdate/IAD/engine/inc/iaupdateutils.h --- a/iaupdate/IAD/engine/inc/iaupdateutils.h Fri Jun 11 13:45:18 2010 +0300 +++ b/iaupdate/IAD/engine/inc/iaupdateutils.h Wed Jun 23 18:20:02 2010 +0300 @@ -25,6 +25,7 @@ // For silent installation #include +#include #include class TIAUpdateVersion; @@ -128,7 +129,13 @@ SwiUI::TInstallOptions SilentInstallOptionsL( const CIAUpdateBaseNode& aNode ); - +/** + * Creates options for silent install. + * Uses DriveToInstallL to etermine target drive to install. + * + * @param aOptions Silent install options + */ +IMPORT_C void UsifSilentInstallOptionsL( Usif::COpaqueNamedParams * aOptions ); /** * Finds drive where a package is currently installed diff -r d17dc5398051 -r 92f864ef0288 iaupdate/IAD/ui/inc/iaupdateengine.h --- a/iaupdate/IAD/ui/inc/iaupdateengine.h Fri Jun 11 13:45:18 2010 +0300 +++ b/iaupdate/IAD/ui/inc/iaupdateengine.h Wed Jun 23 18:20:02 2010 +0300 @@ -150,6 +150,13 @@ * @param aError Error code */ void HandleLeaveErrorWithoutLeave( TInt aError ); + + /** + Called when UI to be redrawn during update process + * + * @param aError Error code + */ + void RefreshUI(); /** * Called when async update list refresh is completed @@ -241,7 +248,7 @@ */ static TInt AutomaticCheckCallbackL( TAny* aPtr ); - void DoPossibleApplicationClose(); + bool DoPossibleApplicationClose(); diff -r d17dc5398051 -r 92f864ef0288 iaupdate/IAD/ui/inc/iaupdatemainview.h --- a/iaupdate/IAD/ui/inc/iaupdatemainview.h Fri Jun 11 13:45:18 2010 +0300 +++ b/iaupdate/IAD/ui/inc/iaupdatemainview.h Wed Jun 23 18:20:02 2010 +0300 @@ -76,6 +76,7 @@ void constructDetailsText(MIAUpdateAnyNode &node, QString &text); void versionText(const TIAUpdateVersion &version, QString &versionText); void fileSizeText(int fileSize, QString &text); + void setImportance(MIAUpdateAnyNode *node, QString &importanceDescription); private: enum DialogState diff -r d17dc5398051 -r 92f864ef0288 iaupdate/IAD/ui/inc/iaupdatenodefilter.h --- a/iaupdate/IAD/ui/inc/iaupdatenodefilter.h Fri Jun 11 13:45:18 2010 +0300 +++ b/iaupdate/IAD/ui/inc/iaupdatenodefilter.h Wed Jun 23 18:20:02 2010 +0300 @@ -93,6 +93,16 @@ void SetDependenciesSelectedL( MIAUpdateNode& aNode, const RPointerArray& aAllNodes); + void StoreNodeListL( const RPointerArray< MIAUpdateNode >& aNodes); + + void RestoreNodeListL( RPointerArray< MIAUpdateNode >& aNodes) const; + + void SortSelectedNodesFirstL( const RPointerArray& aSelectedNodes, + RPointerArray< MIAUpdateNode >& aNodes ); + + void SortThisNodeFirstL( const MIAUpdateNode* aFirstNode, RPointerArray< MIAUpdateNode >& aNodes); + + private: CIAUpdateNodeFilter(); @@ -135,6 +145,8 @@ TBool iDmSupportAsked; TBool iDmSupport; + + RPointerArray< MIAUpdateNode > iStoredNodes; }; diff -r d17dc5398051 -r 92f864ef0288 iaupdate/IAD/ui/inc/iaupdateuicontroller.h --- a/iaupdate/IAD/ui/inc/iaupdateuicontroller.h Fri Jun 11 13:45:18 2010 +0300 +++ b/iaupdate/IAD/ui/inc/iaupdateuicontroller.h Wed Jun 23 18:20:02 2010 +0300 @@ -242,6 +242,13 @@ TBool ForcedRefresh() const; void SetForcedRefresh( TBool aForcedRefresh ); + + /** + * Set node list to normal state after update. + */ + void RefreshNodeList(); + + /** * Is client role "testing" * diff -r d17dc5398051 -r 92f864ef0288 iaupdate/IAD/ui/inc/iaupdateuicontrollerobserver.h --- a/iaupdate/IAD/ui/inc/iaupdateuicontrollerobserver.h Fri Jun 11 13:45:18 2010 +0300 +++ b/iaupdate/IAD/ui/inc/iaupdateuicontrollerobserver.h Wed Jun 23 18:20:02 2010 +0300 @@ -49,6 +49,13 @@ virtual void HandleLeaveErrorWithoutLeave( TInt aError ) = 0; /** + Called when UI to be redrawn during update process + * + * @param aError Error code + */ + virtual void RefreshUI() = 0; + + /** * Called when async update list refresh is completed * * @param aError Error code diff -r d17dc5398051 -r 92f864ef0288 iaupdate/IAD/ui/src/iaupdatedialogutil.cpp --- a/iaupdate/IAD/ui/src/iaupdatedialogutil.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/iaupdate/IAD/ui/src/iaupdatedialogutil.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -15,7 +15,7 @@ * member functions. * */ -#include +#include #include #include "iaupdatedialogutil.h" @@ -83,8 +83,11 @@ void IAUpdateDialogUtil::showAgreement(HbAction *primaryAction, HbAction *secondaryAction) { HbMessageBox *agreementDialog = new HbMessageBox(HbMessageBox::MessageTypeQuestion); + HbLabel *label = new HbLabel(agreementDialog); + label->setHtml(QString("Disclaimer")); + agreementDialog->setHeadingWidget(label); agreementDialog->setIconVisible(false); - agreementDialog->setText("This application allows you to download and use applications and services provided by Nokia or third parties. Service Terms and Privacy Policy will apply. Nokia will not assume any liability or responsibility for the availability or third party applications or services. Before using the third party application or service, read the applicable terms of use.\n\nUse of this application involves transmission of data. Contact your network service provider for information about data transmission charges.\n\n(c) 2007-2010 Nokia. All rights reserved."); + agreementDialog->setText("This application allows you to download and use applications and services provided by Nokia or third parties. Service Terms and Privacy Policy will apply. Nokia will not assume any liability or responsibility for the availability or third party applications or services. Before using the third party application or service, read the applicable terms of use.

Use of this application involves transmission of data. Contact your network service provider for information about data transmission charges.

(c) 2007-2010 Nokia. All rights reserved."); int actionCount = agreementDialog->actions().count(); for (int i=actionCount-1; i >= 0; i--) diff -r d17dc5398051 -r 92f864ef0288 iaupdate/IAD/ui/src/iaupdateengine.cpp --- a/iaupdate/IAD/ui/src/iaupdateengine.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/iaupdate/IAD/ui/src/iaupdateengine.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -390,7 +390,11 @@ } else { - DoPossibleApplicationClose(); + if (!DoPossibleApplicationClose()) + { + iController->RefreshNodeList(); + RefreshUI(); + } } break; case RebootQuery: @@ -405,7 +409,11 @@ } else { - DoPossibleApplicationClose(); + if (!DoPossibleApplicationClose()) + { + iController->RefreshNodeList(); + RefreshUI(); + } } break; case ShowUpdateQuery: @@ -550,6 +558,17 @@ // ----------------------------------------------------------------------------- +// IAUpdateEngine::RefreshUI +// +// ----------------------------------------------------------------------------- +// +void IAUpdateEngine::RefreshUI() + { + emit refresh( iController->Nodes(), iController->FwNodes(), KErrNone ); + } + + +// ----------------------------------------------------------------------------- // IAUpdateEngine::RefreshCompleteL // // ----------------------------------------------------------------------------- @@ -614,9 +633,7 @@ { InformRequestObserver( aError ); } - - emit refresh( iController->Nodes(), iController->FwNodes(), KErrNone ); - + ShowResultsDialogL(); IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::UpdateCompleteL end"); @@ -776,195 +793,182 @@ // from back ground checker, choose the IAP to make the internet access silent IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::SetDefaultConnectionMethodL() begin"); - uint connectionMethodId( 0 ); - int connMethodId( 0 ); + uint connectionMethodId( 0 ); + int connMethodId( 0 ); - // Let's first check whether cenrep contains SNAP id other than zero - CRepository* cenrep( CRepository::NewLC( KCRUidIAUpdateSettings ) ); - User::LeaveIfError( + // Let's first check whether cenrep contains SNAP id other than zero + CRepository* cenrep( CRepository::NewLC( KCRUidIAUpdateSettings ) ); + User::LeaveIfError( cenrep->Get( KIAUpdateAccessPoint, connMethodId ) ); - CleanupStack::PopAndDestroy( cenrep ); - cenrep = NULL; + CleanupStack::PopAndDestroy( cenrep ); + cenrep = NULL; - RCmManagerExt cmManagerExt; - cmManagerExt.OpenL(); - CleanupClosePushL( cmManagerExt ); + RCmManagerExt cmManagerExt; + cmManagerExt.OpenL(); + CleanupClosePushL( cmManagerExt ); - if ( connMethodId == -1 ) - { - IAUPDATE_TRACE("[IAUPDATE] user chooses default connection, use IAP logic"); + if ( connMethodId == -1 ) + { + IAUPDATE_TRACE("[IAUPDATE] user chooses default connection, use IAP logic"); - //check what is the default connection by users + //check what is the default connection by users - TCmDefConnValue DCSetting; - cmManagerExt.ReadDefConnL( DCSetting ); - + TCmDefConnValue DCSetting; + cmManagerExt.ReadDefConnL( DCSetting ); - switch ( DCSetting.iType ) - { - case ECmDefConnAlwaysAsk: - case ECmDefConnAskOnce: - { - //go with the best IAP under internet snap - connectionMethodId = GetBestIAPInAllSNAPsL( cmManagerExt ); - break; - } - case ECmDefConnDestination: - { - //go with the best IAP under this snap - connectionMethodId = GetBestIAPInThisSNAPL( cmManagerExt, DCSetting.iId ); - break; - } - case ECmDefConnConnectionMethod: - { - //go with the best IAP under this snap - connectionMethodId = DCSetting.iId; - break; - } - } - } - else if ( connMethodId == 0 ) - { - //no choice from user, we go with the best IAP under Internent SNAP - connectionMethodId = GetBestIAPInAllSNAPsL( cmManagerExt ); - } - else - { - IAUPDATE_TRACE("[IAUPDATE] use chooses a snap"); - // It was some SNAP value - connectionMethodId = GetBestIAPInThisSNAPL( cmManagerExt, connMethodId ); - } + switch ( DCSetting.iType ) + { + case ECmDefConnAlwaysAsk: + case ECmDefConnAskOnce: + { + //go with the best IAP under internet snap + connectionMethodId = GetBestIAPInAllSNAPsL( cmManagerExt ); + break; + } + case ECmDefConnDestination: + { + //go with the best IAP under this snap + connectionMethodId = GetBestIAPInThisSNAPL( cmManagerExt, DCSetting.iId ); + break; + } + case ECmDefConnConnectionMethod: + { + //go with the best IAP under this snap + connectionMethodId = DCSetting.iId; + break; + } + } + } + else if ( connMethodId == 0 ) + { + //no choice from user, we go with the best IAP under Internent SNAP + connectionMethodId = GetBestIAPInAllSNAPsL( cmManagerExt ); + } + else + { + IAUPDATE_TRACE("[IAUPDATE] use chooses a snap"); + // It was some SNAP value + connectionMethodId = GetBestIAPInThisSNAPL( cmManagerExt, connMethodId ); + } - CleanupStack::PopAndDestroy( &cmManagerExt ); + CleanupStack::PopAndDestroy( &cmManagerExt ); - if ( connectionMethodId != 0 ) - { - TIAUpdateConnectionMethod connectionMethod( + if ( connectionMethodId != 0 ) + { + TIAUpdateConnectionMethod connectionMethod( connectionMethodId, TIAUpdateConnectionMethod::EConnectionMethodTypeAccessPoint ); - iController->SetDefaultConnectionMethodL( connectionMethod ); - } - else - { - //In the totally silent case, if no usable IAP, we complete the check update with 0 updates. - //the bgchecker will try again later after 1 month. - //The LEAVE will be catched up later and complete the request from background checker. - User::LeaveIfError( KErrNotFound ); - - //the following code will pop up dialog to ask from user, just for proto - /* connectionMethodId = 0; - TIAUpdateConnectionMethod connectionMethod( - connectionMethodId, TIAUpdateConnectionMethod::EConnectionMethodTypeDefault ); - - iController->SetDefaultConnectionMethodL( connectionMethod );*/ - } - - - - IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::SetDefaultConnectionMethodL() end"); + iController->SetDefaultConnectionMethodL( connectionMethod ); + } + else + { + //In the totally silent case, if no usable IAP, we complete the check update with 0 updates. + //the bgchecker will try again later after 1 month. + //The LEAVE will be catched up later and complete the request from background checker. + User::LeaveIfError( KErrNotFound ); + } + IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::SetDefaultConnectionMethodL() end"); } else { // from grid, use the old logic IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::SetDefaultConnectionMethodL() begin"); - uint connectionMethodId( 0 ); - int connMethodId( 0 ); + uint connectionMethodId( 0 ); + int connMethodId( 0 ); - // Set initial value to always ask - int connectionMethodType( TIAUpdateConnectionMethod::EConnectionMethodTypeAlwaysAsk ); - bool needSaving(false); + // Set initial value to always ask + int connectionMethodType( TIAUpdateConnectionMethod::EConnectionMethodTypeAlwaysAsk ); + bool needSaving(false); - // Let's first check whether cenrep contains SNAP id other than zero - CRepository* cenrep( CRepository::NewLC( KCRUidIAUpdateSettings ) ); - User::LeaveIfError( + // Let's first check whether cenrep contains SNAP id other than zero + CRepository* cenrep( CRepository::NewLC( KCRUidIAUpdateSettings ) ); + User::LeaveIfError( cenrep->Get( KIAUpdateAccessPoint, connMethodId ) ); - CleanupStack::PopAndDestroy( cenrep ); - cenrep = NULL; + CleanupStack::PopAndDestroy( cenrep ); + cenrep = NULL; - if ( connMethodId == -1 ) - { - IAUPDATE_TRACE("[IAUPDATE] user chooses default connection, use IAP logic"); + if ( connMethodId == -1 ) + { + IAUPDATE_TRACE("[IAUPDATE] user chooses default connection, use IAP logic"); - connectionMethodId = 0; - connectionMethodType = TIAUpdateConnectionMethod::EConnectionMethodTypeDefault; - } - else if ( connMethodId == 0 ) - { - - IAUPDATE_TRACE("[IAUPDATE] use chooses nothing, use internal IAP logic"); - //if nothing is set by user, use our new logic - //SetDefaultConnectionMethod2L(); - //return; - // CenRep didn't contain any SNAP id. Let's try Internet SNAP then. + connectionMethodId = 0; + connectionMethodType = TIAUpdateConnectionMethod::EConnectionMethodTypeDefault; + } + else if ( connMethodId == 0 ) + { + IAUPDATE_TRACE("[IAUPDATE] use chooses nothing, use internal IAP logic"); + //if nothing is set by user, use our new logic + //SetDefaultConnectionMethod2L(); + //return; + // CenRep didn't contain any SNAP id. Let's try Internet SNAP then. - RCmManagerExt cmManagerExt; - cmManagerExt.OpenL(); - CleanupClosePushL( cmManagerExt ); - iDestIdArray.Reset(); - cmManagerExt.AllDestinationsL( iDestIdArray ); + RCmManagerExt cmManagerExt; + cmManagerExt.OpenL(); + CleanupClosePushL( cmManagerExt ); + iDestIdArray.Reset(); + cmManagerExt.AllDestinationsL( iDestIdArray ); - for ( int i = 0; i< iDestIdArray.Count(); i++ ) - { - RCmDestinationExt dest = cmManagerExt.DestinationL( iDestIdArray[i] ); - CleanupClosePushL( dest ); + for ( int i = 0; i< iDestIdArray.Count(); i++ ) + { + RCmDestinationExt dest = cmManagerExt.DestinationL( iDestIdArray[i] ); + CleanupClosePushL( dest ); - if ( dest.MetadataL( CMManager::ESnapMetadataInternet ) ) - { - // Check whether Internet SNAP contains any IAP. - if ( dest.ConnectionMethodCount() > 0 ) - { - connectionMethodId = iDestIdArray[i]; - needSaving = true; - IAUPDATE_TRACE_1("[IAUPDATE] connectionMethodId: %d", connectionMethodId ); - } - CleanupStack::PopAndDestroy( &dest ); - break; - } - - CleanupStack::PopAndDestroy( &dest ); - } - iDestIdArray.Reset(); - CleanupStack::PopAndDestroy( &cmManagerExt ); - } - else - { - IAUPDATE_TRACE("[IAUPDATE] use chooses a snap"); - // It was some SNAP value - connectionMethodId = connMethodId; - } + if ( dest.MetadataL( CMManager::ESnapMetadataInternet ) ) + { + // Check whether Internet SNAP contains any IAP. + if ( dest.ConnectionMethodCount() > 0 ) + { + connectionMethodId = iDestIdArray[i]; + needSaving = true; + IAUPDATE_TRACE_1("[IAUPDATE] connectionMethodId: %d", connectionMethodId ); + } + CleanupStack::PopAndDestroy( &dest ); + break; + } + + CleanupStack::PopAndDestroy( &dest ); + } + iDestIdArray.Reset(); + CleanupStack::PopAndDestroy( &cmManagerExt ); + } + else + { + IAUPDATE_TRACE("[IAUPDATE] use chooses a snap"); + // It was some SNAP value + connectionMethodId = connMethodId; + } - if ( connectionMethodId > 0) - { - // We have now some valid SNAP id, either from CenRep or Internet SNAP - connectionMethodType = TIAUpdateConnectionMethod::EConnectionMethodTypeDestination; - // Save to cenrep if needed - if ( needSaving ) - { - cenrep = CRepository::NewLC( KCRUidIAUpdateSettings ); - int err = cenrep->StartTransaction( CRepository::EReadWriteTransaction ); - User::LeaveIfError( err ); - cenrep->CleanupCancelTransactionPushL(); + if ( connectionMethodId > 0) + { + // We have now some valid SNAP id, either from CenRep or Internet SNAP + connectionMethodType = TIAUpdateConnectionMethod::EConnectionMethodTypeDestination; + // Save to cenrep if needed + if ( needSaving ) + { + cenrep = CRepository::NewLC( KCRUidIAUpdateSettings ); + int err = cenrep->StartTransaction( CRepository::EReadWriteTransaction ); + User::LeaveIfError( err ); + cenrep->CleanupCancelTransactionPushL(); - connMethodId = connectionMethodId; - err = cenrep->Set( KIAUpdateAccessPoint, connMethodId ); - User::LeaveIfError( err ); - TUint32 ignore = KErrNone; - User::LeaveIfError( cenrep->CommitTransaction( ignore ) ); - CleanupStack::PopAndDestroy(); // CleanupCancelTransactionPushL() - CleanupStack::PopAndDestroy( cenrep ); - } - } + connMethodId = connectionMethodId; + err = cenrep->Set( KIAUpdateAccessPoint, connMethodId ); + User::LeaveIfError( err ); + TUint32 ignore = KErrNone; + User::LeaveIfError( cenrep->CommitTransaction( ignore ) ); + CleanupStack::PopAndDestroy(); // CleanupCancelTransactionPushL() + CleanupStack::PopAndDestroy( cenrep ); + } + } - TIAUpdateConnectionMethod connectionMethod( + TIAUpdateConnectionMethod connectionMethod( connectionMethodId, static_cast< TIAUpdateConnectionMethod::TConnectionMethodType >( connectionMethodType ) ); - iController->SetDefaultConnectionMethodL( connectionMethod ); + iController->SetDefaultConnectionMethodL( connectionMethod ); - IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::SetDefaultConnectionMethodL() end"); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::SetDefaultConnectionMethodL() end"); } - } @@ -1210,18 +1214,24 @@ // IAUpdateEngine::DoPossibleApplicationClose() // --------------------------------------------------------------------------- // -void IAUpdateEngine::DoPossibleApplicationClose() +bool IAUpdateEngine::DoPossibleApplicationClose() { //exit from result view if there are no update left + bool toBeClosed = false; if ( iController->Nodes().Count() == 0 && iController->FwNodes().Count() == 0 ) { - qApp->quit(); + toBeClosed = true; } else if ( mStartedFromApplication && iController->ResultsInfo().iCountCancelled == 0 && iController->ResultsInfo().iCountFailed == 0 ) { + toBeClosed = true; + } + if ( toBeClosed ) + { qApp->quit(); } + return toBeClosed; } diff -r d17dc5398051 -r 92f864ef0288 iaupdate/IAD/ui/src/iaupdatemainview.cpp --- a/iaupdate/IAD/ui/src/iaupdatemainview.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/iaupdate/IAD/ui/src/iaupdatemainview.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include "iaupdatemainview.h" #include "iaupdateengine.h" @@ -108,233 +108,128 @@ void IAUpdateMainView::refresh( const RPointerArray &nodes, const RPointerArray &fwNodes, int /*error*/ ) - { +{ IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refresh begin"); mAllNodes.Reset(); - if ( fwNodes.Count() > 0 ) - { + if (fwNodes.Count() > 0) + { IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refresh hard code importance"); //hardcode the importance of firmware as Critical - for ( TInt i = 0; i < fwNodes.Count(); i++ ) - { - fwNodes[i]->Base().SetImportance( MIAUpdateBaseNode::ECritical ); - } + for (int i = 0; i < fwNodes.Count(); i++) + { + fwNodes[i]->Base().SetImportance(MIAUpdateBaseNode::ECritical); + } //either NSU or FOTA available - if ( fwNodes.Count() == 1 ) - { + if (fwNodes.Count() == 1) + { IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refresh either NSU or FOTA available"); - MIAUpdateAnyNode* node = fwNodes[0]; - mAllNodes.Append( node ); - } + MIAUpdateAnyNode *node = fwNodes[0]; + mAllNodes.Append(node); + } //both NSU and FOTA available, show only FOTA node - if ( fwNodes.Count() == 2 ) - { + if (fwNodes.Count() == 2) + { IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refresh both NSU and FOTA available"); - MIAUpdateAnyNode* node1 = fwNodes[0]; - MIAUpdateFwNode* fwnode = static_cast( node1 ); - if ( fwnode->FwType() == MIAUpdateFwNode::EFotaDp2 ) - { - mAllNodes.Append( node1 ); - } + MIAUpdateAnyNode *node1 = fwNodes[0]; + MIAUpdateFwNode *fwnode = static_cast(node1); + if (fwnode->FwType() == MIAUpdateFwNode::EFotaDp2) + { + mAllNodes.Append(node1); + } else - { + { MIAUpdateAnyNode* node2 = fwNodes[1]; - mAllNodes.Append( node2 ); - } + mAllNodes.Append(node2); } } + } - for( int i = 0; i < nodes.Count(); ++i ) - { - MIAUpdateAnyNode* node = nodes[i]; - mAllNodes.Append( node ); - } + for(int i = 0; i < nodes.Count(); ++i) + { + MIAUpdateAnyNode *node = nodes[i]; + mAllNodes.Append(node); + } mListView->clear(); QItemSelectionModel *selectionModel = mListView->selectionModel(); selectionModel->clear(); HbIcon icon(QString(":/icons/qgn_menu_swupdate")); - for( int j = 0; j < mAllNodes.Count(); ++j ) - { - MIAUpdateAnyNode* node = mAllNodes[j]; - int sizeInBytes = node->Base().ContentSizeL(); - - int size = 0; - TBool shownInMegabytes = EFalse; - if ( sizeInBytes >= KMaxShownInKiloBytes ) - { - shownInMegabytes = ETrue; - size = sizeInBytes / KMegaByte; - if ( sizeInBytes % KMegaByte != 0 ) - { - size++; - } - } - else - { - size = sizeInBytes / KKiloByte; - if ( sizeInBytes % KKiloByte != 0 ) - { - size++; - } - } - QString sizeString; - sizeString.setNum(size); + for(int j = 0; j < mAllNodes.Count(); ++j) + { + MIAUpdateAnyNode *node = mAllNodes[j]; + QString importanceDescription; - switch( node->Base().Importance() ) - { - case MIAUpdateBaseNode::EMandatory: - { - importanceDescription = "Required "; - importanceDescription.append(sizeString); - if ( shownInMegabytes ) - { - importanceDescription.append(" MB" ); - } - else - { - importanceDescription.append(" kB" ); - } - break; - } - - - case MIAUpdateBaseNode::ECritical: - { - bool isNSU = false; - if( node->NodeType() == MIAUpdateAnyNode::ENodeTypeFw ) - { - MIAUpdateFwNode* fwnode = static_cast( node ); - if ( fwnode->FwType() == MIAUpdateFwNode::EFotiNsu ) - { - isNSU = true; - } - } - - importanceDescription = "Important "; - if ( !size || isNSU ) - { - //for firmware when size info is not provided by server - } - else - { - importanceDescription.append(sizeString); - if ( shownInMegabytes ) - { - importanceDescription.append(" MB" ); - } - else - { - importanceDescription.append(" kB" ); - } - } - - break; - } + MIAUpdateNode::TUIUpdateState uiState = MIAUpdateNode::ENormal; + if (node->NodeType() == MIAUpdateAnyNode::ENodeTypeNormal) + { + MIAUpdateNode *updateNode = static_cast(node); + uiState = updateNode->UiState(); + } + if (uiState == MIAUpdateNode::ENormal) + { + setImportance(node, importanceDescription); + } + else + { + if(uiState == MIAUpdateNode::EUpdated) + { + importanceDescription = "Updated"; + } + else if(uiState == MIAUpdateNode::EFailed) + { + importanceDescription = "Failed"; + } + else if(uiState == MIAUpdateNode::EDownloaded) + { + importanceDescription = "Downloaded"; + } + } + - case MIAUpdateBaseNode::ERecommended: - { - importanceDescription = "Recommended "; - importanceDescription.append(sizeString); - if ( shownInMegabytes ) - { - importanceDescription.append(" MB" ); - } - else - { - importanceDescription.append(" kB" ); - } - break; - } - - case MIAUpdateBaseNode::ENormal: - { - importanceDescription = "Optional "; - importanceDescription.append(sizeString); - if ( shownInMegabytes ) - { - importanceDescription.append(" MB" ); - } - else - { - importanceDescription.append(" kB" ); - } - break; - } - - default: - { - break; - } + + HbListWidgetItem *item = new HbListWidgetItem(); + QString name; + if (node->NodeType() == MIAUpdateAnyNode::ENodeTypeNormal) + { + MIAUpdateNode *updateNode = static_cast(node); + if (updateNode->UiState() == MIAUpdateNode::EDownloading) + { + name = QString("Downloading "); + } + else if (updateNode->UiState() == MIAUpdateNode::EInstalling) + { + name = QString("Installing "); } - - //AknTextUtils::DisplayTextLanguageSpecificNumberConversion( ptr ); - - HbListWidgetItem *item = new HbListWidgetItem(); - QString name = XQConversions::s60DescToQString(node->Base().Name()); - if ( node->NodeType() == MIAUpdateAnyNode::ENodeTypeFw ) - { - name.append(" DEVICE SOFTWARE"); - } - item->setText(name); - item->setSecondaryText(importanceDescription); - item->setIcon(icon); - mListView->addItem(item); + } + name.append(XQConversions::s60DescToQString(node->Base().Name())); + if (node->NodeType() == MIAUpdateAnyNode::ENodeTypeFw) + { + name.append(" DEVICE SOFTWARE"); + } + item->setText(name); + item->setSecondaryText(importanceDescription); + item->setIcon(icon); + mListView->addItem(item); - if ( node->Base().IsSelected() ) - { - int count = mListView->count(); - QModelIndex modelIndex = mListView->model()->index(count-1,0); - selectionModel->select(modelIndex, QItemSelectionModel::Select); - } + if (node->Base().IsSelected()) + { + int count = mListView->count(); + QModelIndex modelIndex = mListView->model()->index(count-1,0); + selectionModel->select(modelIndex, QItemSelectionModel::Select); + } - - - /*if ( nodes.Count() == 0 ) - { - HBufC* emptyText = NULL; - if ( aError ) - { - if ( aError == KErrCancel || aError == KErrAbort ) - { - emptyText = KNullDesC().AllocLC(); - } - else - { - emptyText = StringLoader::LoadLC( R_IAUPDATE_REFRESH_FAILED ); - } - } - else - { - emptyText = StringLoader::LoadLC( R_IAUPDATE_TEXT_NO_UPDATES ); - } - - iListBox->View()->SetListEmptyTextL( *emptyText ); - CleanupStack::PopAndDestroy( emptyText ); - iListBox->ScrollBarFrame()->SetScrollBarVisibilityL( - CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff ); - } - else - { - if ( iListBox->CurrentItemIndex() == KErrNotFound ) - { - iListBox->SetCurrentItemIndex( aNodes.Count() - 1 ); - } - }*/ - - //iListBox->HandleItemAdditionL(); - } - connect(selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), + } + connect(selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(handleSelectionChanged(QItemSelection,QItemSelection))); - IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refresh end"); - } + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refresh end"); +} @@ -355,7 +250,7 @@ } } selectedNodes.Close(); - //mEngine->StartUpdate(firmwareUpdate); + mEngine->StartUpdate(firmwareUpdate); IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleStartUpdate() end"); } @@ -727,6 +622,11 @@ void IAUpdateMainView::showDependenciesFoundDialog(QString &text) { HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeQuestion); + HbLabel *label = new HbLabel(messageBox); + label->setHtml(QString("Depencencies")); + messageBox->setHeadingWidget(label); + //messageBox->setIconVisible(false); + messageBox->setText(text); int actionCount = messageBox->actions().count(); for (int i=actionCount-1; i >= 0; i--) @@ -782,20 +682,15 @@ void IAUpdateMainView::showDetails(MIAUpdateAnyNode& node) { HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation); + HbLabel *label = new HbLabel(messageBox); + label->setHtml(QString("Details")); + messageBox->setHeadingWidget(label); + messageBox->setIconVisible(false); QString text; constructDetailsText(node,text); messageBox->setText(text); - int actionCount = messageBox->actions().count(); - - for (int i=actionCount-1; i >= 0; i--) - { - messageBox->removeAction(messageBox->actions().at(i)); - } - HbAction *okAction = NULL; - okAction = new HbAction("Ok"); - messageBox->addAction(okAction); messageBox->setTimeout(HbPopup::NoTimeout); messageBox->setAttribute(Qt::WA_DeleteOnClose); mDialogState = Details; @@ -912,3 +807,113 @@ text.setNum(size); text.append(stringUnit); } + +void IAUpdateMainView::setImportance(MIAUpdateAnyNode *node, QString &importanceDescription) +{ + int sizeInBytes = node->Base().ContentSizeL(); + int size = 0; + bool shownInMegabytes = false; + if (sizeInBytes >= KMaxShownInKiloBytes) + { + shownInMegabytes = true; + size = sizeInBytes / KMegaByte; + if (sizeInBytes % KMegaByte != 0) + { + size++; + } + } + else + { + size = sizeInBytes / KKiloByte; + if (sizeInBytes % KKiloByte != 0) + { + size++; + } + } + QString sizeString; + sizeString.setNum(size); + switch(node->Base().Importance()) + { + case MIAUpdateBaseNode::EMandatory: + { + importanceDescription = "Required "; + importanceDescription.append(sizeString); + if (shownInMegabytes) + { + importanceDescription.append(" MB" ); + } + else + { + importanceDescription.append(" kB" ); + } + break; + } + + case MIAUpdateBaseNode::ECritical: + { + bool isNSU = false; + if(node->NodeType() == MIAUpdateAnyNode::ENodeTypeFw) + { + MIAUpdateFwNode *fwnode = static_cast(node); + if (fwnode->FwType() == MIAUpdateFwNode::EFotiNsu) + { + isNSU = true; + } + } + importanceDescription = "Important "; + if (!size || isNSU) + { + //for firmware when size info is not provided by server + } + else + { + importanceDescription.append(sizeString); + if (shownInMegabytes) + { + importanceDescription.append(" MB" ); + } + else + { + importanceDescription.append(" kB" ); + } + } + break; + } + + case MIAUpdateBaseNode::ERecommended: + { + importanceDescription = "Recommended "; + importanceDescription.append(sizeString); + if (shownInMegabytes) + { + importanceDescription.append(" MB" ); + } + else + { + importanceDescription.append(" kB" ); + } + break; + } + + case MIAUpdateBaseNode::ENormal: + { + importanceDescription = "Optional "; + importanceDescription.append(sizeString); + if (shownInMegabytes) + { + importanceDescription.append(" MB" ); + } + else + { + importanceDescription.append(" kB" ); + } + break; + } + + default: + { + break; + } + } +} + diff -r d17dc5398051 -r 92f864ef0288 iaupdate/IAD/ui/src/iaupdatenodefilter.cpp --- a/iaupdate/IAD/ui/src/iaupdatenodefilter.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/iaupdate/IAD/ui/src/iaupdatenodefilter.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -72,6 +72,7 @@ IAUPDATE_TRACE("[IAUPDATE] CIAUpdateNodeFilter::~CIAUpdateNodeFilter() begin"); delete iFilterParams; + iStoredNodes.Reset(); IAUPDATE_TRACE("[IAUPDATE] CIAUpdateNodeFilter::~CIAUpdateNodeFilter() end"); } @@ -421,7 +422,80 @@ IAUPDATE_TRACE("[IAUPDATE] CIAUpdateNodeFilter::SetDependenciesSelectedL() end"); } +// ----------------------------------------------------------------------------- +// CIAUpdateNodeFilter::StoreNodeListL +// +// ----------------------------------------------------------------------------- +// +void CIAUpdateNodeFilter::StoreNodeListL( const RPointerArray< MIAUpdateNode >& aNodes ) + { + IAUPDATE_TRACE("[IAUPDATE] CIAUpdateNodeFilter::StoreNodeListL() begin"); + iStoredNodes.Reset(); + for( TInt i = 0; i < aNodes.Count(); ++i ) + { + iStoredNodes.AppendL( aNodes[i] ); + } + IAUPDATE_TRACE("[IAUPDATE] CIAUpdateNodeFilter::StoreNodeListL() end"); + } +// ----------------------------------------------------------------------------- +// CIAUpdateNodeFilter::RestoreNodeListL +// +// ----------------------------------------------------------------------------- +// +void CIAUpdateNodeFilter::RestoreNodeListL( RPointerArray< MIAUpdateNode >& aNodes) const + { + IAUPDATE_TRACE("[IAUPDATE] CIAUpdateNodeFilter::RestoreNodeListL() begin"); + aNodes.Reset(); + for( TInt i = 0; i < iStoredNodes.Count(); ++i ) + { + aNodes.AppendL( iStoredNodes[i] ); + } + IAUPDATE_TRACE("[IAUPDATE] CIAUpdateNodeFilter::RestoreNodeListL() end"); + } + +// ----------------------------------------------------------------------------- +// CIAUpdateNodeFilter::SortSelectedNodesFirstL +// +// ----------------------------------------------------------------------------- +// +void CIAUpdateNodeFilter::SortSelectedNodesFirstL( + const RPointerArray& aSelectedNodes, + RPointerArray< MIAUpdateNode >& aNodes ) + { + for ( TInt i = aNodes.Count() - 1 ; i >= 0 ; --i ) + { + MIAUpdateNode* node( aNodes[ i ] ); + if ( node->Base().IsSelected() ) + { + aNodes.Remove( i ); + } + } + for ( TInt j = aSelectedNodes.Count() -1 ; j >= 0 ; --j ) + { + aNodes.InsertL( aSelectedNodes[j], 0 ); + } + } + +// ----------------------------------------------------------------------------- +// CIAUpdateNodeFilter::SortThisNodeFirstL +// +// ----------------------------------------------------------------------------- +// +void CIAUpdateNodeFilter::SortThisNodeFirstL( const MIAUpdateNode* aFirstNode, + RPointerArray< MIAUpdateNode >& aNodes) + { + TBool removed = EFalse; + for ( TInt i = aNodes.Count() - 1 ; i >= 0 && !removed ; --i ) + { + if ( aNodes[ i ] == aFirstNode ) + { + aNodes.Remove( i ); + removed = ETrue; + } + } + aNodes.InsertL( aFirstNode, 0 ); + } // ----------------------------------------------------------------------------- diff -r d17dc5398051 -r 92f864ef0288 iaupdate/IAD/ui/src/iaupdateresultsdialog.cpp --- a/iaupdate/IAD/ui/src/iaupdateresultsdialog.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/iaupdate/IAD/ui/src/iaupdateresultsdialog.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -19,9 +19,8 @@ // INCLUDE FILES -#include -#include -#include +#include +#include #include "iaupdateresultsdialog.h" #include "iaupdateresultsinfo.h" @@ -38,20 +37,22 @@ { } -void IAUpdateResultsDialog::showResults(const TIAUpdateResultsInfo ¶m, QObject* receiver, const char* member ) +void IAUpdateResultsDialog::showResults(const TIAUpdateResultsInfo ¶m, QObject *receiver, const char *member) { + HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation); + + HbLabel *label = new HbLabel(messageBox); + label->setHtml(QString("Update results")); + messageBox->setHeadingWidget(label); + + messageBox->setIconVisible(false); + QString buf; constructText(param,buf); - HbDialog *dialog = new HbDialog; - HbTextItem *text = new HbTextItem(dialog); - text->setFontSpec(HbFontSpec(HbFontSpec::Primary)); - text->setText(buf); - dialog->setContentWidget(text); - HbAction *primaryAction = new HbAction("Ok"); - dialog->addAction(primaryAction); - dialog->setTimeout(HbPopup::NoTimeout); - dialog->setAttribute(Qt::WA_DeleteOnClose); - dialog->open(receiver, member); + messageBox->setText(buf); + messageBox->setTimeout(HbPopup::NoTimeout); + messageBox->setAttribute(Qt::WA_DeleteOnClose); + messageBox->open(receiver, member); return; } @@ -69,7 +70,7 @@ stringCount.setNum(param.iCountSuccessfull); buf.append(stringCount); buf.append(" updates successful"); - buf.append("\n"); + buf.append("
"); return; } @@ -86,7 +87,7 @@ { buf.append(" applications updated"); } - buf.append("\n"); + buf.append("
"); } if (param.iCountCancelled != 0) @@ -102,7 +103,7 @@ { buf.append(" updates cancelled"); } - buf.append("\n"); + buf.append("
"); } if (param.iCountFailed != 0) @@ -118,13 +119,13 @@ { buf.append(" updates failed"); } - buf.append("\n"); + buf.append("
"); } if (param.iFileInUseError) { buf.append("Close all applications and try again."); - buf.append("\n"); + buf.append("
"); } } diff -r d17dc5398051 -r 92f864ef0288 iaupdate/IAD/ui/src/iaupdateuicontroller.cpp --- a/iaupdate/IAD/ui/src/iaupdateuicontroller.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/iaupdate/IAD/ui/src/iaupdateuicontroller.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -482,7 +482,12 @@ // controller can handle situations as a whole and not as one item at the // time. iController->StartingUpdatesL(); - + + //Store current node list before update + iFilter->StoreNodeListL( iNodes ); + + iFilter->SortSelectedNodesFirstL( iSelectedNodesArray, iNodes ); + iFileInUseError = EFalse; // Set the node index to -1 because ContinueUpdateL increases it by one // in the beginning of the function. So, we can use the ContinueUpdateL @@ -546,7 +551,8 @@ // Only update items that have not been installed yet. if ( !selectedNode->IsInstalled() ) { - IAUPDATE_TRACE("[IAUPDATE] Item not installed yet"); + IAUPDATE_TRACE("[IAUPDATE] Item not installed yet"); + iFilter->SortThisNodeFirstL( selectedNode, iNodes ); if ( !selectedNode->IsDownloaded() ) { // Because content has not been downloaded or installed yet, @@ -555,11 +561,8 @@ selectedNode->DownloadL( *this ); iState = EDownloading; iClosingAllowedByClient = ETrue; - selectedNode->SetDownloading( ETrue); - /*ShowUpdatingDialogL( R_IAUPDATE_DOWNLOADING_NOTE, - selectedNode->Base().Name(), - iNodeIndex + 1, - iSelectedNodesArray.Count() );*/ + selectedNode->SetUiState( MIAUpdateNode::EDownloading ); + iObserver.RefreshUI(); nextUpdate = EFalse; } else @@ -570,13 +573,8 @@ selectedNode->InstallL( *this ); iState = EInstalling; iClosingAllowedByClient = EFalse; - /*CIAUpdateAppUi* appUi = - static_cast< CIAUpdateAppUi* >( iEikEnv->EikAppUi() ); - appUi->StartWGListChangeMonitoring(); - ShowUpdatingDialogL( R_IAUPDATE_INSTALLING_NOTE, - selectedNode->Base().Name(), - iNodeIndex + 1, - iSelectedNodesArray.Count() ); */ + selectedNode->SetUiState( MIAUpdateNode::EInstalling ); + iObserver.RefreshUI(); nextUpdate = EFalse; } } @@ -610,14 +608,9 @@ aNode.InstallL( *this ); iState = EInstalling; - /*CIAUpdateAppUi* appUi = static_cast( iEikEnv->EikAppUi() ); - appUi->StartWGListChangeMonitoring(); - iClosingAllowedByClient = EFalse; - ShowUpdatingDialogL( R_IAUPDATE_INSTALLING_NOTE, - aNode.Base().Name(), - iNodeIndex + 1, - iSelectedNodesArray.Count() ); */ - + aNode.SetUiState( MIAUpdateNode::EInstalling ); + iObserver.RefreshUI(); + IAUPDATE_TRACE("[IAUPDATE] CIAUpdateUiController::StartInstallL() end"); } @@ -1937,10 +1930,16 @@ IAUPDATE_TRACE("[IAUPDATE] CIAUpdateUiController::InstallCompleteL() begin"); IAUPDATE_TRACE_1("[IAUPDATE] error code: %d", aError ); - // In release mode, we do not need the aError info, because - // success counters are counted by using the last operation error info - // when counter info is asked. In debug mode the error code is logged above. - (void)aError; + if ( aError == KErrNone ) + { + aNode.SetUiState( MIAUpdateNode::EUpdated ); + iObserver.RefreshUI(); + } + else + { + aNode.SetUiState( MIAUpdateNode::EFailed ); + iObserver.RefreshUI(); + } // pass UID of installed package to starter if ( iStarter ) @@ -1985,17 +1984,7 @@ iState = EIdle; iClosingAllowedByClient = EFalse; - - // Remove installed nodes from the node array. - for ( TInt i = iNodes.Count() - 1; i >= 0; --i ) - { - MIAUpdateNode* node = iNodes[ i ]; - if ( node->IsInstalled() ) - { - iNodes.Remove( i ); - } - } - + TInt error( aError ); TBool selfUpdaterStarted( EFalse ); @@ -2727,6 +2716,32 @@ } // --------------------------------------------------------------------------- +// CIAUpdateUiController::RefreshNodeList +// +// --------------------------------------------------------------------------- +// +void CIAUpdateUiController::RefreshNodeList() + { + // Restore list after update, that nodes are shown in original sequence + iFilter->RestoreNodeListL( iNodes ); + // Remove installed nodes from the node array. + // Set temp UI state to normal for remaining nodes + for ( TInt i = iNodes.Count() - 1; i >= 0; --i ) + { + MIAUpdateNode* node = iNodes[ i ]; + if ( node->IsInstalled() ) + { + iNodes.Remove( i ); + } + else + { + node->SetUiState( MIAUpdateNode::ENormal ); + } + } + } + + +// --------------------------------------------------------------------------- // CIAUpdateUiController::ParamsWriteFileL // // --------------------------------------------------------------------------- diff -r d17dc5398051 -r 92f864ef0288 installationservices/swi/bwins/uissclientU.DEF --- a/installationservices/swi/bwins/uissclientU.DEF Fri Jun 11 13:45:18 2010 +0300 +++ b/installationservices/swi/bwins/uissclientU.DEF Wed Jun 23 18:20:02 2010 +0300 @@ -97,7 +97,7 @@ ?UpdateProgressBarL@RUiHandler@Swi@@QAEXABVTAppInfo@2@H@Z @ 96 NONAME ; void Swi::RUiHandler::UpdateProgressBarL(class Swi::TAppInfo const &, int) ?NewL@CDisplayText@Swi@@SAPAV12@ABVTAppInfo@2@W4TFileTextOption@2@ABVTDesC8@@@Z @ 97 NONAME ; class Swi::CDisplayText * Swi::CDisplayText::NewL(class Swi::TAppInfo const &, enum Swi::TFileTextOption, class TDesC8 const &) ?NewLC@CDisplayText@Swi@@SAPAV12@ABVTAppInfo@2@W4TFileTextOption@2@ABVTDesC8@@@Z @ 98 NONAME ; class Swi::CDisplayText * Swi::CDisplayText::NewLC(class Swi::TAppInfo const &, enum Swi::TFileTextOption, class TDesC8 const &) - ?UpdateProgressBarValueL@CProgressBarValuePublisher@Swi@@QAEXH@Z @ 99 NONAME ; void Swi::CProgressBarValuePublisher::UpdateProgressBarValueL(int) + ?UpdateProgressBarValueL@CProgressBarValuePublisher@Swi@@QAEHH@Z @ 99 NONAME ; void Swi::CProgressBarValuePublisher::UpdateProgressBarValueL(int) ?SetFinalProgressBarValue@CProgressBarValuePublisher@Swi@@QAEXH@Z @ 100 NONAME ; void Swi::CProgressBarValuePublisher::SetFinalProgressBarValue(int) ?SetProgressBarValuePublisher@RUiHandler@Swi@@QAEXPAVCProgressBarValuePublisher@2@@Z @ 101 NONAME ; void Swi::RUiHandler::SetProgressBarValuePublisher(class Swi::CProgressBarValuePublisher *) ?NewL@CProgressBarValuePublisher@Swi@@SAPAV12@XZ @ 102 NONAME ; class Swi::CProgressBarValuePublisher * Swi::CProgressBarValuePublisher::NewL(void) diff -r d17dc5398051 -r 92f864ef0288 installationservices/swi/inc/progressbar.h --- a/installationservices/swi/inc/progressbar.h Fri Jun 11 13:45:18 2010 +0300 +++ b/installationservices/swi/inc/progressbar.h Wed Jun 23 18:20:02 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -31,11 +31,14 @@ const static TInt KProgressBarUninstallAmount=1; /// How many bytes to copy before updating the progress bar by one increment - const static TInt KProgressBarInstallChunkSize=32767; + const static TInt KProgressBarInstallChunkSize=1048576; //1MB /// The extra increment we add onto the end to make there always be some progress. const static TInt KProgressBarEndIncrement=1; + /// Percentage of completion required before updating the progress bar. + const static TInt KProgressBarIncrement=1; + /** * Utility function to get how much to update the progress bar for a certain * size of file copied. The smallest increment is KProgressBarEndIncrement since we always want to show that diff -r d17dc5398051 -r 92f864ef0288 installationservices/swi/inc/swi/sisuihandler.h --- a/installationservices/swi/inc/swi/sisuihandler.h Fri Jun 11 13:45:18 2010 +0300 +++ b/installationservices/swi/inc/swi/sisuihandler.h Wed Jun 23 18:20:02 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -835,7 +835,7 @@ IMPORT_C void SetFinalProgressBarValue(TInt aValue); /** Updates the value of the progress bar value property by adding the given value to the current value. */ - IMPORT_C void UpdateProgressBarValueL(TInt aValue); + IMPORT_C TInt UpdateProgressBarValueL(TInt aValue); private: CProgressBarValuePublisher(); @@ -844,6 +844,8 @@ private: TInt iCurrentProgressValue; TInt iFinalProgressValue; + TInt iLastPercentCompletion; + TInt iLastProgressValue; }; #endif diff -r d17dc5398051 -r 92f864ef0288 installationservices/swi/source/swis/server/installationplanner.cpp --- a/installationservices/swi/source/swis/server/installationplanner.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/installationservices/swi/source/swis/server/installationplanner.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -1150,27 +1150,27 @@ CleanupStack::PushL(targetFileName); TParsePtrC filename(*targetFileName); TBool isApparcFile = EFalse; - TBuf<10> extension = TParsePtrC(*targetFileName).Ext(); + HBufC* extension = TParsePtrC(*targetFileName).Ext().AllocLC(); - if(!extension.Compare(KApparcRegistrationFileExtn)) // for resource files *_reg.rsc or *.rsc + if(!extension->Compare(KApparcRegistrationFileExtn)) // for resource files *_reg.rsc or *.rsc { isApparcFile = ETrue; } else { - TInt extnLength = extension.Length(); + TInt extnLength = extension->Length(); HBufC* extn; if(extnLength == 4) //for localizable resource files with extn like .r01 { - extn = extension.Right(2).AllocLC(); + extn = extension->Right(2).AllocLC(); } else if(extnLength == 5) { - extn = extension.Right(3).AllocLC(); //for localizable resource files with extn like .r101 + extn = extension->Right(3).AllocLC(); //for localizable resource files with extn like .r101 } else { - CleanupStack::PopAndDestroy(targetFileName); + CleanupStack::PopAndDestroy(2, targetFileName); //extension continue; } @@ -1193,7 +1193,7 @@ listOfFilesToBeExtracted.AppendL(listOfFilesToBeAdded[i]); totalApplicationDataSize += listOfFilesToBeAdded[i]->UncompressedLength(); } - CleanupStack::PopAndDestroy(targetFileName); + CleanupStack::PopAndDestroy(2, targetFileName); //extension } //Here we do extraction of rsc files ,before extracting files we check if there is an enough space on the disk(C drive) @@ -1289,9 +1289,8 @@ } CleanupStack::PushL(appData); - TUid appuid = appData->AppUid(); - HBufC* appname = appData->AppFile().AllocLC(); - TBuf<100> finalAppName = TParsePtrC(*appname).NameAndExt(); + TUid appuid = appData->AppUid(); + HBufC* finalAppName = TParsePtrC(appData->AppFile()).NameAndExt().AllocLC(); const RPointerArray aLocalizableAppInfoList = appData->LocalizableAppInfoList(); HBufC* groupName = NULL; HBufC* iconFileName = NULL; @@ -1306,7 +1305,7 @@ DEBUG_PRINTF2(_L("Application Group Name %S"), groupName); } //Since locale does not exists no need to extract, create CNativeApplicationInfo without iconFileName - applicationInfo = Swi::CNativeComponentInfo::CNativeApplicationInfo::NewLC(appuid, finalAppName, groupName?*groupName:_L(""), _L("")); + applicationInfo = Swi::CNativeComponentInfo::CNativeApplicationInfo::NewLC(appuid, *finalAppName, groupName?*groupName:_L(""), _L("")); } else { @@ -1325,13 +1324,12 @@ iconFileName = captionAndIconInfo->IconFileName().AllocLC(); if(iconFileName != NULL) - { - TBuf<100> finalIconFileName; - finalIconFileName = TParsePtrC(*iconFileName).NameAndExt(); + { + HBufC* finalIconFileName = TParsePtrC(*iconFileName).NameAndExt().AllocLC(); _LIT(KIconFileNameFmt, "%c:\\resource\\install\\icon\\0x%08x\\%S"); // Applicaiton Uid iconFile.Format(KIconFileNameFmt, TUint(systemDrive), appuid.iUid, - &finalIconFileName); + finalIconFileName); TInt err = fs.MkDirAll(iconFile); if (err!= KErrNone && err != KErrAlreadyExists) @@ -1341,7 +1339,7 @@ for(TInt k = 0; k < listOfFilesToBeAdded.Count() ; k++) { currentFileDescription = listOfFilesToBeAdded[k]; - if(TParsePtrC(currentFileDescription->Target()).NameAndExt().Compare(finalIconFileName)) + if(TParsePtrC(currentFileDescription->Target()).NameAndExt().Compare(*finalIconFileName)) { break; } @@ -1386,22 +1384,22 @@ User::LeaveIfError(iSisHelper.ExtractFileL(fs, tempIconFile, listOfFilesToBeAdded[i]->Index(), application->AbsoluteDataIndex(), UiHandler())); DEBUG_PRINTF(_L8("Finished extracting Icon file successfuly")); //After copy the available disk space is reduced - currentAvailableDriveSpace -= fileSize; - CleanupStack::PopAndDestroy(2,iconFileName); //file,iconFileSize + currentAvailableDriveSpace -= fileSize; + CleanupStack::PopAndDestroy(3,iconFileName); //file,finalIconFileName,iconFileSize //Create CNativeApplicationInfo with iconFileName - applicationInfo = Swi::CNativeComponentInfo::CNativeApplicationInfo::NewLC(appuid, finalAppName, groupName?*groupName:_L(""), iconFile); + applicationInfo = Swi::CNativeComponentInfo::CNativeApplicationInfo::NewLC(appuid, *finalAppName, groupName?*groupName:_L(""), iconFile); } else { //Since iconFileName does not exists no need to extract, create CNativeApplicationInfo without iconName - applicationInfo = Swi::CNativeComponentInfo::CNativeApplicationInfo::NewLC(appuid, finalAppName, groupName?*groupName:_L(""), _L("")); + applicationInfo = Swi::CNativeComponentInfo::CNativeApplicationInfo::NewLC(appuid, *finalAppName, groupName?*groupName:_L(""), _L("")); } } } DEBUG_PRINTF2(_L("Application Uid 0x%08x"), appuid); - DEBUG_PRINTF2(_L("Application Name %S"), appname); + DEBUG_PRINTF2(_L("Application Name %S"), finalAppName); if(groupName) DEBUG_PRINTF2(_L("Application Group Name %S"), groupName); if(iconFile.Length()) @@ -1410,9 +1408,9 @@ const_cast (aController).AddApplicationInfoL(applicationInfo); CleanupStack::Pop(applicationInfo); if(groupName) - CleanupStack::PopAndDestroy(3, appData); //groupName,appName,appData + CleanupStack::PopAndDestroy(3, appData); //groupName,finalAppName,appData else - CleanupStack::PopAndDestroy(2, appData); //appName,appData + CleanupStack::PopAndDestroy(2, appData); //finalAppName,appData languages.Close(); } diff -r d17dc5398051 -r 92f864ef0288 installationservices/swi/source/swis/server/installationprocessor.cpp --- a/installationservices/swi/source/swis/server/installationprocessor.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/installationservices/swi/source/swis/server/installationprocessor.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -1236,7 +1236,7 @@ //if there are reg files in the package or if its an upgrade (in case of SA (with app) over SA(with no app)) if(iApparcRegFilesForParsing.Count() != 0 || application.IsUpgrade()) { - //Create the list of Application Uids which are affected by the Restore + //Create the list of Application Uids which are affected by the Installation RArray componentIds; CleanupClosePushL(componentIds); RArray newAppUids; @@ -1276,11 +1276,33 @@ { DEBUG_PRINTF2(_L("AppUid is 0x%x"), affectedApps[i].iAppUid); DEBUG_PRINTF2(_L("Action is %d"), affectedApps[i].iAction); - } - //const_cast(Plan()).ResetAffectedApps(); - const_cast(Plan()).SetAffectedApps(affectedApps); + } - CleanupStack::PopAndDestroy(2, &componentIds); + //Updating apps to be notified + RArray currentNotifiableApps; + CleanupClosePushL(currentNotifiableApps); + const_cast(Plan()).GetAffectedApps(currentNotifiableApps); + TInt appCount = affectedApps.Count(); + for(TInt k = 0; k < appCount ; ++k) + { + TInt count = currentNotifiableApps.Count(); + TUid appUid = affectedApps[k].iAppUid; + //compare the apps present in the package currently being processed with the existing set of affected apps, + //if alredy exists then update else add it to the list + for(TInt index = 0; index < count ; ++index) + { + if(appUid == currentNotifiableApps[index].iAppUid) + { + currentNotifiableApps.Remove(index); + } + } + currentNotifiableApps.AppendL(affectedApps[k]); + } + + const_cast(Plan()).ResetAffectedApps(); + const_cast(Plan()).SetAffectedApps(currentNotifiableApps); + + CleanupStack::PopAndDestroy(3, &componentIds); } CleanupStack::PopAndDestroy(&affectedApps); #endif diff -r d17dc5398051 -r 92f864ef0288 installationservices/swi/source/swis/server/restoreprocessor.cpp --- a/installationservices/swi/source/swis/server/restoreprocessor.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/installationservices/swi/source/swis/server/restoreprocessor.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -513,10 +513,29 @@ } } + //Compare the new affected apps with the existing affected apps and update the existing affected apps if alredy present or + //add to the list if it is a new app. + RArray existingAffectedApps; + CleanupClosePushL(existingAffectedApps); + const_cast(iPlan).GetAffectedApps(existingAffectedApps); + TInt appCount = affectedApps.Count(); + for(TInt k = 0; k < appCount ; ++k) + { + TInt count = existingAffectedApps.Count(); + TUid appUid = affectedApps[k].iAppUid; + for(TInt index = 0; index < count ; ++index) + { + if(appUid == existingAffectedApps[index].iAppUid) + { + existingAffectedApps.Remove(index); + } + } + existingAffectedApps.AppendL(affectedApps[k]); + } const_cast(iPlan).ResetAffectedApps(); const_cast(iPlan).SetAffectedApps(affectedApps); - CleanupStack::PopAndDestroy(2, &componentIds); + CleanupStack::PopAndDestroy(3, &componentIds); } #else diff -r d17dc5398051 -r 92f864ef0288 installationservices/swi/source/swis/server/uninstallationprocessor.cpp --- a/installationservices/swi/source/swis/server/uninstallationprocessor.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/installationservices/swi/source/swis/server/uninstallationprocessor.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -217,31 +217,27 @@ TAppUpdateInfo existingAppInfo, newAppInfo; TUid packageUid = application.PackageL().Uid(); - Plan().GetAffectedApps(affectedApps); - if(affectedApps.Count() == 0) + // Get all existing componentsIds for the package to to be uninstalled + TRAPD(err,iRegistryWrapper.RegistrySession().GetComponentIdsForUidL(packageUid, componentIds)); + TInt count = componentIds.Count(); + if(0 == count) { - // Get all existing componentsIds for the package to to be uninstalled - TRAPD(err,iRegistryWrapper.RegistrySession().GetComponentIdsForUidL(packageUid, componentIds)); - TInt count = componentIds.Count(); - if(0 == count) + DEBUG_PRINTF(_L("ComponentIDs not found for the base package")); + User::Leave(KErrNotFound); + } + + //Get the apps for CompIds and mark them as to be uninstalled + for(TInt i = 0 ; i < count; i++) + { + existingAppUids.Reset(); + TRAP(err,iRegistryWrapper.RegistrySession().GetAppUidsForComponentL(componentIds[i], existingAppUids)); + + for(TInt i = 0 ; i < existingAppUids.Count(); i++) { - DEBUG_PRINTF(_L("ComponentIDs not found for the base package")); - User::Leave(KErrNotFound); + existingAppInfo = TAppUpdateInfo(existingAppUids[i], EAppUninstalled); + affectedApps.Append(existingAppInfo); } - - //Get the apps for CompIds and mark them as to be upgraded - for(TInt i = 0 ; i < count; i++) - { - existingAppUids.Reset(); - TRAP(err,iRegistryWrapper.RegistrySession().GetAppUidsForComponentL(componentIds[i], existingAppUids)); - - for(TInt i = 0 ; i < existingAppUids.Count(); i++) - { - existingAppInfo = TAppUpdateInfo(existingAppUids[i], EAppUninstalled); - affectedApps.Append(existingAppInfo); - } - } - } + } // Now that we are ready to make changes to the registry so we start a transaction // Note that the commit/rollback action is subsequently taken by the later steps of the state machine @@ -249,28 +245,46 @@ iRegistryWrapper.RegistrySession().DeleteEntryL(ApplicationL().PackageL(), TransactionSession().TransactionIdL()); componentIds.Reset(); - TRAPD(err,iRegistryWrapper.RegistrySession().GetComponentIdsForUidL(packageUid, componentIds)); + TRAP(err,iRegistryWrapper.RegistrySession().GetComponentIdsForUidL(packageUid, componentIds)); TInt currentComponentCount = componentIds.Count(); //If there is no component assosiated with this app in the scr and there are affected apps then mark all of them as deleted. RArray apps; CleanupClosePushL(apps); Plan().GetAffectedApps(apps); - TInt appCount = apps.Count(); - CleanupStack::PopAndDestroy(); + TInt appCount = apps.Count(); + //If the there is no component assosiated with the package uid(ie it has been completely deleted) and we have affected apps + //then compare the apps of the package currently being processed with the existing affected apps if alredy exists then + //update else add it to the list. if(currentComponentCount == 0 && appCount) { - for(TInt i = 0 ; i < appCount; i++) - { - existingAppInfo = TAppUpdateInfo(affectedApps[0].iAppUid, EAppUninstalled); - affectedApps.Remove(0); - affectedApps.Append(existingAppInfo); - } + TInt count = affectedApps.Count(); + for(TInt i = 0 ; i < appCount; ++i) + { + TUid appUid = apps[i].iAppUid; + TBool found = EFalse; + for(TInt index = 0; index < count ; ++index) + { + if(appUid == affectedApps[index].iAppUid) + { + existingAppInfo = TAppUpdateInfo(appUid, EAppUninstalled); + affectedApps.Remove(index); + affectedApps.Append(existingAppInfo); + found = ETrue; + break; + } + } + if(!found) + { + existingAppInfo = TAppUpdateInfo(appUid,EAppUninstalled); + affectedApps.Append(existingAppInfo); + } + } } else { - // mark the apps in the sffected list as upgraded if they are still in scr + // mark the apps in the affected list as upgraded if they are still in scr for(TInt i = 0 ; i < currentComponentCount; i++) { newAppUids.Reset(); @@ -289,12 +303,13 @@ } } } - + CleanupStack::PopAndDestroy(&apps); for(TInt i = 0; i < affectedApps.Count(); i++) { DEBUG_PRINTF2(_L("AppUid is 0x%x"), affectedApps[i].iAppUid); DEBUG_PRINTF2(_L("Action is %d"), affectedApps[i].iAction); } + const_cast(Plan()).ResetAffectedApps(); const_cast(Plan()).SetAffectedApps(affectedApps); diff -r d17dc5398051 -r 92f864ef0288 installationservices/swi/source/uiss/client/sisuihandler.cpp --- a/installationservices/swi/source/uiss/client/sisuihandler.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/installationservices/swi/source/uiss/client/sisuihandler.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -30,7 +30,7 @@ #include "writestream.h" #include "swispubsubdefs.h" #include - +#include "progressbar.h" namespace Swi { @@ -61,23 +61,26 @@ { return; } - + TInt progressAmount = aAmount; + #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK _LIT(KProgressorPanicDescriptor, "UISSCLIENT:The progress bar value publisher has not been set!"); __ASSERT_ALWAYS(iPublisher, User::Panic(KProgressorPanicDescriptor,KErrAbort)); - iPublisher->UpdateProgressBarValueL(aAmount); + progressAmount = iPublisher->UpdateProgressBarValueL(aAmount); #endif - CHandleInstallEvent* event=CHandleInstallEvent::NewLC(aAppInfo, EEventUpdateProgressBar, aAmount, KNullDesC); - ExecuteL(*event); - - if (!event->ReturnResult()) - { - User::Leave(KErrCancel); - } - CleanupStack::PopAndDestroy(event); + if (progressAmount != 0) + { + CHandleInstallEvent* event=CHandleInstallEvent::NewLC(aAppInfo, EEventUpdateProgressBar, progressAmount, KNullDesC); + ExecuteL(*event); + + if (!event->ReturnResult()) + { + User::Leave(KErrCancel); + } + CleanupStack::PopAndDestroy(event); + } } - #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK EXPORT_C void RUiHandler::SetProgressBarValuePublisher(CProgressBarValuePublisher* aPublisher) { @@ -151,11 +154,19 @@ iFinalProgressValue = aValue; } -EXPORT_C void CProgressBarValuePublisher::UpdateProgressBarValueL(TInt aValue) +EXPORT_C TInt CProgressBarValuePublisher::UpdateProgressBarValueL(TInt aValue) { iCurrentProgressValue += aValue; TUint percentage = (iFinalProgressValue <= 0) ? 100 : (iCurrentProgressValue * 100) / iFinalProgressValue; - User::LeaveIfError(RProperty::Set(KUidInstallServerCategory, KUidSwiProgressBarValueKey, percentage)); + if ((percentage - iLastPercentCompletion) >= KProgressBarIncrement) + { + TInt amountCompleted = iCurrentProgressValue - iLastProgressValue; + iLastProgressValue = iCurrentProgressValue; + iLastPercentCompletion = percentage; + User::LeaveIfError(RProperty::Set(KUidInstallServerCategory, KUidSwiProgressBarValueKey, percentage)); + return amountCompleted; + } + return 0; } #endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK } // namespace Swi diff -r d17dc5398051 -r 92f864ef0288 ncdengine/debuglogger/group/catalogslogger.mmp --- a/ncdengine/debuglogger/group/catalogslogger.mmp Fri Jun 11 13:45:18 2010 +0300 +++ b/ncdengine/debuglogger/group/catalogslogger.mmp Wed Jun 23 18:20:02 2010 +0300 @@ -58,11 +58,7 @@ USERINCLUDE ../inc ../obex/inc // System include paths -#ifndef __SERIES60_30__ -APP_LAYER_SYSTEMINCLUDE -#else -SYSTEMINCLUDE /epoc32/include -#endif +MW_LAYER_SYSTEMINCLUDE LIBRARY euser.lib LIBRARY apparc.lib diff -r d17dc5398051 -r 92f864ef0288 ncdengine/engine/group/catalogsdebug.mmp --- a/ncdengine/engine/group/catalogsdebug.mmp Fri Jun 11 13:45:18 2010 +0300 +++ b/ncdengine/engine/group/catalogsdebug.mmp Wed Jun 23 18:20:02 2010 +0300 @@ -55,11 +55,7 @@ #endif // System include paths -#ifndef __SERIES60_30__ MW_LAYER_SYSTEMINCLUDE -#else -SYSTEMINCLUDE /Epoc32/include -#endif LIBRARY euser.lib flogger.lib hal.lib diff -r d17dc5398051 -r 92f864ef0288 ncdengine/engine/group/catalogsengine.mmp --- a/ncdengine/engine/group/catalogsengine.mmp Fri Jun 11 13:45:18 2010 +0300 +++ b/ncdengine/engine/group/catalogsengine.mmp Wed Jun 23 18:20:02 2010 +0300 @@ -48,12 +48,7 @@ USERINCLUDE ../../engine/inc // System include paths -#ifndef __SERIES60_30__ MW_LAYER_SYSTEMINCLUDE -#else -SYSTEMINCLUDE /Epoc32/include -#endif - LIBRARY euser.lib flogger.lib ecom.lib estor.lib diff -r d17dc5398051 -r 92f864ef0288 ncdengine/engine/group/catalogsproxy.mmp --- a/ncdengine/engine/group/catalogsproxy.mmp Fri Jun 11 13:45:18 2010 +0300 +++ b/ncdengine/engine/group/catalogsproxy.mmp Wed Jun 23 18:20:02 2010 +0300 @@ -169,11 +169,7 @@ USERINCLUDE ../../provider/deviceinteraction/inc // System include paths -#ifndef __SERIES60_30__ MW_LAYER_SYSTEMINCLUDE -#else -SYSTEMINCLUDE /epoc32/include -#endif SYSTEMINCLUDE /epoc32/include/libc diff -r d17dc5398051 -r 92f864ef0288 ncdengine/engine/group/catalogsserver.mmp --- a/ncdengine/engine/group/catalogsserver.mmp Fri Jun 11 13:45:18 2010 +0300 +++ b/ncdengine/engine/group/catalogsserver.mmp Wed Jun 23 18:20:02 2010 +0300 @@ -376,11 +376,7 @@ // System include paths -#ifndef __SERIES60_30__ APP_LAYER_SYSTEMINCLUDE -#else -SYSTEMINCLUDE /epoc32/include -#endif SYSTEMINCLUDE /epoc32/include/libc SYSTEMINCLUDE /epoc32/include/ecom diff -r d17dc5398051 -r 92f864ef0288 ncdengine/engine/group/catalogsundertaker.mmp --- a/ncdengine/engine/group/catalogsundertaker.mmp Fri Jun 11 13:45:18 2010 +0300 +++ b/ncdengine/engine/group/catalogsundertaker.mmp Wed Jun 23 18:20:02 2010 +0300 @@ -48,12 +48,7 @@ USERINCLUDE ../../engine/inc // System include paths -#ifndef __SERIES60_30__ MW_LAYER_SYSTEMINCLUDE -#else -SYSTEMINCLUDE /epoc32/include -#endif - LIBRARY euser.lib flogger.lib diff -r d17dc5398051 -r 92f864ef0288 ncdengine/engine/group/ncddevicemgmt.mmp --- a/ncdengine/engine/group/ncddevicemgmt.mmp Fri Jun 11 13:45:18 2010 +0300 +++ b/ncdengine/engine/group/ncddevicemgmt.mmp Wed Jun 23 18:20:02 2010 +0300 @@ -60,12 +60,7 @@ USERINCLUDE ../../provider/deviceinteraction/inc // System include paths -#ifndef __SERIES60_30__ MW_LAYER_SYSTEMINCLUDE -#else -SYSTEMINCLUDE /Epoc32/include -#endif - LIBRARY euser.lib estor.lib LIBRARY bafl.lib charconv.lib efsrv.lib // needed for ARMV5 building @@ -92,7 +87,9 @@ LIBRARY etel3rdparty.lib LIBRARY apgrfx.lib LIBRARY swinstcli.lib // Silent install -LIBRARY widgetregistryclient.lib // Widget Registry +LIBRARY sif.lib // SIF installer +LIBRARY scrclient.lib //Registry client +//LIBRARY widgetregistryclient.lib // Widget Registry // HLa - temporary java remove //#if defined( __SERIES60_30__ ) || defined( __SERIES60_31__ ) || defined( __S60_32__ ) diff -r d17dc5398051 -r 92f864ef0288 ncdengine/engine/group/ncdutils.mmp --- a/ncdengine/engine/group/ncdutils.mmp Fri Jun 11 13:45:18 2010 +0300 +++ b/ncdengine/engine/group/ncdutils.mmp Wed Jun 23 18:20:02 2010 +0300 @@ -61,12 +61,7 @@ USERINCLUDE ../../provider/server/inc // System include paths -#ifndef __SERIES60_30__ MW_LAYER_SYSTEMINCLUDE -#else -SYSTEMINCLUDE /Epoc32/include -#endif - LIBRARY euser.lib estor.lib LIBRARY bafl.lib charconv.lib efsrv.lib // needed for ARMV5 building diff -r d17dc5398051 -r 92f864ef0288 ncdengine/provider/deviceinteraction/inc/ncdinstallationserviceimpl.h --- a/ncdengine/provider/deviceinteraction/inc/ncdinstallationserviceimpl.h Fri Jun 11 13:45:18 2010 +0300 +++ b/ncdengine/provider/deviceinteraction/inc/ncdinstallationserviceimpl.h Wed Jun 23 18:20:02 2010 +0300 @@ -27,7 +27,9 @@ #include #include #include -#include +//#include +#include +#include #include "ncdinstallationservice.h" #include "ncditempurpose.h" @@ -36,25 +38,6 @@ #include "ncdwidgetregistrydata.h" -/** - * New Java registry API was introduced in 3.2. We start using it - * from 5.0 onwards because it seems that some 3.2 devices don't support - * it entirely - */ - - /* HLa - temporary java remove -#if defined( __SERIES60_30__ ) || defined( __SERIES60_31__ ) || defined ( __S60_32__ ) - #define USE_OLD_JAVA_API - class MJavaRegistrySuiteEntry; - class MJavaRegistry; -#else - namespace Java - { - class CJavaRegistry; - } -#endif -*/ - class CDocumentHandler; class MNcdInstallationServiceObserver; @@ -386,23 +369,6 @@ */ TBool IsRomApplication( const TUid& aUid ) const; - - /** - * Gets the UID of the latest installed midlet by using the - * Java installer's P&S key - * - * @param aJavaRegistry Java registry - * @return Midlet UID - */ - - /* HLa - temporary java remove -#ifdef USE_OLD_JAVA_API - TUid LatestMidletUidL( MJavaRegistry& aJavaRegistry ) const; -#else - TUid LatestMidletUidL( Java::CJavaRegistry& aJavaRegistry ) const; -#endif - */ - static TBool MatchJava( const TDesC& aMime ); TUid InstalledMidletUidL(); @@ -459,11 +425,6 @@ // When installing java with JAD, the JAD path is stored here HBufC* iJadFileName; -#ifdef USE_OLD_JAVA_API - // For comparing installed midlet uids to find out the uid for the newly - // installed java app. - RArray iMIDletUids; -#endif // Theme handling // Server session @@ -496,9 +457,10 @@ SwiUI::TServerRequest iCancelCode; - RWidgetRegistryClientSession iWidgetRegistry; + //RWidgetRegistryClientSession iWidgetRegistry; + Usif::RSoftwareComponentRegistry iScrSession; - RWidgetInfoArray iInstalledWidgets; + //RWidgetInfoArray iInstalledWidgets; RPointerArray iInstalledWidgetsInfos; }; diff -r d17dc5398051 -r 92f864ef0288 ncdengine/provider/deviceinteraction/inc/ncdwidgetregistrydata.h --- a/ncdengine/provider/deviceinteraction/inc/ncdwidgetregistrydata.h Fri Jun 11 13:45:18 2010 +0300 +++ b/ncdengine/provider/deviceinteraction/inc/ncdwidgetregistrydata.h Wed Jun 23 18:20:02 2010 +0300 @@ -20,7 +20,7 @@ // INCLUDES #include -#include +//#include //HLa: Widget registry remove #include "catalogsutils.h" // CONSTANTS @@ -44,7 +44,9 @@ inline CExtendedWidgetInfo() { iUid = TUid::Uid(0); - iVersion = HBufC::New( KWidgetRegistryVal + 1 ); + //HLa: Widget registry remove + //iVersion = HBufC::New( KWidgetRegistryVal + 1 ); + iVersion = HBufC::New( KMaxFileName + 1 ); } /** diff -r d17dc5398051 -r 92f864ef0288 ncdengine/provider/deviceinteraction/src/ncddeviceserviceimpl.cpp --- a/ncdengine/provider/deviceinteraction/src/ncddeviceserviceimpl.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/ncdengine/provider/deviceinteraction/src/ncddeviceserviceimpl.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -691,7 +691,7 @@ // Create buffer. HBufC* devId = HBufC::NewLC( modelVersion.Length() ); devId->Des().Append( modelVersion ); - DLTRACEOUT(( _L("devId: %S"), variantInfo )); + DLTRACEOUT(( _L("devId: %S"), devId )); return devId; #else // Get devId from CTelephony diff -r d17dc5398051 -r 92f864ef0288 ncdengine/provider/deviceinteraction/src/ncdinstallationserviceimpl.cpp --- a/ncdengine/provider/deviceinteraction/src/ncdinstallationserviceimpl.cpp Fri Jun 11 13:45:18 2010 +0300 +++ b/ncdengine/provider/deviceinteraction/src/ncdinstallationserviceimpl.cpp Wed Jun 23 18:20:02 2010 +0300 @@ -32,17 +32,6 @@ #include #include -/* HLa - temporary java remove -#ifdef USE_OLD_JAVA_API - #include - #include -#else - #include - #include - - using namespace Java; -#endif -*/ #include "ncdinstallationserviceobserver.h" #include "ncdactiveoperationobserver.h" #include "ncdsilentinstallactiveobserver.h" @@ -56,23 +45,7 @@ const TUint KFileOpenFlags = EFileShareReadersOrWriters; -/* HLa - temporary java remove -#ifdef __SERIES60_31__ - - const TInt32 KPSUidJavaLatestInstallation = KUidJmiLatestInstallation; - -#else - - // Defined originally in /mw/java/inc/javauids.h - // This should become available at some point in javadomainpskeys.h - //const TInt32 KPSUidJavaLatestInstallation = 0x10282567; - #include - -#endif -*/ - -// length taken from WidgetRegistryData.h -const TInt KWidgetBundleIdLength = KWidgetRegistryVal + 1; +const TInt KWidgetBundleIdLength = KMaxFileName + 1; // ======== CALLBACK FUNCTION ======== @@ -135,12 +108,6 @@ delete iJadFileName; delete iRecognizedMime; - /* HLa - temporary java remove -#ifdef USE_OLD_JAVA_API - iMIDletUids.Close(); -#endif - iApaLs.Close(); - */ if( iThemes ) { @@ -152,17 +119,7 @@ CancelInstall(); iRomUids.Close(); - if ( iWidgetRegistry.Handle() ) - { - // decreases widget server's refcount but this cannot be called - // if Connect has not been called or we'll get a KERN-EXEC 0 - iWidgetRegistry.Disconnect(); - } - else - { - iWidgetRegistry.Close(); - } - iInstalledWidgets.ResetAndDestroy(); + iScrSession.Close(); iInstalledWidgetsInfos.ResetAndDestroy(); } @@ -187,7 +144,8 @@ User::LeaveIfError( iFs.Connect() ); User::LeaveIfError( iFs.ShareProtected() ); User::LeaveIfError( iRegistrySession.Connect() ); - User::LeaveIfError( iAknsSrv.Connect() ); + User::LeaveIfError( iAknsSrv.Connect() ); + User::LeaveIfError( iScrSession.Connect()); iInstallationCompleteCallback = new(ELeave) CAsyncCallBack( TCallBack( InstallationCompleteCallback, this ), @@ -382,11 +340,6 @@ iJadFileName = NULL; } -#ifdef USE_OLD_JAVA_API - // Clean the array. - iMIDletUids.Reset(); -#endif - // Reset information flags. InstallationFinishedSetup( aError ); } @@ -518,55 +471,53 @@ // --------------------------------------------------------------------------- // -#ifdef USE_OLD_JAVA_API - -TBool CNcdInstallationService::JavaAppExistsL( - const TUid& aUid ) - { - - /* HLa - temporary java remove - DLTRACEIN(("")); - - MJavaRegistry* javaRegistry = MJavaRegistry::CreateL(); - CleanupReleasePushL( *javaRegistry ); - - TRAPD( err, - { - // Leaves with KErrNotFound if not found - MJavaRegistryMIDletEntry* midletEntry = javaRegistry->MIDletEntryL( - aUid ); - midletEntry->Release(); - }); - - LeaveIfNotErrorL( err, KErrNotFound ); - - CleanupStack::PopAndDestroy( javaRegistry ); - return err == KErrNone; - */ - - } - -#else - TBool CNcdInstallationService::JavaAppExistsL( const TUid& aUid ) { DLTRACEIN(("")); - /* HLa - temporary java remove - CJavaRegistry* javaRegistry = CJavaRegistry::NewLC(); - - TBool exists = javaRegistry->RegistryEntryExistsL( aUid ); + TBool retVal = EFalse; + Usif::TComponentId compId = 0; + + // Get component id + TRAPD( ret, compId = iScrSession.GetComponentIdForAppL( aUid ) ); + if ( ret == KErrNotFound ) + { + return EFalse; + } + else if (ret != KErrNone ) + { + User::Leave( ret ); + } + + Usif::CComponentEntry* entry = Usif::CComponentEntry::NewLC(); + TRAPD(err, iScrSession.GetComponentL(compId, *entry)); - CleanupStack::PopAndDestroy( javaRegistry ); - return exists; - */ - return EFalse; + if ( err == KErrNotFound ) + { + retVal = EFalse; + } + else if (err != KErrNone ) + { + User::Leave( err ); + } + else + { + // type == Java ? + if ( entry->SoftwareType().Compare( Usif::KSoftwareTypeJava ) == 0 ) + { + retVal = ETrue; + } + else + { + retVal = EFalse; + } + } + CleanupStack::PopAndDestroy(entry); + return retVal; } -#endif - // Check via widget registry API TNcdApplicationStatus CNcdInstallationService::IsWidgetInstalledL(const TDesC& aIdentifier, const TCatalogsVersion& aVersion) { @@ -989,9 +940,7 @@ if ( iInstallError != KErrNone ) { DLTRACE(("Notify install error")); -#ifdef USE_OLD_JAVA_API - iMIDletUids.Reset(); -#endif + iObserver->InstallationCompleteL( KNullDesC, TUid(), iInstallError ); return; } @@ -1528,17 +1477,6 @@ iInstallError = KErrNone; -#ifdef USE_OLD_JAVA_API - // Store installed java app uids before installation to see - // which one is a new java app later. - /* HLa - temporary java remove - MJavaRegistry* javaRegistry = MJavaRegistry::CreateL(); - CleanupReleasePushL( *javaRegistry ); - iMIDletUids.Reset(); - javaRegistry->InstalledMIDletUidsL( iMIDletUids ); - CleanupStack::PopAndDestroy( javaRegistry ); - */ -#endif // In platform security systems JAR and JAD has to be in same folder // to get the installation process work correctly. @@ -1922,34 +1860,39 @@ // Gets a list of installed midlet UIDs // --------------------------------------------------------------------------- // -#ifdef USE_OLD_JAVA_API void CNcdInstallationService::MidletUidsL( RArray& aUids ) { - /* HLa - temporary java remove - DLTRACEIN(("")); - MJavaRegistry* javaRegistry = MJavaRegistry::CreateL(); - CleanupReleasePushL( *javaRegistry ); - javaRegistry->InstalledMIDletUidsL( aUids ); - CleanupStack::PopAndDestroy( javaRegistry ); - */ - } -#else + // Get ids of all java components in scr + RArray javaComponentIdList; + CleanupClosePushL( javaComponentIdList ); + + Usif::CComponentFilter *pJavaSwTypeFilter = Usif::CComponentFilter::NewLC(); + pJavaSwTypeFilter->SetSoftwareTypeL( Usif::KSoftwareTypeJava ); + iScrSession.GetComponentIdsL( javaComponentIdList, pJavaSwTypeFilter ); + CleanupStack::PopAndDestroy( pJavaSwTypeFilter ); -void CNcdInstallationService::MidletUidsL( RArray& aUids ) - { - /* HLa - temporary java remove - DLTRACEIN(("")); - CJavaRegistry* javaRegistry = CJavaRegistry::NewLC(); - javaRegistry->GetRegistryEntryUidsL( aUids ); - CleanupStack::PopAndDestroy( javaRegistry ); - */ + + // Get components + TInt aUidIndex = 0; + for ( TInt i = 0; i < javaComponentIdList.Count(); ++i ) + { + RArray midletUids; + CleanupClosePushL( midletUids ); + iScrSession.GetAppUidsForComponentL( javaComponentIdList[i], midletUids ); + for ( TInt j = 0; j < midletUids.Count(); ++j ) + { + aUids[aUidIndex] = aUids[j]; + aUidIndex++; + } + CleanupStack::PopAndDestroy(); // midletUids + } + + CleanupStack::PopAndDestroy(); // javaComponentIdList + } -#endif - - // --------------------------------------------------------------------------- // Checks if the application is in ROM // --------------------------------------------------------------------------- @@ -1960,125 +1903,6 @@ return iRomUids.Find( aUid ) != KErrNotFound; } - -// --------------------------------------------------------------------------- -// Returns the UID of the latest installed midlet, NULL UID if none have -// been installed since the last device restart -// --------------------------------------------------------------------------- -// - -/* HLa - temporary java remove -#ifdef USE_OLD_JAVA_API - -TUid CNcdInstallationService::LatestMidletUidL( - MJavaRegistry& aJavaRegistry ) const - { - DLTRACEIN(("")); - TInt suiteUid = 0; - - // Get UID for the latest installed Midlet suite - // KPSUidJavaLatestInstallation = 0x10282567 - // Ignoring error in case the key or read policy change so that client - // doesn't behave strangely - RProperty::Get( KUidSystemCategory, - KPSUidJavaLatestInstallation, suiteUid ); - - DLTRACE(("JMI UID: %x", suiteUid )); - - if ( !suiteUid ) - { - return KNullUid; - } - - // Get entry for the installed suite - MJavaRegistrySuiteEntry* suite = aJavaRegistry.SuiteEntryL( - TUid::Uid( suiteUid ) ); - CleanupReleasePushL( *suite ); - RArray suiteUids; - CleanupClosePushL( suiteUids ); - - TUid midletUid = KNullUid; - suite->MIDletUidsL( suiteUids ); - - // Take first midlet UID from the suite - if ( suiteUids.Count() ) - { - midletUid = suiteUids[0]; - } - DLTRACE(("Midlets in suite: %d", suite->NumberOfMIDletsL() )); - CleanupStack::PopAndDestroy( &suiteUids ); - DLTRACE(("InstalledAppsEntryUid: %x", midletUid.iUid )); - - CleanupStack::PopAndDestroy( suite ); - return midletUid; - } - -#else - -TUid CNcdInstallationService::LatestMidletUidL( - CJavaRegistry& aJavaRegistry ) const - { - DLTRACEIN(("")); - TInt suiteUid = 0; - - // Get UID for the latest installed Midlet suite - // KPSUidJavaLatestInstallation = 0x10282567 - // Ignoring error in case the key or read policy change so that client - // doesn't behave strangely - RProperty::Get( KUidSystemCategory, - KPSUidJavaLatestInstallation, suiteUid ); - - DLTRACE(("JMI UID: %x", suiteUid )); - - if ( !suiteUid ) - { - return KNullUid; - } - - // Get entry for the installed suite - CJavaRegistryEntry* suite = aJavaRegistry.RegistryEntryL( - TUid::Uid( suiteUid ) ); - - if ( !suite ) - { - return KNullUid; - } - - CleanupStack::PushL( suite ); - - DASSERT( suite->Type() < EGeneralApplication && - suite->Type() >= EGeneralPackage ); - - CJavaRegistryPackageEntry* entry = - static_cast( suite ); - - TUid midletUid = KNullUid; - TInt count = entry->NumberOfEmbeddedEntries(); - TBool appFound = EFalse; - TInt index = 0; - - // Find the first application from the suite - while ( index < count && !appFound ) - { - CJavaRegistryEntry* app = entry->EmbeddedEntryByNumberL( index ); - if ( app->Type() >= EGeneralApplication ) - { - midletUid = app->Uid(); - appFound = ETrue; - DLTRACE(( "Found app: %x", midletUid.iUid )); - } - delete app; - ++index; - } - - CleanupStack::PopAndDestroy( suite ); - return midletUid; - } - - -#endif -*/ - // --------------------------------------------------------------------------- // Returns true if the MIME type matches a Java application or descriptor // --------------------------------------------------------------------------- @@ -2091,85 +1915,35 @@ } -#ifdef USE_OLD_JAVA_API TUid CNcdInstallationService::InstalledMidletUidL() { - - /* HLa - temporary java remove - DLTRACEIN(("")); - RArray MIDletUids; - CleanupClosePushL( MIDletUids ); + + Usif::COpaqueNamedParams* iResults = 0; // to be removed - MJavaRegistry* javaRegistry = MJavaRegistry::CreateL(); - CleanupReleasePushL( *javaRegistry ); - javaRegistry->InstalledMIDletUidsL( MIDletUids ); - TUid MIDletUid = KNullUid; - // Search for new uids in Java registry. - for ( TInt i = 0 ; i < MIDletUids.Count() ; i++ ) + RArray appUids; + TUid midletUid = KNullUid; + TInt compId = 0; + + // Get component id + TRAPD ( err, iResults->IntByNameL( Usif::KSifOutParam_ComponentId )); + if ( err == KErrNotFound ) { - if ( iMIDletUids.Find( MIDletUids[i] ) == KErrNotFound ) - { - // A new uid found, this is the installed midlet's uid - MIDletUid = MIDletUids[i]; - break; - } - } - - // We didn't get any new UID so we have to check Java installer's - // P&S key for the installed suite UID and the get the midlet UID - // from that. This happens when a midlet with predefined UID, - // eg. WidSets, is reinstalled. Midlet UIDs are predefined with - // the attribute Nokia-MIDlet-UID- in a JAD or JAR manifest - if ( MIDletUid == KNullUid ) - { - MIDletUid = LatestMidletUidL( *javaRegistry ); + return midletUid; } - CleanupStack::PopAndDestroy( javaRegistry ); - CleanupStack::PopAndDestroy( &MIDletUids ); - - iMIDletUids.Reset(); - return MIDletUid; - */ - - } - -#else // USE_OLD_JAVA_API - -TUid CNcdInstallationService::InstalledMidletUidL() - { - /* HLa - temporary java remove - DLTRACEIN(("")); - CJavaRegistry* registry = CJavaRegistry::NewLC(); - TUid midletUid = LatestMidletUidL( *registry ); - CleanupStack::PopAndDestroy( registry ); - return midletUid; - */ + // Get components + CleanupClosePushL( appUids ); + iScrSession.GetAppUidsForComponentL( compId, appUids ); - return KNullUid; - - } - -#endif // USE_OLD_JAVA_API - - -// --------------------------------------------------------------------------- -// Populates the list of installed widgets -// --------------------------------------------------------------------------- -// -void CNcdInstallationService::PopulateInstalledWidgetUidsL() - { - DLTRACEIN(("")); - - if ( !iWidgetRegistry.Handle() ) + // return first midlet uid, if exists + if ( appUids.Count() != 0 ) { - User::LeaveIfError( iWidgetRegistry.Connect() ); + midletUid = appUids[0]; } - - iInstalledWidgets.ResetAndDestroy(); - User::LeaveIfError( iWidgetRegistry.InstalledWidgetsL( iInstalledWidgets ) ); + CleanupStack::PopAndDestroy(); // appUids + return midletUid; } // --------------------------------------------------------------------------- @@ -2181,38 +1955,44 @@ { DLTRACEIN(("")); - // Get the list of installed widget uids - PopulateInstalledWidgetUidsL(); + // Get ids of all widget components in scr + RArray widgetComponentIdList; + Usif::CComponentFilter *pWidgetSwTypeFilter = Usif::CComponentFilter::NewLC(); + pWidgetSwTypeFilter->SetSoftwareTypeL(Usif::KSoftwareTypeWidget); + + iScrSession.GetComponentIdsL(widgetComponentIdList, pWidgetSwTypeFilter); - const TInt count = iInstalledWidgets.Count(); + CleanupStack::PopAndDestroy(pWidgetSwTypeFilter); + CleanupClosePushL(widgetComponentIdList); - // Create array with UID & Version infos + const TInt count = widgetComponentIdList.Count(); + + // Create array with id & version infos for ( TInt i = 0; i < count; ++i ) { CExtendedWidgetInfo* tempInfo = new ( ELeave ) CExtendedWidgetInfo(); CleanupStack::PushL( tempInfo ); - CWidgetInfo* widgetInfo = iInstalledWidgets[i]; + // Get widget + Usif::TComponentId compId = widgetComponentIdList[i]; + Usif::CComponentEntry* entry = Usif::CComponentEntry::NewLC(); + iScrSession.GetComponentL(compId, *entry); - CWidgetPropertyValue* version = iWidgetRegistry.GetWidgetPropertyValueL - (widgetInfo->iUid, EBundleVersion ); - CleanupStack::PushL( version ); - - // Fill info - tempInfo->iUid = widgetInfo->iUid; - if (!version->iValue.s) - *(tempInfo->iVersion) = KDefVersion; - else - *(tempInfo->iVersion) = *(version->iValue.s); + // Fill id & version + tempInfo->iUid.iUid= compId; + *(tempInfo->iVersion) = entry->Version(); // Append to arrayt aWidgets.AppendL( tempInfo ); - - CleanupStack::PopAndDestroy( version ); + + CleanupStack::PopAndDestroy(entry); CleanupStack::Pop( tempInfo ); } + + + CleanupStack::PopAndDestroy(); // widgetComponentIdList - DLTRACEOUT(("")); + DLTRACEOUT(("")); } @@ -2220,26 +2000,13 @@ // Gets the name of widget that was installed last // --------------------------------------------------------------------------- // + HBufC* CNcdInstallationService::InstalledWidgetNameLC() { DLTRACEIN(("")); - TUid widgetUid = InstalledWidgetUidL(); - - if ( widgetUid == KNullUid ) - { - DLERROR(("No widget uid")); - // No new UID was found, so we assume user canceled the installation. - // Installer does not give any error code in that case. - return NULL; - } - - HBufC* bundleId = HBufC::NewLC( KWidgetBundleIdLength ); - TPtr des( bundleId->Des() ); - iWidgetRegistry.GetWidgetBundleId( widgetUid, des ); - - DLTRACEOUT(( _L("Widget bundle id: %S"), bundleId )); - return bundleId; + // Not currently suported + return NULL; } @@ -2349,30 +2116,48 @@ // --------------------------------------------------------------------------- -// +//Calling widget registry API to check if a widget with given uid is installed +//already // --------------------------------------------------------------------------- // TBool CNcdInstallationService::WidgetExistsL( const TUid& aUid ) { DLTRACEIN(("")); - - if ( !iWidgetRegistry.Handle() ) - { - User::LeaveIfError( iWidgetRegistry.Connect() ); - } + + TBool retVal = EFalse; + + // Get entry + Usif::TComponentId compId = aUid.iUid; + Usif::CComponentEntry* entry = Usif::CComponentEntry::NewLC(); + TRAPD(err, iScrSession.GetComponentL(compId, *entry)); - if ( iWidgetRegistry.IsWidget( aUid ) ) + if ( err == KErrNotFound || !retVal ) + { + retVal = EFalse; + } + else if (err != KErrNone ) + { + User::Leave( err ); + } + else { - TBuf id; - iWidgetRegistry.GetWidgetBundleId( aUid, id ); - return iWidgetRegistry.WidgetExistsL( id ); + // widget ?? + if ( entry->SoftwareType().Compare( Usif::KSoftwareTypeWidget ) == 0 ) + { + retVal = ETrue; + } + else + { + retVal = EFalse; + } } - return EFalse; + CleanupStack::PopAndDestroy(entry); + return retVal; } // --------------------------------------------------------------------------- //Calling widget registry API to check if a widget with given uid is installed -//already +//already. Returns the version of the installed widget. // --------------------------------------------------------------------------- // TBool CNcdInstallationService::WidgetExistsL( @@ -2380,33 +2165,40 @@ { DLTRACEIN(("")); - if ( !iWidgetRegistry.Handle() ) + TBool retVal = EFalse; + + // Get entry + Usif::TComponentId compId = aUid.iUid; + Usif::CComponentEntry* entry = Usif::CComponentEntry::NewLC(); + TRAPD(err, retVal= iScrSession.GetComponentL(compId, *entry)); + + if ( err == KErrNotFound || !retVal ) { - User::LeaveIfError( iWidgetRegistry.Connect() ); + retVal = EFalse; } - - if ( iWidgetRegistry.IsWidget( aUid ) ) + else if (err != KErrNone ) { - TBuf id; - iWidgetRegistry.GetWidgetBundleId( aUid, id ); - if (iWidgetRegistry.WidgetExistsL( id )) + User::Leave( err ); + } + else + { + // widget ?? + if ( entry->SoftwareType().Compare( Usif::KSoftwareTypeWidget ) == 0 ) { + retVal = ETrue; + // Get version - CWidgetPropertyValue* version = - iWidgetRegistry.GetWidgetPropertyValueL(aUid, EBundleVersion ); - CleanupStack::PushL( version ); - TCatalogsVersion::ConvertL( aVersion, *(version->iValue.s) ); - CleanupStack::PopAndDestroy( version ); - return (ETrue); + TPtrC entryVersion = entry->Version(); + TCatalogsVersion::ConvertL( aVersion, entryVersion ); } else { - return (EFalse); + retVal = EFalse; } } - else - return(EFalse); - + CleanupStack::PopAndDestroy(entry); + return retVal; + } // --------------------------------------------------------------------------- @@ -2419,44 +2211,44 @@ { DLTRACEIN(("")); - if ( !iWidgetRegistry.Handle() ) - { - User::LeaveIfError( iWidgetRegistry.Connect() ); - } - - RPointerArray widgetInfoArr; + TBool retVal = EFalse; + Usif::TComponentId compId = 0; + + // Get widget component id by identifier + TRAPD( err, compId = + iScrSession.GetComponentIdL( aIdentifier, Usif::KSoftwareTypeWidget )); - CleanupResetAndDestroyPushL( widgetInfoArr ); - TInt err = iWidgetRegistry.InstalledWidgetsL(widgetInfoArr); - - for( TInt i( widgetInfoArr.Count() - 1 ); i >= 0; --i ) + if ( err == KErrNotFound ) + { + retVal = EFalse; + } + else if (err != KErrNone ) { - CWidgetInfo* widgetInfo( widgetInfoArr[i] ); - CWidgetPropertyValue* bundleId = - iWidgetRegistry.GetWidgetPropertyValueL - (widgetInfo->iUid, EBundleIdentifier ); - CleanupStack::PushL( bundleId ); + User::Leave( err ); + } + else + { + // Widget found + retVal = ETrue; - if( aIdentifier.Compare( *(bundleId->iValue.s) )== 0 ) + // Get entry + Usif::CComponentEntry* entry = Usif::CComponentEntry::NewLC(); + retVal = iScrSession.GetComponentL(compId, *entry); + + // Get version + if ( retVal ) { - CWidgetPropertyValue* version = - iWidgetRegistry.GetWidgetPropertyValueL - (widgetInfo->iUid, EBundleVersion ); - CleanupStack::PushL( version ); - TCatalogsVersion::ConvertL( aVersion, *(version->iValue.s) ); - - CleanupStack::PopAndDestroy( version ); - CleanupStack::PopAndDestroy( bundleId ); - CleanupStack::PopAndDestroy( &widgetInfoArr ); - - return ETrue; + TPtrC entryVersion = entry->Version(); + TCatalogsVersion::ConvertL( aVersion, entryVersion ); } - CleanupStack::PopAndDestroy( bundleId ); + + CleanupStack::PopAndDestroy(entry); } - CleanupStack::PopAndDestroy( &widgetInfoArr ); - return EFalse; + + return retVal; } + // --------------------------------------------------------------------------- // Calling widget registry API to return the Uid of the widget // with given identifier. @@ -2468,15 +2260,13 @@ TUid id = TUid::Uid(0); - if ( !iWidgetRegistry.Handle() ) - { - User::LeaveIfError( iWidgetRegistry.Connect() ); - } + Usif::TComponentId compId = iScrSession.GetComponentIdL(aIdentifier, Usif::KSoftwareTypeNative); - id.iUid = iWidgetRegistry.GetWidgetUidL( aIdentifier); - + id.iUid = compId; + return id; + } diff -r d17dc5398051 -r 92f864ef0288 package_definition.xml --- a/package_definition.xml Fri Jun 11 13:45:18 2010 +0300 +++ b/package_definition.xml Wed Jun 23 18:20:02 2010 +0300 @@ -1,41 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -79,23 +44,5 @@ - - - - - - - - - - - - - - - - - - diff -r d17dc5398051 -r 92f864ef0288 package_map.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/package_map.xml Wed Jun 23 18:20:02 2010 +0300 @@ -0,0 +1,2 @@ + + \ No newline at end of file