diff options
| author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-01-20 18:16:08 +0100 |
|---|---|---|
| committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-01-20 18:18:59 +0100 |
| commit | 9033977d3971db5352a2bb51052a723a2ac57a8f (patch) | |
| tree | d1a70bdf5e892cc391f7bbfd61ff5611fe25ce3d /src/tools/qdoc/config.cpp | |
| parent | e5e43a2386fb4a4c2cb90d5a8d9bb5ca81a2675e (diff) | |
| parent | 03b6a2f0f98b70b24c0cce645d6d58c084111f91 (diff) | |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
src/corelib/global/qglobal.h
src/corelib/tools/qstring.cpp
src/gui/image/image.pri
src/gui/image/qimage.cpp
src/plugins/platforms/cocoa/qcocoawindow.h
src/plugins/platforms/cocoa/qcocoawindow.mm
src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
Change-Id: I3b9ba029c8f2263b011f204fdf68c3231c6d4ce5
Diffstat (limited to 'src/tools/qdoc/config.cpp')
| -rw-r--r-- | src/tools/qdoc/config.cpp | 51 |
1 files changed, 19 insertions, 32 deletions
diff --git a/src/tools/qdoc/config.cpp b/src/tools/qdoc/config.cpp index 2d8e98d64c7..56e7287c40b 100644 --- a/src/tools/qdoc/config.cpp +++ b/src/tools/qdoc/config.cpp @@ -196,8 +196,7 @@ void MetaStack::process(QChar ch, const Location& location) if (ch == QLatin1Char('{')) { push(MetaStackEntry()); top().open(); - } - else if (ch == QLatin1Char('}')) { + } else if (ch == QLatin1Char('}')) { if (count() == 1) location.fatal(tr("Unexpected '}'")); @@ -215,12 +214,10 @@ void MetaStack::process(QChar ch, const Location& location) } ++pre; } - } - else if (ch == QLatin1Char(',') && count() > 1) { + } else if (ch == QLatin1Char(',') && count() > 1) { top().close(); top().open(); - } - else { + } else { /* This is where all the processing is done. */ @@ -296,12 +293,10 @@ Config::~Config() void Config::load(const QString& fileName) { load(Location::null, fileName); - if (loc.isEmpty()) { + if (loc.isEmpty()) loc = Location(fileName); - } - else { + else loc.setEtc(true); - } lastLocation_ = Location::null; } @@ -472,9 +467,8 @@ QStringList Config::getCanonicalPathList(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()) { @@ -786,9 +780,8 @@ QString Config::findFile(const Location& location, QStringList::ConstIterator d = dirs.constBegin(); while (d != dirs.constEnd()) { fileInfo.setFile(QDir(*d), firstComponent); - if (fileInfo.exists()) { + if (fileInfo.exists()) break; - } ++d; } } @@ -808,9 +801,9 @@ QString Config::findFile(const Location& location, QString extracted = extractedDirs[fileInfo.filePath()]; ++c; fileInfo.setFile(QDir(extracted), *c); - } - else + } else { break; + } userFriendlyFilePath += QLatin1Char('?'); } @@ -876,9 +869,8 @@ QString Config::copyFile(const Location& location, char buffer[1024]; int len; - while ((len = inFile.read(buffer, sizeof(buffer))) > 0) { + while ((len = inFile.read(buffer, sizeof(buffer))) > 0) outFile.write(buffer, len); - } return outFileName; } @@ -1002,17 +994,15 @@ void Config::load(Location location, const QString& fileName) QChar c = text.at(0); uint cc = c.unicode(); while (i < (int) text.length()) { - if (cc == 0) + if (cc == 0) { ++i; - else if (c.isSpace()) { + } else if (c.isSpace()) { SKIP_CHAR(); - } - else if (cc == '#') { + } else if (cc == '#') { do { SKIP_CHAR(); } while (cc != '\n'); - } - else if (isMetaKeyChar(c)) { + } else if (isMetaKeyChar(c)) { Location keyLoc = location; bool plus = false; QString stringValue; @@ -1184,15 +1174,13 @@ void Config::load(Location location, const QString& fileName) ++key; } } - } - else { + } else { location.fatal(tr("Unexpected character '%1' at beginning of line").arg(c)); } } popWorkingDir(); - if (!workingDirs_.isEmpty()) { + if (!workingDirs_.isEmpty()) QDir::setCurrent(workingDirs_.top()); - } } QStringList Config::getFilesHere(const QString& uncleanDir, @@ -1219,9 +1207,8 @@ QStringList Config::getFilesHere(const QString& uncleanDir, if (!fn->startsWith(QLatin1Char('~'))) { QString s = dirInfo.filePath(*fn); QString c = QDir::cleanPath(s); - if (!excludedFiles.contains(c)) { + if (!excludedFiles.contains(c)) result.append(c); - } } ++fn; } @@ -1251,9 +1238,9 @@ void Config::pushWorkingDir(const QString& dir) */ QString Config::popWorkingDir() { - if (!workingDirs_.isEmpty()) { + if (!workingDirs_.isEmpty()) return workingDirs_.pop(); - } + qDebug() << "RETURNED EMPTY WORKING DIR"; return QString(); } |
