// -----------------------------------------------------------------------------
// CProfileExtraTonesImpl::InternalizeL
//
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CProfileExtraTonesImpl::InternalizeL( CRepository& aCenRep,
        TInt aProfileId )
{
    delete iIMMessageAlertTone;
    iIMMessageAlertTone = NULL;

    TFileName toneFile;

    // IM Message alert tone
    User::LeaveIfError(
        aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngImTone,
                     aProfileId ), toneFile ) );
    iIMMessageAlertTone = toneFile.AllocL();

    delete iEmailAlertTone;
    iEmailAlertTone = NULL;

    // E-mail alert tone
    User::LeaveIfError(
        aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngEmailTone,
                     aProfileId ), toneFile ) );
    iEmailAlertTone = toneFile.AllocL();

    delete iVideoCallRingingTone;
    iVideoCallRingingTone = NULL;

    // Video call ringing tone
    User::LeaveIfError(
        aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngVideoCallTone,
                     aProfileId ), toneFile ) );
    iVideoCallRingingTone = toneFile.AllocL();

    delete iReminderTone;
    iReminderTone = NULL;

    // Reminder tone
    User::LeaveIfError(
        aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngReminderTone,
                     aProfileId ), toneFile ) );
    iReminderTone = toneFile.AllocL();

    delete iClockAlarmTone;
    iClockAlarmTone = NULL;

    // Clock alarm tone
    User::LeaveIfError(
        aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngClockAlarmTone,
                     aProfileId ), toneFile ) );
    iClockAlarmTone = toneFile.AllocL();
}
Пример #2
0
EXPORT_C void CSTPreferences::SetDownloadPathL(TFileName& aDownloadPath)
{
	delete iDownloadPath;
	iDownloadPath = 0;
	iDownloadPath = aDownloadPath.AllocL();
	NotifyObserversL(ESettingDownloadPath);
}
// -----------------------------------------------------------------------------
// CHttpCacheEntry::SetFileNameL
//
// -----------------------------------------------------------------------------
//
void CHttpCacheEntry::SetFileNameL( const TFileName& aFileName )
    {
    delete iFileName;
    iFileName = NULL;

    iFileName = aFileName.AllocL();
    }
// UniBioMessageDataPlugin::attachmentList()
// @see header
//---------------------------------------------------------------
UniMessageInfoList UniBioMessageDataPlugin::attachmentList()
{
    RFile file;
    QT_TRAP_THROWING(file = d_ptr->attachmentL());

    if(attachmentCount() == 0)
    {
        file.Close();
        return QList<UniMessageInfo*> ();
    }
     
    UniMessageInfoList attlist;

    QString path;
    QString mimetype;
    int size = 0;

    TFileName fullName;
    qt_symbian_throwIfError(file.FullName(fullName));
    qt_symbian_throwIfError(file.Size(size));

    path = XQConversions::s60DescToQString(*fullName.AllocL());

    UniMessageInfo *msgobj = new UniMessageInfo(path, size, mimetype);
    attlist << msgobj;
    file.Close();
    return attlist;
}
Пример #5
0
void CTestAgentContent::ConstructL(const TDesC& aURI, TContentShareMode aShareMode)
	{
	TFileName dummyFileName;
	TTestAgentAttributes::GetDummyFileName(aURI, dummyFileName);
	
	iURI = dummyFileName.AllocL();

	TUint mode = EFileStream | EFileRead;

	if(aShareMode == EContentShareReadWrite)
		{
		mode |= EFileShareReadersOrWriters;
		}
	else if (aShareMode == EContentShareExclusive)
		{
		mode |= EFileShareExclusive;
		}
	else
		{
		mode |= EFileShareReadersOnly;
		}

	// open underlying file handle
	User::LeaveIfError(iFs.Connect());
	User::LeaveIfError(iFile.Open(iFs, *iURI, mode));

	// Create DRM file objects
	iTestFile = CTestAgentFile::NewL(iFile);
	iTestDrmContent = CTestAgentDrmContent::NewL(iFile);
	
	// reset file pointer back to the beginning of the file
	TInt pos = 0;
	iFile.Seek(ESeekStart,pos);
	iShareMode = aShareMode;
	}
