taskswitcher/contextengine/tsfswserver/engine/src/tsfswdatalist.cpp
branchRCL_3
changeset 38 79311d856354
parent 30 b8fae6b8a148
child 47 7be2816dbabd
equal deleted inserted replaced
34:d05a55b217df 38:79311d856354
   151 // --------------------------------------------------------------------------
   151 // --------------------------------------------------------------------------
   152 //
   152 //
   153 TBool CTsFswDataList::CollectTasksL()
   153 TBool CTsFswDataList::CollectTasksL()
   154     {
   154     {
   155     // clear dirty flag
   155     // clear dirty flag
       
   156     TBool changed = iTaskListDirty;
   156     iTaskListDirty = EFalse;
   157     iTaskListDirty = EFalse;
   157     TBool changed = EFalse;
       
   158     
   158     
   159     RTsFswArray newAppsList;
   159     RTsFswArray newAppsList;
   160     RTsFswArray newWidgetsList;
   160     RTsFswArray newWidgetsList;
   161     
   161     
   162     CleanupResetAndDestroyPushL(newAppsList);
   162     CleanupResetAndDestroyPushL(newAppsList);
   278 //
   278 //
   279 void CTsFswDataList::MoveEntryAtStart(TInt aAppId, TBool aWidget)
   279 void CTsFswDataList::MoveEntryAtStart(TInt aAppId, TBool aWidget)
   280     {
   280     {
   281     TSLOG_CONTEXT( MoveEntryAtStart, TSLOG_LOCAL );
   281     TSLOG_CONTEXT( MoveEntryAtStart, TSLOG_LOCAL );
   282     
   282     
       
   283     TInt appId(0);
       
   284     //check embeded case
       
   285     if( !aWidget )
       
   286     	{
       
   287 		TInt wgId(0);
       
   288 		CApaWindowGroupName::FindByAppUid(TUid::Uid(aAppId), iWsSession, wgId);
       
   289 		TInt parentWgId = FindMostTopParentWgId( wgId );
       
   290 		if( parentWgId != KErrNotFound )
       
   291 			{
       
   292 			TUid appUid = TUid::Uid(0);
       
   293 			AppUidForWgId(parentWgId, appUid); 
       
   294 			appId = appUid.iUid;
       
   295 			}
       
   296     	}
       
   297     
       
   298     if( !appId )
       
   299     	{
       
   300 		appId = aAppId;
       
   301     	}
       
   302  
   283     for ( TInt i = 0; i < iData.Count(); ++i )
   303     for ( TInt i = 0; i < iData.Count(); ++i )
   284         {
   304         {
   285         if( iData[i]->AppUid().iUid == aAppId && iData[i]->Widget() == aWidget)
   305         if( iData[i]->AppUid().iUid == appId && iData[i]->Widget() == aWidget)
   286             {
   306             {
   287             CTsFswEntry* entry = iData[i];
   307             CTsFswEntry* entry = iData[i];
   288             iData.Remove(i);
   308             iData.Remove(i);
   289             iData.Insert(entry, 0);
   309             iData.Insert(entry, 0);
   290             break;
   310             break;
   299 //
   319 //
   300 void CTsFswDataList::CollectAppsL(RTsFswArray& aAppsList)
   320 void CTsFswDataList::CollectAppsL(RTsFswArray& aAppsList)
   301     {
   321     {
   302     TSLOG_CONTEXT( CollectTasksL, TSLOG_LOCAL );
   322     TSLOG_CONTEXT( CollectTasksL, TSLOG_LOCAL );
   303     TSLOG_IN();
   323     TSLOG_IN();
   304     // clear dirty flag
       
   305     iTaskListDirty = EFalse;
       
   306     
   324     
   307     // update app data if needed
   325     // update app data if needed
   308     // (usually on startup and when new apps might have been installed)
   326     // (usually on startup and when new apps might have been installed)
   309     if ( iAppDataRefreshNeeded )
   327     if ( iAppDataRefreshNeeded )
   310         {
   328         {
   748         }
   766         }
   749     TSLOG_OUT();
   767     TSLOG_OUT();
   750     return exists;
   768     return exists;
   751     }
   769     }
   752 
   770 
       
   771 // --------------------------------------------------------------------------
       
   772 // CTsFswDataList::AppUidForWgIdL
       
   773 // --------------------------------------------------------------------------
       
   774 //
       
   775 TBool CTsFswDataList::IsAlwaysShownAppL( TInt aWgId )
       
   776 	{
       
   777 	return iAlwaysShownAppList->IsAlwaysShownApp( AppUidForWgIdL(aWgId) );
       
   778 	}
       
   779 
       
   780 // --------------------------------------------------------------------------
       
   781 // CTsFswDataList::AppUidForWgId
       
   782 // --------------------------------------------------------------------------
       
   783 //
       
   784 TInt CTsFswDataList::AppUidForWgId( TInt aWgId, TUid& aUid )
       
   785     {
       
   786 	TRAPD(err, aUid = AppUidForWgIdL( aWgId ) );
       
   787 	return err;
       
   788     }
       
   789 
       
   790 // --------------------------------------------------------------------------
       
   791 // CTsFswDataList::AppUidForWgIdL
       
   792 // --------------------------------------------------------------------------
       
   793 //
       
   794 TUid CTsFswDataList::AppUidForWgIdL( TInt aWgId )
       
   795     {
       
   796     CApaWindowGroupName* windowName =
       
   797         CApaWindowGroupName::NewLC( iWsSession, aWgId );
       
   798     TUid appUid = windowName->AppUid();
       
   799     CleanupStack::PopAndDestroy( windowName );
       
   800     return appUid;
       
   801     }
       
   802 
   753 // end of file
   803 // end of file