Ver código fonte

Rename "ctkUtils::rmdir" method into "ctkUtils::removeDirRecursively"

Jean-Christophe Fillion-Robin 13 anos atrás
pai
commit
24687ff4f5

+ 7 - 7
Libs/Core/Testing/Cpp/ctkUtilsTest4.cpp

@@ -65,7 +65,7 @@ int ctkUtilsTest4(int argc, char * argv [] )
   Q_UNUSED(argv);
 
   // --------------------------------------------------------------------------
-  // Test rmdir(const QString & dirName);
+  // Test removeDirRecursively(const QString & dirName);
   // --------------------------------------------------------------------------
   
   QDir tmp = QDir::temp();
@@ -74,9 +74,9 @@ int ctkUtilsTest4(int argc, char * argv [] )
 
   // Attempt to delete nonexistent relative directory
   QString nonexistentRelativeDirPath = temporaryDirName;
-  if (ctk::rmdir(nonexistentRelativeDirPath))
+  if (ctk::removeDirRecursively(nonexistentRelativeDirPath))
     {
-    std::cerr << "Line " << __LINE__ << " - Problem with ctk::rmdir() !"
+    std::cerr << "Line " << __LINE__ << " - Problem with ctk::removeDirRecursively() !"
               << " - It should fail to delete nonexistent directory: " <<
               qPrintable(nonexistentRelativeDirPath)<< std::endl;
     return EXIT_FAILURE;
@@ -84,9 +84,9 @@ int ctkUtilsTest4(int argc, char * argv [] )
 
   // Attempt to delete nonexistent absolute directory
   QString nonexistentAbsoluteDirPath = QFileInfo(tmp, temporaryDirName).dir().absolutePath();
-  if (ctk::rmdir(nonexistentAbsoluteDirPath))
+  if (ctk::removeDirRecursively(nonexistentAbsoluteDirPath))
     {
-    std::cerr << "Line " << __LINE__ << " - Problem with ctk::rmdir() !"
+    std::cerr << "Line " << __LINE__ << " - Problem with ctk::removeDirRecursively() !"
               << " - It should fail to delete nonexistent directory: " <<
               qPrintable(nonexistentAbsoluteDirPath)<< std::endl;
     return EXIT_FAILURE;
@@ -108,9 +108,9 @@ int ctkUtilsTest4(int argc, char * argv [] )
     return EXIT_FAILURE;
     }
 
-  if (!ctk::rmdir(tmp.absolutePath()))
+  if (!ctk::removeDirRecursively(tmp.absolutePath()))
     {
-    std::cerr << "Line " << __LINE__ << " - Problem with ctk::rmdir()"
+    std::cerr << "Line " << __LINE__ << " - Problem with ctk::removeDirRecursively()"
               << " - Failed to delete directory:" << qPrintable(tmp.absolutePath()) << std::endl;
     return EXIT_FAILURE;
     }

+ 2 - 2
Libs/Core/ctkUtils.cpp

@@ -277,7 +277,7 @@ double ctk::closestPowerOfTen(double value)
 }
 
 //-----------------------------------------------------------------------------
-bool ctk::rmdir(const QString & dirName)
+bool ctk::removeDirRecursively(const QString & dirName)
 {
   bool result = false;
   QDir dir(dirName);
@@ -288,7 +288,7 @@ bool ctk::rmdir(const QString & dirName)
       {
       if (info.isDir())
         {
-        result = ctk::rmdir(info.absoluteFilePath());
+        result = ctk::removeDirRecursively(info.absoluteFilePath());
         }
       else
         {

+ 1 - 1
Libs/Core/ctkUtils.h

@@ -114,7 +114,7 @@ double CTK_CORE_EXPORT closestPowerOfTen(double value);
 /// \param dirName The directory to remove
 /// \return <code>true</code> on success, <code>false</code> otherwise.
 /// \sa QDir::rmdir
-bool CTK_CORE_EXPORT rmdir(const QString & dirName);
+bool CTK_CORE_EXPORT removeDirRecursively(const QString & dirName);
 
 }