void CPolicyNormalizer::ReadFileL( TFileName aPath )
    {
    RFs fss;
    User::LeaveIfError(fss.Connect());
    CleanupClosePushL(fss);
     
    if(iPath)
        {
        delete iPath;
        iPath = NULL;
        }
        
    iPath = aPath.AllocL();
    
    TFileName iFileName(aPath);
    RFile  xmlFile;
    TInt err = xmlFile.Open(fss , iFileName, EFileRead );
    
    if(err == KErrNone)
        {
        TInt size;
        xmlFile.Size(size);

        HBufC8 *iBuf=HBufC8::NewL(size);

        TPtr8 buf8ptr(iBuf->Des());
        xmlFile.Read(buf8ptr,size);
        xmlFile.Close();

        TInt leaveCode(KErrNone);
        TRAP leaveCode, ParseL(buf8ptr) );
        leaveCode = 0; // not used currently
        delete iBuf;
        iBuf = NULL;
        }
// -----------------------------------------------------------------------------
// CSisxUIStartupFile::ConstructL
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CSisxUIStartupFile::ConstructL( const TUid& aUid )
    {
    User::LeaveIfError( iFileSession.Connect() );

    TUidName uidStr = aUid.Name();
    TFileName tmp;
    
    iFileSession.PrivatePath( tmp );    
    tmp.Insert( 0, TParsePtrC( PathInfo::PhoneMemoryRootPath() ).Drive() );
    tmp.Append( KImportDir );      
    tmp.AppendFormat( KNewFileFormat, &uidStr ); 
    iNewFile = tmp.AllocL();
    tmp.Zero();
        
    iFileSession.PrivatePath( tmp );
    tmp.Insert( 0, TParsePtrC( PathInfo::PhoneMemoryRootPath() ).Drive() );
    tmp.Append( KPrivateFileDir );    
    iFileSession.MkDir( tmp );    
    tmp.AppendFormat( KPrivateFileFormat, &uidStr );
    iPrivateFile = tmp.AllocL();
    }
/**
Get a default parent object, ff the request does not specify a parent object, 
*/
void CMTPImageDpCopyObject::SetDefaultParentObjectL()
    {
    OstTraceFunctionEntry0( CMTPIMAGEDPCOPYOBJECT_SETDEFAULTPARENTOBJECTL_ENTRY );
    TDriveNumber drive(static_cast<TDriveNumber>(iFramework.StorageMgr().DriveNumber(iStorageId)));
    LEAVEIFERROR(drive,
            OstTraceExt2( TRACE_ERROR, CMTPIMAGEDPCOPYOBJECT_SETDEFAULTPARENTOBJECTL, "No driver number for %d! error code %d",iStorageId, munged_err));
    TChar driveLetter;
    iFramework.Fs().DriveToChar(drive, driveLetter);
    TFileName driveBuf;
    driveBuf.Append(driveLetter);
    driveBuf = BaflUtils::RootFolderPath(driveBuf.Left(1));
    delete iDest;
    iDest = NULL;
    iDest = driveBuf.AllocL();
    iNewParentHandle = KMTPHandleNoParent;
    OstTraceFunctionExit0( CMTPIMAGEDPCOPYOBJECT_SETDEFAULTPARENTOBJECTL_EXIT );
    }
void CSVPHostMountCB::MountL(TBool /*aForceMount*/)
	{
        DP(_L("** (SVPHOSTMNT) CSVPHostMountCB::MountL()"));

	TInt err = iDevice.Open();
	User::LeaveIfError(err);

	TFileName driveName;
	TInt d=Drive().DriveNumber();
	iSize=HOST_SVP_DRIVE_SIZE;
	User::LeaveIfError(GetVolume(d,driveName,iUniqueID));
	HBufC* pN=driveName.AllocL();
	DP(_L("** (SVPHOSTMNT) ->SetVolumeName()"));
	SetVolumeName(pN);
	DP(_L("** (SVPHOSTMNT) <-SetVolumeName()"));

	}
