diff -r 63c982fb92f2 -r b73252188534 locationmanager/locationtrail/src/cgpxconverterao.cpp --- a/locationmanager/locationtrail/src/cgpxconverterao.cpp Thu Jul 15 19:07:24 2010 +0300 +++ b/locationmanager/locationtrail/src/cgpxconverterao.cpp Thu Aug 19 10:20:41 2010 +0300 @@ -22,6 +22,7 @@ #include "locationmanagerdebug.h" // --------------------------------------------------------------------------- +// CGpxConverterAO::CGpxConverterAO() // Default constructor. // --------------------------------------------------------------------------- // @@ -32,6 +33,7 @@ } // --------------------------------------------------------------------------- +// CGpxConverterAO::NewL // Standard NewL for first phase construction. // --------------------------------------------------------------------------- // @@ -46,18 +48,19 @@ } // --------------------------------------------------------------------------- +// CGpxConverterAO::ConstructL // 2nd phase construction. // --------------------------------------------------------------------------- // void CGpxConverterAO::ConstructL() { - LOG( "CGpxConverterAO::ConstructL" ); + LOG( "CGpxConverterAO::ConstructL ,begin" ); CActiveScheduler::Add( this ); User::LeaveIfError( iFs.Connect() ); iWriteBuf = HBufC8::NewL( KWriteBufSize ); iFormatBuf = HBufC::NewL( KWriteBufSize ); - + LOG( "CGpxConverterAO::ConstructL ,end" ); } // --------------------------------------------------------------------------- @@ -66,7 +69,7 @@ // CGpxConverterAO::~CGpxConverterAO() { - LOG( "CGpxConverterAO::~CGpxConverterAO" ); // DEBUG INFO + LOG( "CGpxConverterAO::~CGpxConverterAO ,begin" ); Cancel(); iFs.Close(); @@ -79,13 +82,19 @@ iBoundQueue.Close(); delete iTempFile; + iTempFile = NULL; delete iBoundaries; + iBoundaries = NULL; delete iWriteBuf; + iWriteBuf = NULL; delete iFormatBuf; + iFormatBuf = NULL; + LOG( "CGpxConverterAO::~CGpxConverterAO ,end" ); } // --------------------------------------------------------------------------- +// CGpxConverterAO::RunError // From CActive. // --------------------------------------------------------------------------- // @@ -100,6 +109,7 @@ } // --------------------------------------------------------------------------- +// CGpxConverterAO::DoCancel // From CActive. // --------------------------------------------------------------------------- // @@ -108,13 +118,15 @@ LOG( "CGpxConverterAO::DoCancel" ); } -/** - * Adds temp-file and possible pre-calculated boundaries - * into processing queue - */ +// --------------------------------------------------------------------------- +// CGpxConverterAO::AddToQueueL +// Adds temp-file and possible pre-calculated boundaries +// into processing queue +// --------------------------------------------------------------------------- +// void CGpxConverterAO::AddToQueueL( const TDesC& aFileName, TBoundaries* aBoundaries ) { - LOG("CGpxConverterAO::AddToQueueL"); + LOG("CGpxConverterAO::AddToQueueL ,begin"); TFileName *filename = new (ELeave) TFileName(aFileName); CleanupStack::PushL( filename ); iFileQueue.AppendL( filename ); @@ -125,11 +137,15 @@ { SetState( ENextFile ); } + + LOG("CGpxConverterAO::AddToQueueL ,end"); } -/** - * Set next state for RunL - */ + + // --------------------------------------------------------------------------- + // CGpxConverterAO::SetState + // Set next state for RunL + // --------------------------------------------------------------------------- void CGpxConverterAO::SetState( TProcessingState aState ) { LOG1( "CGpxConverterAO::SetState: %d", aState ); @@ -141,11 +157,13 @@ TRequestStatus* ptrStatus = &iStatus; User::RequestComplete( ptrStatus, KErrNone ); } + LOG("CGpxConverterAO::SetState ,end"); } -/** - * RunL - */ + + // --------------------------------------------------------------------------- + // CGpxConverterAO::RunL() + // --------------------------------------------------------------------------- void CGpxConverterAO::RunL() { switch( iState ) @@ -164,7 +182,9 @@ TInt err; iFixLost = ETrue; delete iTempFile; + iTempFile = NULL; delete iBoundaries; + iBoundaries = NULL; // get next temp-file from queue iTempFile = iFileQueue[0]; iBoundaries = iBoundQueue[0]; @@ -310,12 +330,14 @@ } } -/** - * Read Tag Id from temp-file - */ + + // --------------------------------------------------------------------------- + // CGpxConverterAO::ReadTagIdL + // Read Tag Id from temp-file + // --------------------------------------------------------------------------- void CGpxConverterAO::ReadTagIdL() { - LOG("CGpxConverterAO::ReadTagIdL"); + LOG("CGpxConverterAO::ReadTagIdL ,begin"); TUint32 low( 0 ); TUint32 high( 0 ); @@ -323,11 +345,15 @@ high = iReader.ReadUint32L(); iTagId = MAKE_TINT64( high, low ); + + LOG("CGpxConverterAO::ReadTagIdL ,end"); } -/** - * Calculate min and max coordinates for tracklog - */ + + // --------------------------------------------------------------------------- + // CGpxConverterAO::CalculateBoundaries + // Calculate min and max coordinates for tracklog + // --------------------------------------------------------------------------- void CGpxConverterAO::CalculateBoundaries() { LOG("CGpxConverterAO::CalculateBoundaries start"); @@ -372,11 +398,14 @@ LOG("CGpxConverterAO::CalculateBoundaries end"); } -/** - * Writes header tags for GPX file - */ + + // --------------------------------------------------------------------------- + // CGpxConverterAO::WriteStartingTags + // Writes header tags for GPX file + // --------------------------------------------------------------------------- void CGpxConverterAO::WriteStartingTags() { + LOG("CGpxConverterAO::WriteStartingTags ,begin"); TPtr8 writePtr = iWriteBuf->Des(); TPtr formatter = iFormatBuf->Des(); @@ -411,13 +440,17 @@ writePtr.Copy( KTagTrackStart ); iGpxFile.Write( writePtr ); + LOG("CGpxConverterAO::WriteStartingTags ,end"); } -/** - * Writes single trackpoint to GPX file - */ + + // --------------------------------------------------------------------------- + // CGpxConverterAO::WriteItemToFile + // Writes single trackpoint to GPX file + // --------------------------------------------------------------------------- void CGpxConverterAO::WriteItemToFile() { + LOG("CGpxConverterAO::WriteItemToFile ,begin"); TTime timeStamp; TPtr8 writePtr = iWriteBuf->Des(); @@ -503,14 +536,16 @@ writePtr.Copy( KTagTrkPointEnd ); iGpxFile.Write( writePtr ); } - + LOG("CGpxConverterAO::WriteItemToFile ,end"); } -/** - * Close GPX file - */ + // --------------------------------------------------------------------------- + // CGpxConverterAO::WriteClosingTags + // Close GPX file + // --------------------------------------------------------------------------- void CGpxConverterAO::WriteClosingTags() { + LOG("CGpxConverterAO::WriteClosingTags ,begin"); TPtr8 writePtr = iWriteBuf->Des(); // end segment @@ -525,11 +560,14 @@ writePtr.Append( KTagGpxEnd ); iGpxFile.Write( writePtr ); + LOG("CGpxConverterAO::WriteClosingTags ,end"); } -/** - * Resolve where to save tracklog file - */ + + // --------------------------------------------------------------------------- + // CGpxConverterAO::GetTrackLogPathL + // Resolve where to save tracklog file + // --------------------------------------------------------------------------- void CGpxConverterAO::GetTrackLogPathL( TDes& aFileName ) { LOG("CGpxConverterAO::GetTrackLogPathL start"); @@ -560,11 +598,15 @@ LOG("CGpxConverterAO::GetTrackLogPathL end"); } -/** - * Adds observer for GPX file creation notifications - */ + + // --------------------------------------------------------------------------- + // CGpxConverterAO::AddObserver + // Adds observer for GPX file creation notifications + // --------------------------------------------------------------------------- void CGpxConverterAO::AddObserver( MGpxConversionObserver* aObserver ) { iObservers.Append( aObserver ); } + +//End of File