xdmprotocols/XcapProtocol/XcapCache/Server/src/XcapCacheIndexEntry.cpp
changeset 12 e6a66db4e9d0
parent 0 c8caa15ef882
--- a/xdmprotocols/XcapProtocol/XcapCache/Server/src/XcapCacheIndexEntry.cpp	Tue Feb 02 01:05:17 2010 +0200
+++ b/xdmprotocols/XcapProtocol/XcapCache/Server/src/XcapCacheIndexEntry.cpp	Fri Mar 19 09:37:41 2010 +0200
@@ -317,17 +317,13 @@
 HBufC8* CXcapCacheIndexEntry::HourStringLC()
     {
     HBufC8* hourString = NULL;
-    HBufC* date = CXcapCacheServer::DateL();
-    HBufC* time = CXcapCacheServer::TimeL();
-    hourString = HBufC8::NewLC( date->Length() + time->Length() + 1 );
+    TPtrC date( CXcapCacheServer::Date() );
+    TPtrC time( CXcapCacheServer::Time() );
+    hourString = HBufC8::NewLC( date.Length() + time.Length() + 1 );
     TPtr8 pointer( hourString->Des() );
-    pointer.Copy( *date );
+    pointer.Copy( date );
     pointer.Append( KPageFileSeparator );
-    pointer.Append( *time );
-    delete date;
-    date = NULL;
-    delete time;
-    time = NULL;
+    pointer.Append( time );
     return hourString;
     }
 
@@ -340,15 +336,13 @@
     {
     RFile file;
     HBufC* nameBuf = NULL;
-    HBufC* randomString = NULL;
     TPtrC randomName( _L( "" ) );
     TInt error = KErrAlreadyExists;
     //It is extremely unlikely that the random string generator
     //creates two exact same patterns, but let's check for it, anyway.
     while( error == KErrAlreadyExists )
         {
-        randomString = CXcapCacheServer::RandomStringL();
-        randomName.Set( *randomString );
+        randomName.Set( CXcapCacheServer::RandomString() );
         nameBuf = HBufC::NewLC( KCacheServerRoot().Length() + randomName.Length() );
         nameBuf->Des().Copy( KCacheServerRoot );
         nameBuf->Des().Append( randomName );