Пример #10
0
/*
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
*/
void CEcomHandler::ReFreshHandlersL()
{		
	iHandlers.ResetAndDestroy();

	RImplInfoPtrArray infoArray;
	REComSession::ListImplementationsL(KUidYTaskHandUID, infoArray);

	TFileName CurrName;

	for ( TInt i = 0; i < infoArray.Count(); i++ )
	{
		CurrName.Zero();		
		CurrName.Copy(infoArray[i]->DisplayName());
		CurrName.TrimAll();
		
		TInt YStart = infoArray[i]->OpaqueData().Find(KtxStrtYTools);
		TInt YEnd 	= infoArray[i]->OpaqueData().Find(KtxEnddYTools);
		if(YStart != KErrNotFound
		&& YEnd != KErrNotFound)
		{	
			YStart = YStart + KtxStrtYTools().Length();
			YEnd = (YEnd - YStart);
			if(YEnd > 0 )
			{
				if(CurrName.Length() && CheckVersionL(infoArray[i]->OpaqueData().Mid(YStart,YEnd)))
				{
					CHandlerItem* newItem = new(ELeave)CHandlerItem();
					CleanupStack::PushL(newItem);
				
					newItem->iUid = infoArray[i]->ImplementationUid();	
					newItem->iName = CurrName.AllocL();
				
					newItem->iServerName = ParseInfoL(infoArray[i]->OpaqueData().Mid(YStart,YEnd),KtxStrtSERVER,KtxEnddSERVER);
					newItem->iIconfile = ParseInfoL(infoArray[i]->OpaqueData().Mid(YStart,YEnd),KtxStrtICONFILE,KtxEnddICONFILE);
				
					CleanupStack::Pop(newItem);
					
					iHandlers.Append(newItem);
				}
			}
		}
	}
	
	infoArray.ResetAndDestroy();
}
void CLogServDatabaseMarshall::DatabaseLocateL()
	{
	// Get drive for database
	TDriveUnit driveUnit(static_cast<TInt>(RFs::GetSystemDrive()));
	TDriveName name(driveUnit.Name());
	
	TFileName path;
	iFsSession.PrivatePath(path);
	
	// Ensure database path exists
	TParse parse;
	User::LeaveIfError(parse.Set(path, &name, NULL));
	path = parse.FullName();
	
	TInt error = iFsSession.MkDirAll(path);
	if	(error != KErrAlreadyExists)
		User::LeaveIfError(error);
	
	path += KLogDatabaseName;
	iDatabaseName = path.AllocL();
	}
Пример #12
0
void CRemoteMountCB::MountL(TBool /*aForceMount*/)
//
// Mount a media. Only allowed to leave with KErrNoMemory,KErrNotReady,KErrCorrupt,KErrUnknown.
//
	{
//	TInt64 s,f;
	TFileName driveName;
	TInt d=Drive().DriveNumber();
//	TInt driveNum=d;
	if (MapDrive(driveName,d))
		RFs::CharToDrive(driveName[0],d);
	//User::LeaveIfError(GetMediaSize(d,s,f));
	//if (driveNum==EDriveZ)
//		iSize=4*1048576;
//	else
		//iSize=s;
	iSize=4*1024*16;
	User::LeaveIfError(GetVolume(d,driveName,iUniqueID));
	HBufC* pN=driveName.AllocL();
	SetVolumeName(pN);
	}
// -----------------------------------------------------------------------------
// CProfilePttSettingsImpl::InternalizeL
//
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CProfilePttSettingsImpl::InternalizeL( CRepository& aCenRep,
                                            TInt aProfileId )
    {
    delete iPttRingingTone;
    iPttRingingTone = NULL;

    TFileName toneFile;

    // PTT ringing tone
    User::LeaveIfError(
            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngPttTone,
            aProfileId ), toneFile ) );
    iPttRingingTone = toneFile.AllocL();

    // PTT status
    TInt status( 0 );
    User::LeaveIfError(
            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngPttStatus,
            aProfileId ), status ) );
    iPttStatus = TProfilePttStatus( status );
    }
