taskswitcher/utils/src/tsentrykeygenerator.cpp
changeset 124 e36b2f4799c0
parent 121 0b3699f6c654
child 125 26079c1bb561
equal deleted inserted replaced
121:0b3699f6c654 124:e36b2f4799c0
    18 
    18 
    19 // -----------------------------------------------------------------------------
    19 // -----------------------------------------------------------------------------
    20 //
    20 //
    21 // -----------------------------------------------------------------------------
    21 // -----------------------------------------------------------------------------
    22 //
    22 //
       
    23 TInt TsEntryKeyGeneraror::Generate( TTsEntryKey& aReturnKey, 
       
    24                                     TInt aWindowGroupId, 
       
    25                                     const MTsRunningApplicationStorage& aStorage)
       
    26 {
       
    27     for (TInt iter(0); iter < aStorage.Count(); ++iter) {
       
    28         if (aStorage[iter].WindowGroupId() == aWindowGroupId) {
       
    29             aReturnKey = TTsEntryKey( aWindowGroupId );
       
    30             if (aStorage[iter].WindowGroupId() == aStorage[iter].ParentWindowGroupId()) 
       
    31                 {
       
    32                 return KErrBadHandle;
       
    33                 }
       
    34             else if ( aStorage[iter].IsEmbeded() ) 
       
    35                 {
       
    36                 return TsEntryKeyGeneraror::Generate(aReturnKey, aStorage[iter].ParentWindowGroupId(), aStorage);
       
    37                 
       
    38                 }
       
    39             else 
       
    40                 {
       
    41                 return KErrNone;
       
    42                 }
       
    43         }
       
    44     }
       
    45     return KErrNotFound;
       
    46 }
       
    47 
       
    48 // -----------------------------------------------------------------------------
    23 TInt TsEntryKeyGeneraror::Generate(TTsEntryKey& returnKey, TInt windowGroupId, 
    49 TInt TsEntryKeyGeneraror::Generate(TTsEntryKey& returnKey, TInt windowGroupId, 
    24     const TArray<RWsSession::TWindowGroupChainInfo>& groupChain)
    50     const TArray<RWsSession::TWindowGroupChainInfo>& groupChain)
    25 {
    51 {
    26     for (TInt iter(0); iter < groupChain.Count(); ++iter) {
    52     for (TInt iter(0); iter < groupChain.Count(); ++iter) {
    27         if (groupChain[iter].iId == windowGroupId) {
    53         if (groupChain[iter].iId == windowGroupId) {
    37             }
    63             }
    38         }
    64         }
    39     }
    65     }
    40     return KErrNotFound;
    66     return KErrNotFound;
    41 }
    67 }
    42