Diff for /Amaya/amaya/query.c between versions 1.341 and 1.342

version 1.341, 2004/04/01 14:11:26 version 1.342, 2004/04/01 15:11:36
Line 1978  static void RecCleanCache (char *dirname Line 1978  static void RecCleanCache (char *dirname
   
 #if defined(_WX)  #if defined(_WX)
   char buftmp[256];    char buftmp[256];
   wxString wx_dir_name = wxString(dirname, AmayaApp::conv_ascii);  
   
     /* try to delete the current directory */  #ifdef _WINDOWS
     wxString separator = _T("\\");
   #else /* _WINDOWS */
     wxString separator = _T("/");
   #endif /* _WINDOWS */
   
     wxString wx_dir_name = wxString(dirname, AmayaApp::conv_ascii);
     
     /* try to delete the current directory */
   wxRmdir(wx_dir_name);    wxRmdir(wx_dir_name);
       
   if (!wxDirExists(wx_dir_name))    if (!wxDirExists(wx_dir_name))
           return;      return;
     
   /* try to delete the files & directorys inside */    /* try to delete the files & directorys inside */
   {    {
           wxDir wx_dir(wx_dir_name);          wxDir wx_dir(wx_dir_name);  
           wxString name;      wxString name;
           ThotBool cont = wx_dir.GetFirst(&name);      ThotBool cont = wx_dir.GetFirst(&name);
           while (cont)      while (cont)
         {
           name = wx_dir.GetName()+separator+name;
           if (wxDirExists(name))
           {            {
                 name = wx_dir.GetName()+_T("\\")+name;              name = name+separator;
                 sprintf(buftmp, "%s\\", name.mb_str(AmayaApp::conv_ascii) );              /* it's a sub-directory */
                 if (wxDirExists(name))              sprintf(buftmp, "%s", (const char *)name.mb_str(AmayaApp::conv_ascii) );
                 {              /* delete it recursively */
                         /* it's a sub-directory */              RecCleanCache(buftmp);
                         sprintf(buftmp, "%s\\", name.mb_str(AmayaApp::conv_ascii) );            }
                         /* delete it recursively */          else
                         RecCleanCache(buftmp);            {
                 }              /* it's a file */
                 else              wxRemoveFile(name);
                 {  
                         /* it's a file */  
                         wxRemoveFile(name);  
                 }  
   
                 cont = wx_dir.GetNext(&name);  
           }            }
           
           cont = wx_dir.GetNext(&name);
         }
   }    }
   /* try to delete the current directory */    /* try to delete the current directory */
   wxRmdir(wx_dir_name);    wxRmdir(wx_dir_name);

Removed from v.1.341  
changed lines
  Added in v.1.342


Webmaster