homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp
branchRCL_3
changeset 51 15e4dd19031c
parent 19 502e5d91ad42
child 59 a0713522ab97
--- a/homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp	Mon Mar 15 12:41:53 2010 +0200
+++ b/homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp	Wed Mar 31 22:04:35 2010 +0300
@@ -35,6 +35,7 @@
 #include "hspsdefinitionrepository.h"
 #include "hspsdefinitionengineinterface.h"
 #include "hspsconfiguration.h"
+#include "hspsfamily.h"
 #ifdef _hsps_PERFORMANCE_TEST_
 #include "hspstimemon.h"
 #endif //_hsps_PERFORMANCE_TEST_
@@ -316,7 +317,10 @@
     
     // Get active device language
     iDeviceLanguage = GetDeviceLanguage();
-            
+#ifdef HSPS_LOG_ACTIVE    
+    iLogBus->LogText( _L( "ChspsThemeServer::GetDeviceLanguage() %d" ), iDeviceLanguage );
+#endif
+
     // Setup a search mask for finding headers from the cache
     iCacheMask = ChspsODT::NewL();
 
@@ -345,10 +349,13 @@
     // Start observing the notifications
     iDefinitionRepository->RegisterObserverL( *this );
            
-	// Resolution & orientation change listener
+
 #if defined(WINSCW) || defined(__WINS__)
-    iFamilyListener = ChspsFamilyListener::NewL( *this );
-#endif // defined(WINSCW)    
+    // Resolution & orientation change listener
+    iFamily = ChspsFamilyListener::NewL( *this );
+#else 
+    iFamily = ChspsFamily::NewL();
+#endif //defined(WINSCW) || defined(__WINS__)
     
     // Auto-localize ODTs in the Definition Repository when the device language has changed
     HandleLanguageChangeL();            
@@ -440,11 +447,12 @@
     DisableAutoInstallation();
 #endif //__DISABLE_SISX_INSTALLATION_
 
-#if defined(WINSCW) || defined(__WINS__)    
-    delete iFamilyListener;
-    iFamilyListener = NULL;
-#endif // defined(WINSCW)    
-    
+    if ( iFamily )
+        {
+        delete iFamily;
+        iFamily = NULL;
+        }
+
     delete iCenRepListener;
     iCenRepListener = NULL;
     
@@ -515,7 +523,7 @@
 
 #ifdef HSPS_LOG_ACTIVE    
     iLogBus->LogText( _L( "ChspsThemeServer::AddSession(): - now %d concurrent sessions." ),
-            iSessionCount );
+        iSessions.Count() );
 #endif    
     }
 
@@ -544,7 +552,7 @@
 
 #ifdef HSPS_LOG_ACTIVE    
     iLogBus->LogText( _L( "ChspsThemeServer::DropSession(): - %d concurrent sessions left." ),
-            iSessionCount );
+        iSessions.Count() );
 #endif    
     }
   
@@ -1882,10 +1890,6 @@
 //
 TLanguage ChspsThemeServer::GetDeviceLanguage()
     {
-#ifdef HSPS_LOG_ACTIVE    
-    iLogBus->LogText( _L( "ChspsThemeServer::GetDeviceLanguage(): %d returned" ), User::Language() );
-#endif                    
-
     return User::Language();
     } 
 	
@@ -2757,7 +2761,7 @@
     // Activate client specific root configurations from active display resolution
     ActivateRootConfigurationsL();
 #endif // defined(WINSCW)    
-    
+
     res.Close();    
     CleanupStack::PopAndDestroy(1, &res); 
     }
@@ -3516,7 +3520,7 @@
 void ChspsThemeServer::ActivateRootConfigurationsL()
     {
     // Get family from the active resolution
-    const ThspsFamily family = iFamilyListener->GetFamilyType();
+    const ThspsFamily family = iFamily->GetFamilyType();
         
     // Try to activate an application configuration which was designed 
     // for the active resolution
@@ -3526,6 +3530,8 @@
         HandleFamilyChangeL( KDefaultFamily );
         }
     }
+#endif // defined(WINSCW) || defined(__WINS__)
+
 
 // -----------------------------------------------------------------------------
 // ChspsThemeServer::HandleFamilyChangeL()
@@ -3631,7 +3637,14 @@
     return activated;
     }
 
-#endif // defined(WINSCW)
+// -----------------------------------------------------------------------------
+// ChspsThemeServer::Family()
+// -----------------------------------------------------------------------------
+//
+ChspsFamily* ChspsThemeServer::Family()
+	{
+	return iFamily;
+	}
 
 // end of file