Пример #14
0
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CMainContainer::GetValuesFromStoreL(void)
{	
	iKeyArray.ResetAndDestroy();

	TFindFile AufFolder(CCoeEnv::Static()->FsSession());
	if(KErrNone == AufFolder.FindByDir(KtxKeySettingsFile, KNullDesC))
	{
		CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC(CCoeEnv::Static()->FsSession(),AufFolder.File(), TUid::Uid(0x102013AD));
	
		TFileName hljBuffer;
		TUint32 TmpValue(0);
				
		CKeyCapcap* ittem1 = new(ELeave)CKeyCapcap();
		iKeyArray.Append(ittem1);
		StringLoader::Load(ittem1->iLabel,R_STR_GREENBUTTON);
		
		GetValuesL(MyDStore,0x0011,TmpValue);
							
		if(TmpValue > 50)
			ittem1->iEnabled = ETrue;
		else// if(TmpValue > 10)
			ittem1->iEnabled = EFalse;
		
		GetValuesL(MyDStore,0x0012,hljBuffer);
		ittem1->iNunmber = hljBuffer.AllocL();

		GetValuesL(MyDStore,0x0013,hljBuffer);
		ittem1->iName = hljBuffer.AllocL();
		
		TmpValue = 0;
		GetValuesL(MyDStore,0x0014,TmpValue);
									
		if(TmpValue > 3599){
			TmpValue = 3599;
		}
		
		ittem1->iDelay = TmpValue;
		
		CKeyCapcap* ittem2 = new(ELeave)CKeyCapcap();
		iKeyArray.Append(ittem2);
		StringLoader::Load(ittem2->iLabel,R_STR_REDBUTTON);
		
		GetValuesL(MyDStore,0x0021,TmpValue);
							
		if(TmpValue > 50)
			ittem2->iEnabled = ETrue;
		else// if(TmpValue > 10)
			ittem2->iEnabled = EFalse;
		
		GetValuesL(MyDStore,0x0022,hljBuffer);
		ittem2->iNunmber = hljBuffer.AllocL();

		GetValuesL(MyDStore,0x0023,hljBuffer);
		ittem2->iName = hljBuffer.AllocL();
				
		TmpValue = 0;
		GetValuesL(MyDStore,0x0024,TmpValue);
											
		if(TmpValue > 3599){
			TmpValue = 3599;
		}
				
		ittem2->iDelay = TmpValue;
		
		CKeyCapcap* ittem3 = new(ELeave)CKeyCapcap();
		iKeyArray.Append(ittem3);
		StringLoader::Load(ittem3->iLabel,R_STR_OFFBUTTON);
		
		GetValuesL(MyDStore,0x0031,TmpValue);
							
		if(TmpValue > 50)
			ittem3->iEnabled = ETrue;
		else// if(TmpValue > 10)
			ittem3->iEnabled = EFalse;
		
		GetValuesL(MyDStore,0x0032,hljBuffer);
		ittem3->iNunmber = hljBuffer.AllocL();

		GetValuesL(MyDStore,0x0033,hljBuffer);
		ittem3->iName = hljBuffer.AllocL();		
	
		TmpValue = 0;
		GetValuesL(MyDStore,0x0034,TmpValue);
											
		if(TmpValue > 3599){
			TmpValue = 3599;
		}
				
		ittem3->iDelay = TmpValue;		
		
		CKeyCapcap* ittem4 = new(ELeave)CKeyCapcap();
		iKeyArray.Append(ittem4);
		StringLoader::Load(ittem4->iLabel,R_STR_CAMERABUTTON);
		
		GetValuesL(MyDStore,0x0041,TmpValue);
							
		if(TmpValue > 50)
			ittem4->iEnabled = ETrue;
		else// if(TmpValue > 10)
			ittem4->iEnabled = EFalse;
		
		GetValuesL(MyDStore,0x0042,hljBuffer);
		ittem4->iNunmber = hljBuffer.AllocL();

		GetValuesL(MyDStore,0x0043,hljBuffer);
		ittem4->iName = hljBuffer.AllocL();	

		TmpValue = 0;
		GetValuesL(MyDStore,0x0044,TmpValue);
											
		if(TmpValue > 3599){
			TmpValue = 3599;
		}
				
		ittem4->iDelay = TmpValue;		
		
		CleanupStack::PopAndDestroy(1);// Store
	}
}