taskswitcher/utils/src/tsentrykeygenerator.cpp
changeset 124 e36b2f4799c0
parent 121 0b3699f6c654
child 125 26079c1bb561
--- a/taskswitcher/utils/src/tsentrykeygenerator.cpp	Fri Sep 17 08:32:18 2010 +0300
+++ b/taskswitcher/utils/src/tsentrykeygenerator.cpp	Mon Oct 04 00:38:31 2010 +0300
@@ -20,6 +20,32 @@
 //
 // -----------------------------------------------------------------------------
 //
+TInt TsEntryKeyGeneraror::Generate( TTsEntryKey& aReturnKey, 
+                                    TInt aWindowGroupId, 
+                                    const MTsRunningApplicationStorage& aStorage)
+{
+    for (TInt iter(0); iter < aStorage.Count(); ++iter) {
+        if (aStorage[iter].WindowGroupId() == aWindowGroupId) {
+            aReturnKey = TTsEntryKey( aWindowGroupId );
+            if (aStorage[iter].WindowGroupId() == aStorage[iter].ParentWindowGroupId()) 
+                {
+                return KErrBadHandle;
+                }
+            else if ( aStorage[iter].IsEmbeded() ) 
+                {
+                return TsEntryKeyGeneraror::Generate(aReturnKey, aStorage[iter].ParentWindowGroupId(), aStorage);
+                
+                }
+            else 
+                {
+                return KErrNone;
+                }
+        }
+    }
+    return KErrNotFound;
+}
+
+// -----------------------------------------------------------------------------
 TInt TsEntryKeyGeneraror::Generate(TTsEntryKey& returnKey, TInt windowGroupId, 
     const TArray<RWsSession::TWindowGroupChainInfo>& groupChain)
 {
@@ -39,4 +65,3 @@
     }
     return KErrNotFound;
 }
-