messagingapp/msgappfw/server/src/ccsserver.cpp
changeset 37 518b245aa84c
parent 23 238255e8b033
equal deleted inserted replaced
25:84d9eb65b26f 37:518b245aa84c
    27 #include "ccssession.h"
    27 #include "ccssession.h"
    28 #include "ccsplugininterface.h"
    28 #include "ccsplugininterface.h"
    29 #include "ccsconversationevent.h"
    29 #include "ccsconversationevent.h"
    30 #include "ccsconversationcache.h"
    30 #include "ccsconversationcache.h"
    31 #include "ccscontactsmanager.h"
    31 #include "ccscontactsmanager.h"
    32 
    32 #include "ccsbackuphandler.h"
    33 //Costant Declaration
    33 //Costant Declaration
    34 
    34 
    35 // ============================== MEMBER FUNCTIONS ============================
    35 // ============================== MEMBER FUNCTIONS ============================
    36 
    36 
    37 // ----------------------------------------------------------------------------
    37 // ----------------------------------------------------------------------------
    61 // Constructor
    61 // Constructor
    62 // ----------------------------------------------------------------------------
    62 // ----------------------------------------------------------------------------
    63 CCsServer::CCsServer() :
    63 CCsServer::CCsServer() :
    64     CServer2(EPriorityLow)
    64     CServer2(EPriorityLow)
    65 {
    65 {
       
    66 }
       
    67 
       
    68 // ----------------------------------------------------------------------------
       
    69 // CCsServer::DeletePlugins
       
    70 // Unload the plugins for backup/restore
       
    71 // ----------------------------------------------------------------------------
       
    72 void CCsServer::DeletePlugins()
       
    73 {
       
    74     if (iConversationPlugin) {
       
    75         delete iConversationPlugin;
       
    76         iConversationPlugin = NULL;
       
    77     }
       
    78 }
       
    79 
       
    80 // ----------------------------------------------------------------------------
       
    81 // CCsServer::LoadPlugins
       
    82 // Load the plugins after a backup/restore
       
    83 // ----------------------------------------------------------------------------
       
    84 
       
    85 void CCsServer::LoadPlugins()
       
    86 {
       
    87     iConversationPlugin = CCsPluginInterface::NewL();
       
    88     // Create the plugin for the required entries
       
    89     iConversationPlugin->InstantiatePluginL(this);
       
    90     //fetch all initial set of messages
       
    91     iConversationPlugin->GetConversationsL();
       
    92     RefreshConversations();
    66 }
    93 }
    67 
    94 
    68 // ----------------------------------------------------------------------------
    95 // ----------------------------------------------------------------------------
    69 // CCsServer::ConstructL
    96 // CCsServer::ConstructL
    70 // Second phase constructor
    97 // Second phase constructor
    86     
   113     
    87     // create cache
   114     // create cache
    88     iConversationCache = CCsConversationCache::NewL(iContactsManager, this);
   115     iConversationCache = CCsConversationCache::NewL(iContactsManager, this);
    89 
   116 
    90     iCsCachingStatus = KCachingStatusUnknown;
   117     iCsCachingStatus = KCachingStatusUnknown;
    91 
   118 	
       
   119     iBackUpHandler = CCsBackUpHandler::NewL(*this);
       
   120     
    92     PRINT ( _L("End CCsServer::ConstructL") );
   121     PRINT ( _L("End CCsServer::ConstructL") );
    93 }
   122 }
    94 
   123 
    95 // ----------------------------------------------------------------------------
   124 // ----------------------------------------------------------------------------
    96 // CCsServer::~CCsServer
   125 // CCsServer::~CCsServer
   119     {
   148     {
   120         delete iContactsManager;
   149         delete iContactsManager;
   121         iContactsManager = NULL;
   150         iContactsManager = NULL;
   122     }
   151     }
   123 
   152 
       
   153 	if(iBackUpHandler)
       
   154 	{
       
   155 		delete iBackUpHandler;
       
   156 		iBackUpHandler = NULL;
       
   157 	}
   124     REComSession::FinalClose();
   158     REComSession::FinalClose();
   125 
   159 
   126     PRINT ( _L("End CCsServer::~CCsServer") );
   160     PRINT ( _L("End CCsServer::~CCsServer") );
   127 }
   161 }
   128 
   162