--- a/menucontentsrv/srvsrc/menusrvappscanner.cpp Wed Sep 15 12:32:36 2010 +0300
+++ b/menucontentsrv/srvsrc/menusrvappscanner.cpp Wed Oct 13 14:53:46 2010 +0300
@@ -73,8 +73,6 @@
{
Cancel();
delete iMcsSatNotifier;
- delete iSisInstallNotifier;
- delete iJavaInstallNotifier;
delete iNotifier;
iEng.DequeueOperation( *this );
delete iMmcHistory;
@@ -97,9 +95,9 @@
iCenRepNotifyHandlerCPHiddenFolders->StopListening();
}
delete iCenRepNotifyHandlerCPHiddenFolders;
- delete iCenRepSession;
- delete iFreeSpaceObserver;
- iInstalledPackages.Close();
+ delete iCenRepSession;
+ delete iFreeSpaceObserver;
+
}
// ---------------------------------------------------------
@@ -126,13 +124,13 @@
User::LeaveIfError( iFs.PrivatePath( path ) );
TUint attribute;
if( iFs.Att( path, attribute) == KErrNotFound )
- {
+ {
TInt mdRes = iFs.MkDirAll( path );
if ( mdRes != KErrNone )
- {
- User::Leave( mdRes );
- }
- }
+ {
+ User::Leave( mdRes );
+ }
+ }
iMmcHistory = new (ELeave) CMenuSrvMmcHistory();
iMmcHistory->LoadL( iFs, KMenuMmcHistoryFname() );
@@ -140,34 +138,30 @@
// it as argument... :(
iNotifier = CApaAppListNotifier::NewL( this, CActive::EPriorityStandard );
- iCenRepSession = CRepository::NewL( KCRUidMenu );
+ iCenRepSession = CRepository::NewL( KCRUidMenu );
- iCenRepNotifyHandlerHiddenApps = CCenRepNotifyHandler::NewL(
- *this, *iCenRepSession,
- CCenRepNotifyHandler::EStringKey, KMenuHideApplication );
- iCenRepNotifyHandlerCPHiddenApps = CCenRepNotifyHandler::NewL(
- *this, *iCenRepSession,
- CCenRepNotifyHandler::EStringKey, KMenuHideCPApplication );
-
- iCenRepNotifyHandlerCPHiddenFolders = CCenRepNotifyHandler::NewL(
- *this, *iCenRepSession,
- CCenRepNotifyHandler::EStringKey, KMenuHideCPFolder );
+ iCenRepNotifyHandlerHiddenApps = CCenRepNotifyHandler::NewL(
+ *this, *iCenRepSession,
+ CCenRepNotifyHandler::EStringKey, KMenuHideApplication );
+ iCenRepNotifyHandlerCPHiddenApps = CCenRepNotifyHandler::NewL(
+ *this, *iCenRepSession,
+ CCenRepNotifyHandler::EStringKey, KMenuHideCPApplication );
- iCenRepNotifyHandlerHiddenApps->StartListeningL();
- iCenRepNotifyHandlerCPHiddenApps->StartListeningL();
- iCenRepNotifyHandlerCPHiddenFolders->StartListeningL();
+ iCenRepNotifyHandlerCPHiddenFolders = CCenRepNotifyHandler::NewL(
+ *this, *iCenRepSession,
+ CCenRepNotifyHandler::EStringKey, KMenuHideCPFolder );
- iMcsSatNotifier = CMcsSatNotifier::NewL(
- this, KCRUidMenu, KMenuShowSatUI );
+ iCenRepNotifyHandlerHiddenApps->StartListeningL();
+ iCenRepNotifyHandlerCPHiddenApps->StartListeningL();
+ iCenRepNotifyHandlerCPHiddenFolders->StartListeningL();
- iFreeSpaceObserver = CMcsFreeSpaceObserver::NewL( *this );
+ iMcsSatNotifier = CMcsSatNotifier::NewL(
+ this, KCRUidMenu, KMenuShowSatUI );
- iSisInstallNotifier = CMcsInstallNotifier::NewL(
- *this, CMcsInstallNotifier::ESisInstallNotification );
- iJavaInstallNotifier = CMcsInstallNotifier::NewL(
- *this, CMcsInstallNotifier::EJavaInstallNotification );
+ iFreeSpaceObserver = CMcsFreeSpaceObserver::NewL( *this );
- ScheduleScan();
+ //SetActive();
+ ScheduleScan();
//iOpStatus = ETrue;
}
@@ -254,8 +248,7 @@
// CMenuSrvAppScanner::HideAppIfExists
// ---------------------------------------------------------
//
-void CMenuSrvAppScanner::HideItemIfPresentL(
- TInt aFolder, TInt aId, const TDesC& aUid, TBool aWasHidden )
+void CMenuSrvAppScanner::HideItemIfPresentL( TInt aFolder, TInt aId, const TDesC& aUid, TBool aWasHidden )
{
TBool hideItem = EFalse;
TMenuSrvAttrFilter uidAppFilter;
@@ -265,20 +258,21 @@
CleanupClosePushL( appItems );
iEng.GetItemsL( appItems, aFolder, &uidAppFilter, ETrue );
- for( TInt i=0; i < appItems.Count(); i++ )
+ for (TInt i=0; i < appItems.Count(); i++)
{
- if( appItems[i].Type() != KMenuTypeLink() )
- {
+ if(appItems[i].Type() != KMenuTypeLink())
+ {
const TMenuItem& item = appItems[i];
- TBool itemHidden = (0 != ( item.Flags() & TMenuItem::EHidden ) );
- TBool itemMissing = ( 0 != ( item.Flags() & TMenuItem::EMissing ) );
+ TBool itemHidden = (0 != (item.Flags() & TMenuItem::EHidden));
+ TBool itemMissing = (0 != (item.Flags() & TMenuItem::EMissing));
if ( !itemHidden && !itemMissing )
{
hideItem = ETrue;
}
- }
+ }
}
+
SetHiddenFlagL( aId, aWasHidden, hideItem );
CleanupStack::PopAndDestroy( &appItems );
@@ -290,7 +284,7 @@
//
void CMenuSrvAppScanner::SetHiddenFlagL( TInt aId, TBool aWasHidden, TBool aHide )
{
- if ( aWasHidden != aHide )
+ if ( aWasHidden ^ aHide )
{
iEng.ModifiableObjectL( aId, RMenuNotifier::EItemsAddedRemoved ).
SetFlags( TMenuItem::EHidden, aHide );
@@ -316,7 +310,7 @@
for (TInt i=0; i < appItems.Count(); i++)
{
if(appItems[i].Id() != aId)
- {
+ {
exists = ETrue;
const TMenuItem& item = appItems[i];
@@ -326,7 +320,7 @@
{
showItem = ETrue;
}
- }
+ }
}
UpdateLinkL( aId, exists, showItem, itemMissing );
@@ -471,72 +465,6 @@
User::RequestComplete( ownStatus, KErrNone );
}
}
-
-// ---------------------------------------------------------
-//
-// ---------------------------------------------------------
-//
-void CMenuSrvAppScanner::InstallationNotifyL()
- {
- TBool isLegacy = iEng.GetOnceLegacyFormat();
- for( TInt i = iInstalledPackages.Count() - 1; i >= 0; i-- )
- {
- RArray<TMenuItem> mcsUidItems;
- CleanupClosePushL( mcsUidItems );
- GetMcsAppItemsL( isLegacy, iInstalledPackages[i].iUid, mcsUidItems );
- if( mcsUidItems.Count() )
- {
- iEng.ModifiableObjectL( mcsUidItems[0].Id() );
- iInstalledPackages.Remove( i );
- }
- CleanupStack::PopAndDestroy( &mcsUidItems );
- }
- }
-
-// ---------------------------------------------------------
-//
-// ---------------------------------------------------------
-//
-void CMenuSrvAppScanner::RemoveFromInstalledPackages( TUid aUid )
- {
- TInt appIndex = iInstalledPackages.Find( aUid );
- if( appIndex != KErrNotFound )
- {
- iInstalledPackages.Remove( appIndex );
- }
- }
-
-// ---------------------------------------------------------
-//
-// ---------------------------------------------------------
-//
-CMenuEngObject& CMenuSrvAppScanner::ModifiableObjectL( TUid aUid, TInt aId,
- TInt aEvent )
- {
- if( aEvent != RMenuNotifier::EItemsNone )
- {
- RemoveFromInstalledPackages( aUid );
- }
- return iEng.ModifiableObjectL( aId, aEvent );
- }
-
-// ---------------------------------------------------------
-//
-// ---------------------------------------------------------
-//
-void CMenuSrvAppScanner::HandleInstallNotifyL( TUid aUid,
- CMcsInstallNotifier::TNotificationType aNotificationType )
- {
- iInstalledPackages.AppendL( aUid );
- // when installing java, appscanner first gets notification from appArc,
- // and then it is notified with instal notifier(RProperty)
- // so we need another scan for java apps
- if( aNotificationType == CMcsInstallNotifier::EJavaInstallNotification )
- {
- ScheduleScan();
- }
- }
-
// ---------------------------------------------------------
// CMenuSrvAppScanner::RunMenuEngOperationL
// ---------------------------------------------------------
@@ -546,44 +474,43 @@
UpdateApplicationItemsL();
UpdateApplicationWithHideIfInstalledItemsL();
UpdateLinkItemsL();
- InstallationNotifyL();
iOpStatus = EFalse;
}
+
// ---------------------------------------------------------
// CMenuSrvAppScanner::UpdateApplicationItemL
// ---------------------------------------------------------
//
void CMenuSrvAppScanner::UpdateApplicationItemL(
- RArray<TMenuItem>& aMcsItems, const CMenuSrvAppAttributes& aApaItem,
- TUint aMmcId, TBool isLegacy)
+ RArray<TMenuItem>& aMcsItems, const CMenuSrvAppAttributes& aApaItem,
+ TUint aMmcId, TBool isLegacy)
{
RArray<TMenuItem> mcsUidItems;
CleanupClosePushL( mcsUidItems );
- TUid appUid = aApaItem.GetUid();
- GetMcsAppItemsL( isLegacy, appUid.iUid, mcsUidItems );
+ TUid appuid = aApaItem.GetUid();
+ GetMcsAppItemsL( isLegacy, appuid.iUid, mcsUidItems );
TBool isApaItemHidden( aApaItem.IsHidden() );
// This app is not in the menu, add it now.
// We don't add hidden items, there are too many of them!
// do not display Menu app
if ( !mcsUidItems.Count()
- && !isApaItemHidden
- && appUid != KMmUid3 )
+ && !isApaItemHidden
+ && appuid != KMmUid3 )
{
- if( appUid == KSatUid )
+ if( appuid == KSatUid )
{
if( CMcsSatHandler::CheckVisibility() )
- {
- AddAppItemL( aApaItem, aMmcId );
- }
+ {
+ AddAppItemL( aApaItem, aMmcId );
+ }
}
else
- {
- AddAppItemL( aApaItem, aMmcId );
- GetMcsAppItemsL( isLegacy, appUid.iUid, mcsUidItems );
- RemoveFromInstalledPackages( appUid );
- }
+ {
+ AddAppItemL( aApaItem, aMmcId );
+ GetMcsAppItemsL( isLegacy, appuid.iUid, mcsUidItems );
+ }
}//if
// if there are any items with legacy UID format
@@ -592,12 +519,13 @@
{
//for every item with matching UID
for (TInt j=0; j < mcsUidItems.Count(); j++)
- {
+ {
+ CMenuEngObject& object =
+ iEng.ModifiableObjectL( mcsUidItems[j].Id() );
TBuf<KUidChars> uidString;
- MenuSrvUtil::UidToStringL( appUid.iUid, uidString, EFalse, EHex );
- ModifiableObjectL( appUid, mcsUidItems[j].Id() ).SetAttributeL(
- KMenuAttrUid(), uidString, EFalse );
- }//for
+ MenuSrvUtil::UidToStringL( appuid.iUid, uidString, EFalse, EHex );
+ object.SetAttributeL( KMenuAttrUid(), uidString, EFalse );
+ }//for
}//else if
// "hidden", "missing" and "lock_delete" flags update
for ( TInt j = 0; j < mcsUidItems.Count(); j++ )
@@ -607,24 +535,24 @@
//we need to handle first run of appscanner,
//there might be some incorrect data in content xml file
//if this will have impact on performance we may run this methods only at start up
- HandleMmcAttrUpdateL( item, aApaItem, aMmcId );
- HandleNativeAttrUpdateL( item, aApaItem );
+ HandleMmcAttrUpdateL( item, aApaItem, aMmcId );
+ HandleNativeAttrUpdateL( item, aApaItem );
// "hidden" flag handling.
HandleHiddenFlagUpdateL( item, aApaItem );
// "missing" flag handling
- HandleMissingFlagUpdateL( item, aApaItem );
+ HandleMissingFlagUpdateL( item );
//"lock_delete" flag handling
- HandleLockDeleteFlagUpdateL( item, aApaItem );
+ HandleLockDeleteFlagUpdateL(item, aApaItem );
// if item was just added to MCS it is not present in aMcsItems
// so we cannot remove it
TInt index = aMcsItems.Find( item, TIdentityRelation<TMenuItem>( IdMatch ) );
if ( index != KErrNotFound )
- {
- aMcsItems.Remove( index );
- }
+ {
+ aMcsItems.Remove( index );
+ }
}//for
CleanupStack::PopAndDestroy( &mcsUidItems );
}
@@ -635,40 +563,37 @@
//
void CMenuSrvAppScanner::HandleHiddenFlagUpdateL( const TMenuItem & aItem,
const CMenuSrvAppAttributes& aApaItem )
- {
- TBool itemHidden = ( 0 != ( aItem.Flags() & TMenuItem::EHidden ) );
- if( aApaItem.GetUid() == KSatUid )
- {
- if( itemHidden == CMcsSatHandler::CheckVisibility() )
- {
- ModifiableObjectL( aApaItem.GetUid(), aItem.Id(),
- RMenuNotifier::EItemsAddedRemoved ).SetFlags(
- TMenuItem::EHidden,
- !CMcsSatHandler::CheckVisibility() );
- }
- }
- else if( itemHidden != aApaItem.IsHidden() )
- {
- ModifiableObjectL( aApaItem.GetUid(), aItem.Id(),
- RMenuNotifier::EItemsAddedRemoved ).SetFlags(
- TMenuItem::EHidden, aApaItem.IsHidden() );
- }
- }
+ {
+ TBool itemHidden = (0 != (aItem.Flags() & TMenuItem::EHidden));
+ if ( aApaItem.GetUid() == KSatUid )
+ {
+ if (itemHidden == CMcsSatHandler::CheckVisibility())
+ {
+ iEng.ModifiableObjectL(aItem.Id(), RMenuNotifier::EItemsAddedRemoved).
+ SetFlags( TMenuItem::EHidden, !CMcsSatHandler::CheckVisibility());
+ }
+ }
+ else if ( itemHidden != aApaItem.IsHidden() )
+ {
+ iEng.ModifiableObjectL(aItem.Id(), RMenuNotifier::EItemsAddedRemoved).
+ SetFlags( TMenuItem::EHidden, aApaItem.IsHidden() );
+ }
+ }
// ---------------------------------------------------------
// CMenuSrvAppScanner::HandleNativeAttrUpdateL
// ---------------------------------------------------------
//
void CMenuSrvAppScanner::HandleNativeAttrUpdateL(
- const TMenuItem& aItem, const CMenuSrvAppAttributes& aApaItem )
- {
+ const TMenuItem& aItem, const CMenuSrvAppAttributes& aApaItem )
+ {
//we need this to delete uninstalled java app item
if( aApaItem.GetAppType() != iEng.ObjectL( aItem.Id() ).GetAppType() )
- {
- ModifiableObjectL( aApaItem.GetUid(), aItem.Id(),
- RMenuNotifier::EItemsNone ).SetAppType( aApaItem.GetAppType() );
- }
- }
+ {
+ iEng.ModifiableObjectL( aItem.Id(),
+ RMenuNotifier::EItemsNone ).SetAppType( aApaItem.GetAppType() );
+ }
+ }
// ---------------------------------------------------------
@@ -676,41 +601,31 @@
// ---------------------------------------------------------
//
void CMenuSrvAppScanner::HandleMmcAttrUpdateL(
- const TMenuItem& aItem, const CMenuSrvAppAttributes& aApaItem, TUint aMmcId )
- {
- TPtrC val;
- TBool dummy;
- TBool attributeExists = iEng.ObjectL( aItem.Id() ).FindAttribute(
- KMenuAttrMmcId(), val, dummy );
- if( IsInMmc( aApaItem ) )
- {
- //app is instaled on mmc - KMenuAttrMmcId attribute update
- TBuf<KUidChars> uidString;
+ const TMenuItem& aItem, const CMenuSrvAppAttributes& aApaItem, TUint aMmcId )
+ {
+ if ( IsInMmc( aApaItem ) )
+ {
+ //app is instaled on mmc - KMenuAttrMmcId attribute update
+ TBuf<KUidChars> uidString;
uidString.Format( KHexFormat, aMmcId );
- if( uidString.Compare( val ) )
- {
- ModifiableObjectL( aApaItem.GetUid(), aItem.Id() ).SetAttributeL(
- KMenuAttrMmcId, uidString, EFalse );
- }
- }
- else if( IsInMassStorage( aApaItem )
- && aApaItem.GetAppType() == CMenuEngObject::EWidgetApp )
- {
- //its java app installed on mass storage, we need to leave it in xml
- //in case of connecting usb in mass storage mode
- if( KMenuMassStorage().Compare( val ) )
- {
- ModifiableObjectL( aApaItem.GetUid(), aItem.Id() ).SetAttributeL(
- KMenuAttrMmcId, KMenuMassStorage, EFalse );
- }
- }
- else if( attributeExists )
- {
- //its installed on c: drive - remove attribute
- ModifiableObjectL( aApaItem.GetUid(), aItem.Id() ).RemoveAttribute(
- KMenuAttrMmcId );
- }
- }
+ iEng.ModifiableObjectL( aItem.Id(), RMenuNotifier::EItemsAddedRemoved ).
+ SetAttributeL( KMenuAttrMmcId, uidString, EFalse );
+ }
+ else if ( IsInMassStorage( aApaItem )
+ && aApaItem.GetAppType() == CMenuEngObject::EWidgetApp )
+ {
+ //its java app installed on mass storage, we need to leave it in xml
+ //in case of connecting usb in mass storage mode
+ iEng.ModifiableObjectL( aItem.Id(), RMenuNotifier::EItemsAddedRemoved ).
+ SetAttributeL( KMenuAttrMmcId, KMenuMassStorage, EFalse );
+ }
+ else
+ {
+ //its installed on c: drive - remove attribute
+ iEng.ModifiableObjectL( aItem.Id(), RMenuNotifier::EItemsAddedRemoved ).
+ RemoveAttribute( KMenuAttrMmcId );
+ }
+ }
// ---------------------------------------------------------
// CMenuSrvAppScanner::UpdateApplicationItemsL
// ---------------------------------------------------------
@@ -726,13 +641,14 @@
GetCrItemsL( iSrvEngUtils.GetAppItemsL() );
TBool isLegacy = iEng.GetOnceLegacyFormat();
+
//for every item in apaAndCrItems array
for ( TInt i = ( iSrvEngUtils.GetAppItemsL().Count() - 1 ); i >= 0 ; i-- )
{
// if there was leave for any item we ignore it
// and proceed to the next one
- TRAP_IGNORE( UpdateApplicationItemL( mcsItems,
- *iSrvEngUtils.GetAppItemsL()[i], currentMmcId, isLegacy ) );
+ TRAP_IGNORE(UpdateApplicationItemL(
+ mcsItems, *iSrvEngUtils.GetAppItemsL()[i], currentMmcId, isLegacy));
}
// Here the big list contains menu items that refer to missing apps.
HandleMissingItemsL( mcsItems );
@@ -744,44 +660,42 @@
// ---------------------------------------------------------
//
void CMenuSrvAppScanner::HandleLockDeleteFlagUpdateL(
- const TMenuItem& aItem, const CMenuSrvAppAttributes& aApaItem )
- {
- TBool isHidden = ( ( iEng.ObjectL( aItem.Id() )
- .Flags() & TMenuItem::EHidden ) != 0 );
- if ( !isHidden && IsInRomL( aApaItem ) )
- {
- if ( ( aItem.Flags() & TMenuItem::ELockDelete ) == 0 )
- {
- ModifiableObjectL( aApaItem.GetUid(), aItem.Id()).SetFlags(
- TMenuItem::ELockDelete, ETrue );
- }
- }
- else
- {
- if ( ( aItem.Flags() & TMenuItem::ELockDelete ) != 0 )
- {
- ModifiableObjectL( aApaItem.GetUid(), aItem.Id() ).SetFlags(
- TMenuItem::ELockDelete, EFalse );
- }
- }
- }
+ const TMenuItem& aItem, const CMenuSrvAppAttributes& aApaItem )
+ {
+ TBool isHidden = ( ( iEng.ObjectL( aItem.Id() )
+ .Flags() & TMenuItem::EHidden ) != 0 );
+ if ( !isHidden && IsInRomL( aApaItem ) )
+ {
+ if ( ( aItem.Flags() & TMenuItem::ELockDelete ) == 0 )
+ {
+ iEng.ModifiableObjectL(aItem.Id())
+ .SetFlags( TMenuItem::ELockDelete, ETrue );
+ }
+ }
+ else
+ {
+ if ( ( aItem.Flags() & TMenuItem::ELockDelete ) != 0 )
+ {
+ iEng.ModifiableObjectL(aItem.Id())
+ .SetFlags( TMenuItem::ELockDelete, EFalse );
+ }
+ }
+ }
// ---------------------------------------------------------
// CMenuSrvAppScanner::HandleMissingFlagUpdateL
// ---------------------------------------------------------
//
-void CMenuSrvAppScanner::HandleMissingFlagUpdateL(
- const TMenuItem& aItem, const CMenuSrvAppAttributes& aApaItem )
- {
- if ( aItem.Flags() & TMenuItem::EMissing )
+void CMenuSrvAppScanner::HandleMissingFlagUpdateL( const TMenuItem& aItem )
+ {
+ if ( aItem.Flags() & TMenuItem::EMissing )
{
CLOG_WRITE_FORMAT8( "Unsetting flag EMissing on %d", item.Id() );
//application found so we unset "missing" flag
- ModifiableObjectL( aApaItem.GetUid(), aItem.Id(),
- RMenuNotifier::EItemsAddedRemoved ).SetFlags(
- TMenuItem::EMissing, EFalse );
+ iEng.ModifiableObjectL( aItem.Id(), RMenuNotifier::EItemsAddedRemoved ).
+ SetFlags( TMenuItem::EMissing, EFalse );
}
- }
+ }
// ---------------------------------------------------------
// CMenuSrvAppScanner::GetCrItemsL
@@ -789,11 +703,11 @@
//
void CMenuSrvAppScanner::GetCrItemsL( RPointerArray<CMenuSrvAppAttributes>& aArray )
{
- TBuf<KCenRepBufferSize> buf;
- iCenRepSession->Get( KMenuHideCPApplication, buf );
- ParseUidsL( buf, aArray );// parses UIDs from buf and appends them to array
- iCenRepSession->Get( KMenuHideApplication, buf );
- ParseUidsL( buf, aArray );// parses UIDs from buf and appends them to array
+ TBuf<KCenRepBufferSize> buf;
+ iCenRepSession->Get( KMenuHideCPApplication, buf );
+ ParseUidsL( buf, aArray );// parses UIDs from buf and appends them to array
+ iCenRepSession->Get( KMenuHideApplication, buf );
+ ParseUidsL( buf, aArray );// parses UIDs from buf and appends them to array
}
// ---------------------------------------------------------
@@ -811,24 +725,26 @@
{
if( input.Peek() == ',')
{
- SetHiddenL(input.MarkedToken( startMark ), aArray);
+ SetHidden(input.MarkedToken( startMark ), aArray);
input.Inc();
input.Mark( startMark );
}
input.Inc();
notEmpty = ETrue;
}
- if ( notEmpty )
- {
- SetHiddenL( input.MarkedToken( startMark ), aArray );
- }
+ if ( notEmpty )
+ {
+ SetHidden(input.MarkedToken( startMark ), aArray);
+ }
+
+
}
// ---------------------------------------------------------
// CMenuSrvAppScanner::SetHidden
// ---------------------------------------------------------
//
-void CMenuSrvAppScanner::SetHiddenL(
+void CMenuSrvAppScanner::SetHidden(
const TDesC& aHiddenAppUid, RPointerArray<CMenuSrvAppAttributes>& aArray )
{
TLex appUidDescriptor(aHiddenAppUid);
@@ -950,23 +866,23 @@
// ---------------------------------------------------------
//
void CMenuSrvAppScanner::ScheduleScan()
- {
- if ( !IsActive() && !iOpStatus )
- {
- iOpStatus = ETrue;
- TRequestStatus* ownStatus = &iStatus;
- *ownStatus = KRequestPending;
- SetActive();
- User::RequestComplete( ownStatus, KErrNone );
- }
- }
+ {
+ if ( !IsActive() && !iOpStatus )
+ {
+ iOpStatus = ETrue;
+ TRequestStatus* ownStatus = &iStatus;
+ *ownStatus = KRequestPending;
+ SetActive();
+ User::RequestComplete( ownStatus, KErrNone );
+ }
+ }
// ---------------------------------------------------------
// CMenuSrvAppScanner::CreateInstallFolderL
// ---------------------------------------------------------
//
TInt CMenuSrvAppScanner::CreateInstallFolderL( const CMenuSrvAppAttributes& aApaItem )
- {
+ {
// Find a folder for this app.
TInt folder(0);
if ( aApaItem.GetGroupName().Length() )
@@ -985,7 +901,7 @@
iEng.RootFolderL( folder );
}
return folder;
- }
+ }
// ---------------------------------------------------------
// CMenuSrvAppScanner::AddAppItemL
@@ -1011,14 +927,14 @@
object->SetAttributeL( KMenuAttrMmcId, uidString, EFalse );
}
if( aApaItem.GetAppType() == CMenuEngObject::EWidgetApp )
- {
- //we need this to delete uninstalled java or wrt widget app item
- if ( !IsInMmc( aApaItem )
- && IsInMassStorage( aApaItem ) )
- {
- object->SetAttributeL( KMenuAttrMmcId, KMenuMassStorage, EFalse );
- }
- }
+ {
+ //we need this to delete uninstalled java or wrt widget app item
+ if ( !IsInMmc( aApaItem )
+ && IsInMassStorage( aApaItem ) )
+ {
+ object->SetAttributeL( KMenuAttrMmcId, KMenuMassStorage, EFalse );
+ }
+ }
object->SetAppType( aApaItem.GetAppType() );
EnsureFolderWritableL( folder );
iEng.AddL( *object, folder, 0 );
@@ -1041,12 +957,12 @@
TBool localized;
if ( rootObject.FindAttribute( KMenuAttrAppGroupName, groupName, localized ) &&
- groupName.Compare( aAppGroupName )==0 )
+ groupName.Compare( aAppGroupName )==0 )
{
folder = defaultFolderId;
}
else
- {
+ {
TMenuSrvTypeAttrFilter filter;
filter.SetType( KMenuTypeFolder() );
filter.SetAttr( KMenuAttrAppGroupName(), aAppGroupName );
@@ -1059,7 +975,7 @@
folder = items[0].Id();
}
CleanupStack::PopAndDestroy( &items );
- }
+ }
if ( !folder )
{
// No such folder, create it now.
@@ -1149,7 +1065,7 @@
else if( iEng.ObjectL( aItem.Id() ).GetAppType()
!= CMenuEngObject::EWidgetApp
|| iEng.ObjectL( aItem.Id() ).FindAttribute(
- KMenuAttrPredefined(), val, dummy ) )
+ KMenuAttrPredefined(), val, dummy ) )
{
flags = TMenuItem::EHidden;
}
@@ -1183,15 +1099,15 @@
// ---------------------------------------------------------
//
void CMenuSrvAppScanner::SetObjectFlagsL( TBool aFlagValue, const TMenuItem& aItem,
- const TMenuItem::TFlags& aFlag, const RMenuNotifier::TEvent& aEvent )
- {
- TBool itemFlagPresent = (0 != (aItem.Flags() & aFlag));
- if( aFlagValue != itemFlagPresent )
- {
- iEng.ModifiableObjectL( aItem.Id(), aEvent ).
- SetFlags( aFlag, aFlagValue );
- }
- }
+ const TMenuItem::TFlags& aFlag, const RMenuNotifier::TEvent& aEvent )
+ {
+ TBool itemFlagPresent = (0 != (aItem.Flags() & aFlag));
+ if( aFlagValue != itemFlagPresent )
+ {
+ iEng.ModifiableObjectL( aItem.Id(), aEvent ).
+ SetFlags( aFlag, aFlagValue );
+ }
+ }
// ---------------------------------------------------------
// CMenuSrvAppScanner::UpdateMmcHistoryL
@@ -1201,10 +1117,10 @@
{
TUint mmcId = CurrentMmcId();
if( mmcId )
- {
- iMmcHistory->InsertL( mmcId );
- iMmcHistory->SaveL( iFs, KMenuMmcHistoryFname() );
- }
+ {
+ iMmcHistory->InsertL( mmcId );
+ iMmcHistory->SaveL( iFs, KMenuMmcHistoryFname() );
+ }
return mmcId;
}
@@ -1219,7 +1135,7 @@
TInt mmcDrive;
TInt err;
err = DriveInfo::GetDefaultDrive(
- DriveInfo::EDefaultRemovableMassStorage, mmcDrive );
+ DriveInfo::EDefaultRemovableMassStorage, mmcDrive );
if ( !err )
{
TVolumeInfo volumeInfo;
@@ -1237,14 +1153,14 @@
// ---------------------------------------------------------
//
TBool CMenuSrvAppScanner::IsFileInDrive(
- const TDesC& aFileName,
- const DriveInfo::TDefaultDrives& aDefaultDrive ) const
+ const TDesC& aFileName,
+ const DriveInfo::TDefaultDrives& aDefaultDrive ) const
{
if ( aFileName.Length() )
{
TInt mmcDrive;
TInt err = DriveInfo::GetDefaultDrive(
- aDefaultDrive, mmcDrive );
+ aDefaultDrive, mmcDrive );
if ( !err )
{
TInt fileDrive;
@@ -1264,13 +1180,13 @@
//
TBool CMenuSrvAppScanner::IsAppInDrive(
const CMenuSrvAppAttributes& aApaItem,
- const DriveInfo::TDefaultDrives& aDefaultDrive ) const
+ const DriveInfo::TDefaultDrives& aDefaultDrive ) const
{
TBool ret( EFalse );
if ( IsFileInDrive( aApaItem.GetFullName(), aDefaultDrive ) )
- {
- ret = ETrue;
- }
+ {
+ ret = ETrue;
+ }
return ret;
}
@@ -1306,24 +1222,24 @@
// ---------------------------------------------------------
//
TBool CMenuSrvAppScanner::IsDriveInUse(
- const DriveInfo::TDefaultDrives& aDefaultDrive )
+ const DriveInfo::TDefaultDrives& aDefaultDrive )
{
TBool inUse( EFalse );
TInt drive;
TInt err = DriveInfo::GetDefaultDrive( aDefaultDrive, drive );
if( err == KErrNone )
- {
- TUint status;
- err = DriveInfo::GetDriveStatus( iFs, drive, status );
- if( err == KErrNone
- && ( status & DriveInfo::EDriveInUse ) )
- {
- inUse = ETrue;
- }
- }
+ {
+ TUint status;
+ err = DriveInfo::GetDriveStatus( iFs, drive, status );
+ if( err == KErrNone
+ && ( status & DriveInfo::EDriveInUse ) )
+ {
+ inUse = ETrue;
+ }
+ }
- return inUse;
+ return inUse;
}
// End of File