htiui/HtiServicePlugins/HtiSysInfoServicePlugin/src/HtiSysInfoServicePlugin.cpp
branchRCL_3
changeset 11 454d022d514b
parent 6 69ec17276f52
child 12 aefcba28a3e0
equal deleted inserted replaced
9:404ad6c9bc20 11:454d022d514b
  2862     {
  2862     {
  2863     HTI_LOG_FUNC_IN( "CHtiSysInfoServicePlugin::CleanUpTempFiles" );
  2863     HTI_LOG_FUNC_IN( "CHtiSysInfoServicePlugin::CleanUpTempFiles" );
  2864     TFindFile finder( iFs );
  2864     TFindFile finder( iFs );
  2865     CDir* dir = NULL;
  2865     CDir* dir = NULL;
  2866     TInt err = finder.FindWildByDir(KMatchFileName, KTempFilePath, dir);
  2866     TInt err = finder.FindWildByDir(KMatchFileName, KTempFilePath, dir);
  2867     while ( err == KErrNone )
  2867     TInt safeDeleteCount = 0;
  2868         {
  2868     while ( err == KErrNone && safeDeleteCount < 20)
       
  2869         {
       
  2870         safeDeleteCount++;
  2869         TFileName path;
  2871         TFileName path;
  2870         path.Copy(finder.File());
  2872         path.Copy(finder.File());
  2871         iFileMan->Delete(path);
  2873         HTI_LOG_FORMAT( "found file: %S", &path );
       
  2874         TInt ret = iFileMan->Delete(path);
  2872         delete dir;
  2875         delete dir;
  2873         dir = NULL;
  2876         dir = NULL;
       
  2877         if(ret != KErrNone)
       
  2878             {
       
  2879             break;
       
  2880             }
  2874         err = finder.FindWildByDir(KMatchFileName, KTempFilePath, dir);
  2881         err = finder.FindWildByDir(KMatchFileName, KTempFilePath, dir);
  2875         }
  2882         }
  2876     HTI_LOG_FUNC_OUT("CHtiSysInfoServicePlugin::CleanUpTempFiles");
  2883     HTI_LOG_FUNC_OUT("CHtiSysInfoServicePlugin::CleanUpTempFiles");
  2877     return KErrNone;
  2884     return KErrNone;
  2878     }
  2885     }