diff --git a/src/tools/qdoc/config.cpp b/src/tools/qdoc/config.cpp index 5467791316..ce3b34841e 100644 --- a/src/tools/qdoc/config.cpp +++ b/src/tools/qdoc/config.cpp @@ -381,7 +381,7 @@ QStringList Config::getStringList(const QString& var) const \param var The variable containing the list of paths. \see Location::canonicalRelativePath() */ -QStringList Config::getCanonicalRelativePathList(const QString& var) const +QStringList Config::getCanonicalPathList(const QString& var) const { QStringList t; QList configVars = configVars_.values(var); @@ -391,15 +391,16 @@ QStringList Config::getCanonicalRelativePathList(const QString& var) const const ConfigVar& cv = configVars[i]; if (!cv.location_.isEmpty()) (Location&) lastLocation_ = cv.location_; - if (!cv.plus_) + if (!cv.plus_) { t.clear(); + } const QString d = cv.currentPath_; const QStringList& sl = cv.values_; if (!sl.isEmpty()) { t.reserve(t.size() + sl.size()); for (int i=0; i &excludedFiles) { QStringList result = getStringList(filesVar); - QStringList dirs = getCanonicalRelativePathList(dirsVar); + QStringList dirs = getCanonicalPathList(dirsVar); QString nameFilter = getString(filesVar + dot + QLatin1String(CONFIG_FILEEXTENSIONS)); @@ -611,7 +612,7 @@ QStringList Config::getExampleQdocFiles(const QSet &excludedDirs, const QSet &excludedFiles) { QStringList result; - QStringList dirs = getCanonicalRelativePathList("exampledirs"); + QStringList dirs = getCanonicalPathList("exampledirs"); QString nameFilter = " *.qdoc"; QStringList::ConstIterator d = dirs.constBegin(); @@ -626,7 +627,7 @@ QStringList Config::getExampleImageFiles(const QSet &excludedDirs, const QSet &excludedFiles) { QStringList result; - QStringList dirs = getCanonicalRelativePathList("exampledirs"); + QStringList dirs = getCanonicalPathList("exampledirs"); QString nameFilter = getString(CONFIG_EXAMPLES + dot + QLatin1String(CONFIG_IMAGEEXTENSIONS)); QStringList::ConstIterator d = dirs.constBegin(); diff --git a/src/tools/qdoc/config.h b/src/tools/qdoc/config.h index c601cc062e..8787d27eb3 100644 --- a/src/tools/qdoc/config.h +++ b/src/tools/qdoc/config.h @@ -101,7 +101,7 @@ public: QString getString(const QString& var) const; QSet getStringSet(const QString& var) const; QStringList getStringList(const QString& var) const; - QStringList getCanonicalRelativePathList(const QString& var) const; + QStringList getCanonicalPathList(const QString& var) const; QStringList getCleanPathList(const QString& var) const; QStringList getPathList(const QString& var) const; QRegExp getRegExp(const QString& var) const; diff --git a/src/tools/qdoc/location.cpp b/src/tools/qdoc/location.cpp index 91ee214aa1..64a635115e 100644 --- a/src/tools/qdoc/location.cpp +++ b/src/tools/qdoc/location.cpp @@ -243,21 +243,6 @@ QString Location::canonicalRelativePath(const QString &path) return configFileDir.relativeFilePath(canon); } -/*! - \brief Returns \a path which is canonicalized and relative to the \a configDir. - - QDir::relativeFilePath does not canonicalize the paths, so - if the config file is located at qtbase\src\widgets\doc\qtwidgets.qdocconf - and it has a reference to any ancestor folder (e.g. ".." or even "../doc") - */ -QString Location::canonicalRelativePath(const QString &path, const QString &configDir) -{ - QDir configFileDir(configDir); - QDir dir(path); - const QString canon = dir.canonicalPath(); - return configFileDir.relativeFilePath(canon); -} - /*! \fn int Location::lineNo() const Returns the current line number. Must not be called on an empty Location object. diff --git a/src/tools/qdoc/location.h b/src/tools/qdoc/location.h index 4604358fe5..33472810d3 100644 --- a/src/tools/qdoc/location.h +++ b/src/tools/qdoc/location.h @@ -101,7 +101,6 @@ public: static void startLoggingProgress() { logProgress_ = true; } static void stopLoggingProgress() { logProgress_ = false; } static QString canonicalRelativePath(const QString &path); - static QString canonicalRelativePath(const QString &path, const QString &configDir); private: enum MessageType { Warning, Error }; diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp index 9c2dd4dcfc..3ec121f795 100644 --- a/src/tools/qdoc/main.cpp +++ b/src/tools/qdoc/main.cpp @@ -356,7 +356,7 @@ static void processQdocconfFile(const QString &fileName) QStringList excludedFilesList; Generator::debugSegfault("Reading excludedirs"); - excludedDirsList = config.getCanonicalRelativePathList(CONFIG_EXCLUDEDIRS); + excludedDirsList = config.getCanonicalPathList(CONFIG_EXCLUDEDIRS); foreach (const QString &excludeDir, excludedDirsList) { QString p = QDir::fromNativeSeparators(excludeDir); QDir tmp(p);