/** Loads the database system settings from the settings table. If the settings table does not exist then it is created with the default settings (the stored collation dll name will be empty and the stored database configuration file version will be 0). @param aDbName Logical database name: "main" for the main database or attached database name, @param aCollationDllName Output parameter, will contain the stored collation dll name, @param aDbConfigFileVersion Output parameter, will contain the stored database config file version. @param aCompactionMode Output parameter. Database compaction mode (one of TSqlCompactionMode enum item values except ESqlCompactionNotSet). Note that the input value of this parameter might be ESqlCompactionManual if the this is a legacy database, created not by the SQL server. @see TSqlCompactionMode @leave KErrNoMemory, an out of memory condition has occurred. Note that the function may also leave with some other database specific errors categorised as ESqlDbError, and other system-wide error codes.. @panic SqlDb 2 In _DEBUG mode if iDbHandle is NULL (uninitialized TSqlDbSysSettings object). @panic SqlDb 7 In _DEBUG mode if the stored compaction mode is invalid. */ void TSqlDbSysSettings::LoadSettingsL(const TDesC& aDbName, TDes& aCollationDllName, TInt& aDbConfigFileVersion, TSqlCompactionMode& aCompactionMode) { __ASSERT_DEBUG(iDbHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj)); aCollationDllName.Zero(); aDbConfigFileVersion = KSqlNullDbConfigFileVersion; if(aCompactionMode == ESqlCompactionNotSet) { aCompactionMode = KSqlDefaultCompactionMode; } //If the system settings table does not exist then create it now. //For a database created by the SQL Server this will only occur //when the database is being created in an application's private data cage - //as part of this create call it is now being opened by the server. //An externally created database is likely to not contain the settings table //and adding it here makes the database 'SQL Server-compatible' if(!SettingsTableExistsL(aDbName)) { StoreSettingsL(aDbName, aCollationDllName, KSqlNullDbConfigFileVersion, aCompactionMode); // store empty collation dll name, then reindexing will occur } else { //Get the settings from the existing table TInt settingsVersion = 0; GetSettingsL(aDbName, aCollationDllName, aDbConfigFileVersion, settingsVersion, aCompactionMode); if(settingsVersion < KSqlSystemVersion) { //Recreate the settings table using the last version number format (this is what the old code did during reindexing) StoreSettingsL(aDbName, aCollationDllName, aDbConfigFileVersion, aCompactionMode); // store empty collation dll name, then reindexing will occur } } __ASSERT_DEBUG(aCompactionMode == ESqlCompactionManual || aCompactionMode == ESqlCompactionBackground || aCompactionMode == ESqlCompactionAuto, __SQLPANIC(ESqlPanicInternalError)); }
void CLocaLogicImpl::ConstructL() { CALLSTACKITEM_N(_CL("CLocaLogicImpl"), _CL("ConstructL")); iDevStats=CDevStats::NewL(AppContext(), iDb); iMessageStats=CMessageStats::NewL(AppContext(), iDb); iRemote=CLocaRemoteEvents::NewL(AppContext(), this); iAcceptedMessages=CAcceptedMsgs::NewL(iDb); iBBSubSession=BBSession()->CreateSubSessionL(this); iBBSubSession->AddNotificationL(KLocaScriptTuple, ETrue); iEvent.iData.SetValue(&iMsgStatus); iEvent.iData.SetOwnsValue(EFalse); iEvent.iPriority()=CBBSensorEvent::VALUE; GetSettingsL(); Settings().NotifyOnChange(SETTING_LOCA_BLUEJACK_MAX_MESSAGES, this); Settings().NotifyOnChange(SETTING_LOCA_BLUEJACK_MAX_RETRIES, this); Settings().NotifyOnChange(SETTING_PUBLISH_AUTHOR, this); iInterpreter = CSPyInterpreter::NewInterpreterL(); iCC=CCnvCharacterSetConverter::NewL(); iCC->PrepareToConvertToOrFromL(KCharacterSetIdentifierIso88591, Fs()); iFunctions=new (ELeave) CDesC8ArraySeg(4); iErrorFunctions=new (ELeave) CDesC8ArraySeg(4); }
/* ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- */ void CMainContainer::ConstructL() { CreateWindowL(); iEcomHandler = CEcomHandler::NewL(this); iTimeOutTimer = CTimeOutTimer::NewL(CActive::EPriorityStandard,*this); GetSettingsL(); SetRect(CEikonEnv::Static()->EikAppUi()->ClientRect()); ActivateL(); SetMenuL(); DrawNow(); }
void CLocaLogicImpl::SettingChanged(TInt ) { GetSettingsL(); }