locationmanager/locationtrail/src/clocationrecord.cpp
branchRCL_3
changeset 3 6752808b2036
parent 1 acef663c1218
child 6 646a02f170b9
--- a/locationmanager/locationtrail/src/clocationrecord.cpp	Tue Feb 02 00:24:33 2010 +0200
+++ b/locationmanager/locationtrail/src/clocationrecord.cpp	Fri Feb 19 23:14:48 2010 +0200
@@ -85,7 +85,7 @@
     TRAP(err, ReadCenRepValueL(KIntervalKey, interval));
     LOG1("CLocationManagerServer::ConstructL, cenrep interval value:%d", interval);
     
-    if (interval == 0)
+    if (interval == 0 || err != KErrNone )
     	{
         LOG1("CLocationManagerServer::ConstructL, cenrep interval err:%d", err);
     	iInterval = KUpdateInterval;
@@ -94,20 +94,6 @@
     	{
     	iInterval = interval * KMillion;
     	}
-    
-    TInt trailLength( 0 );
-    TRAP(err, ReadCenRepValueL(KTrailLengthKey, trailLength));
-    LOG1("CLocationManagerServer::ConstructL, cenrep trail length value:%d", trailLength);
-    
-    if ( err != KErrNone )
-    	{
-        LOG1("CLocationManagerServer::ConstructL, cenrep trail length err:%d", err);
-    	iBufferSize = KMaxTrailLength / iInterval;
-    	}
-    else
-    	{
-    	iBufferSize = trailLength * KMillion / iInterval;
-    	}
 
     TRAP(err, ReadCenRepValueL(KLocationDeltaKey, iLocationDelta));
     LOG1("CLocationManagerServer::ConstructL, location delta value:%d", iLocationDelta);
@@ -160,6 +146,10 @@
     iTrailCaptureSetting = aCaptureSetting;
     if ( aCaptureSetting == RLocationTrail::ECaptureAll && !iPositionInfo->IsActive() )
         {
+        if( iState == RLocationTrail::ETrailStopped  )
+            {
+            iTrail.Reset();
+            }
         iPositionInfo->StartL( aCaptureSetting, iInterval );
         }
     else if ( aCaptureSetting == RLocationTrail::ECaptureNetworkInfo )