diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/qdoc/config.cpp | 10 | ||||
-rw-r--r-- | src/tools/qdoc/main.cpp | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/tools/qdoc/config.cpp b/src/tools/qdoc/config.cpp index 5ab3cb0d7d9..e3b2f0325da 100644 --- a/src/tools/qdoc/config.cpp +++ b/src/tools/qdoc/config.cpp @@ -912,8 +912,10 @@ QStringList Config::loadMaster(const QString& fileName) */ void Config::load(Location location, const QString& fileName) { - pushWorkingDir(QFileInfo(fileName).path()); - QDir::setCurrent(QFileInfo(fileName).path()); + QFileInfo fileInfo(fileName); + QString path = fileInfo.canonicalPath(); + pushWorkingDir(path); + QDir::setCurrent(path); QRegExp keySyntax(QLatin1String("\\w+(?:\\.\\w+)*")); #define SKIP_CHAR() \ @@ -935,7 +937,7 @@ void Config::load(Location location, const QString& fileName) if (location.depth() > 16) location.fatal(tr("Too many nested includes")); - QFile fin(fileName); + QFile fin(fileInfo.fileName()); if (!fin.open(QFile::ReadOnly | QFile::Text)) { if (!Config::installDir.isEmpty()) { int prefix = location.filePath().length() - location.fileName().length(); @@ -1030,7 +1032,7 @@ void Config::load(Location location, const QString& fileName) /* Here is the recursive call. */ - load(location, QFileInfo(QFileInfo(fileName).dir(), includeFile).filePath()); + load(location, QFileInfo(QDir(path), includeFile).filePath()); } else { /* diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp index 74d706efe14..4a99ec39de7 100644 --- a/src/tools/qdoc/main.cpp +++ b/src/tools/qdoc/main.cpp @@ -227,6 +227,8 @@ static void processQdocconfFile(const QString &fileName) config.setStringList(CONFIG_AUTOLINKERRORS, QStringList(autolinkErrors ? "true" : "false")); config.setStringList(CONFIG_OBSOLETELINKS, QStringList(obsoleteLinks ? "true" : "false")); + prevCurrentDir = QDir::currentPath(); + /* With the default configuration values in place, load the qdoc configuration file. Note that the configuration @@ -236,7 +238,6 @@ static void processQdocconfFile(const QString &fileName) in the file being processed, mainly for error reporting purposes. */ - currentDir = QFileInfo(fileName).path(); Location::initialize(config); config.load(fileName); QString project = config.getString(CONFIG_PROJECT); @@ -248,7 +249,6 @@ static void processQdocconfFile(const QString &fileName) config.setStringList(CONFIG_DEFINES,defs); Location::terminate(); - prevCurrentDir = QDir::currentPath(); currentDir = QFileInfo(fileName).path(); if (!currentDir.isEmpty()) QDir::setCurrent(currentDir); |