예제 #1
0
void  CSettingsManager::WriteVideoDataL( CMVSConfigVideoFormatDialog* aVideoFormatDlg,
						 				const TUid& aUid)
	{
	TStreamId controllerId;		
	RStoreWriteStream outstream;
	TBool existingController = IsControllerAvailableL(aUid,controllerId);
	OpenStore2WriteLC();	
	if(!existingController)
		{
		//if controller settings is not available create new stream
		controllerId = outstream.CreateLC(*iStore);		
		}
	else //open the existing for updation
		{
		outstream.ReplaceLC(*iStore,controllerId); 				
		}
	aVideoFormatDlg->ExternalizeL(outstream);
	outstream.CommitL();
	CleanupStack::PopAndDestroy();
	
    /*
    if there is no updation for controller i.e. new controller settings 
    is entered
    */
	if(!existingController)
		{
		outstream.ReplaceLC(*iStore,iRootId); 					
		WriteIndexL(outstream,aUid,controllerId);
		CleanupStack::PopAndDestroy();		
		}
	iStore->CommitL();
	CleanupStack::PopAndDestroy(); //for iStore	
	}
/**
This method is executed as the last step of a calendar file conversion.
Externalizes to the new file store the new CAgnEntryManager and CAgnModelStreamIdSet.
Calls ReplaceAgendaFile() to update the Model and its ServerFile with the products of the
conversion.
@internalComponent */
void CAgnCalendarConverter::CompleteConversionL()
	{
	// Copy iFileId and iNextUniqueIdValue to the Converter's output stream store
	//
	iAgnServerFile->Model()->ExternalizeFileIdL(*iOutputStreamStore, iOutModelStreamIdSet->FileInformationStreamId());
	iAgnServerFile->Model()->ExternalizeNextUidValuesL(*iOutputStreamStore, iOutModelStreamIdSet->NextLocalUidValueStreamId());
	iOutputStreamStore->CommitL();

	// Commit the streamIdSet and the EntryManager to the output store
	//
	RStoreWriteStream stream;
	stream.ReplaceLC(*iOutputStreamStore,iOutModelStreamIdSet->EntryManagerStreamId());
	stream << *iOutEntryManager;
	stream.CommitL();
	CleanupStack::PopAndDestroy();
	
	iOutModelStreamIdSet->CommitL(*iOutputStreamStore);
	iOutputStreamStore->CommitL();
	
	delete iDictionary;
	iDictionary = NULL;
	delete iOutputStreamStore;
	iOutputStreamStore = NULL;
	
	// Set new calendar file and dictionary in CAgnServFile
	// (this deletes the old file, and hands over the ownership of iOutputTzRuleIndex)
	//
	iAgnServerFile->ReplaceConvertedAgendaFileL(*iOutEntryManager, *iOutputTzRuleIndex);
	iOutputTzRuleIndex = NULL;
	}
예제 #3
0
void CSettingsManager::WriteGeneralSettingsL(CMVSAppUi* aAppUI)
	{	
	OpenStore2WriteLC();
	
	RStoreWriteStream outstream;
	/*
	if already there is stream id for general settings open the existing
	stream; otherwise create new stream id 
	*/
	TBool updation = iGenSettingsId.Value();
	if(updation)
		{
		outstream.ReplaceLC(*iStore,iGenSettingsId);
		}
	else
		{
		iGenSettingsId = outstream.CreateLC(*iStore);
		}
	
	//write the general settings
	aAppUI->ExternalizeL(outstream);
	outstream.CommitL();
	CleanupStack::PopAndDestroy();
	
	if(!updation)
		{
		outstream.ReplaceLC(*iStore,iStore->Root());
		TUid tempUid;
		TStreamId tempStreamId(0);
		WriteIndexL(outstream,tempUid,tempStreamId);
		CleanupStack::PopAndDestroy();	
		}		
						
	iStore->CommitL();// commit the changes to the store
	CleanupStack::PopAndDestroy(); //for iStore 
	iFsSession.Close(); //close the file session
	}