summaryrefslogtreecommitdiff
path: root/src/qdoc/config.cpp
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2020-10-05 17:58:48 +0200
committerTopi Reinio <topi.reinio@qt.io>2020-10-10 13:53:16 +0200
commit9d1dd394191001cf2bc456cf73e702eeb7bac400 (patch)
tree6b43c4ece47045009dcf58e7f972ae241b9edd79 /src/qdoc/config.cpp
parent07e5b38a61871dbbb76af4000b59fc9e7f4e44cc (diff)
downloadqttools-9d1dd394191001cf2bc456cf73e702eeb7bac400.tar.gz
qdoc: Stop removing content of the output directory
QDoc deleted the contents of the directory specified by -outputdir in prepare phase - this was dangerous for users that do not expect that behavior. Instead of deleting, print out an error if the output directory is not empty. Fixes: QTBUG-87176 Change-Id: Iabefcc9733cf4c4b875fdd2bfd7f86f79d25349c Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/qdoc/config.cpp')
-rw-r--r--src/qdoc/config.cpp30
1 files changed, 0 insertions, 30 deletions
diff --git a/src/qdoc/config.cpp b/src/qdoc/config.cpp
index 467f6ef09..57e71baf3 100644
--- a/src/qdoc/config.cpp
+++ b/src/qdoc/config.cpp
@@ -931,36 +931,6 @@ int Config::numParams(const QString &value)
}
/*!
- Removes everything from \a dir. This function is recursive.
- It doesn't remove \a dir itself, but if it was called
- recursively, then the caller will remove \a dir.
- */
-bool Config::removeDirContents(const QString &dir)
-{
- QDir dirInfo(dir);
- const QFileInfoList entries = dirInfo.entryInfoList();
-
- bool ok = true;
-
- for (const auto &entry : entries) {
- if (entry.isFile()) {
- if (!dirInfo.remove(entry.fileName()))
- ok = false;
- } else if (entry.isDir()) {
- if (entry.fileName() != QLatin1String(".") && entry.fileName() != QLatin1String("..")) {
- if (removeDirContents(entry.absoluteFilePath())) {
- if (!dirInfo.rmdir(entry.fileName()))
- ok = false;
- } else {
- ok = false;
- }
- }
- }
- }
- return ok;
-}
-
-/*!
Returns \c true if \a ch is a letter, number, '_', '.',
'{', '}', or ','.
*/