From 2dc04430baf4c38f3ee8b855236bbb1e3d60e946 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Tue, 31 Dec 2013 21:02:50 +0900 Subject: Make qtbase compile with QT_NO_DOM Change-Id: I98bef84ca9bf86bf7dddd3ca2a3d8210a8e46a16 Reviewed-by: Oswald Buddenhagen --- src/tools/qdoc/qdoc.pro | 1 + 1 file changed, 1 insertion(+) (limited to 'src/tools') diff --git a/src/tools/qdoc/qdoc.pro b/src/tools/qdoc/qdoc.pro index b020bfe9a4..7ec4b4f726 100644 --- a/src/tools/qdoc/qdoc.pro +++ b/src/tools/qdoc/qdoc.pro @@ -1,6 +1,7 @@ !force_bootstrap { load(qfeatures) requires(!contains(QT_DISABLED_FEATURES, xmlstreamwriter)) + requires(!contains(QT_DISABLED_FEATURES, dom)) } option(host_build) -- cgit v1.2.3 From f2f2e4e53ee679b50878c042ecd64a0cf30c9569 Mon Sep 17 00:00:00 2001 From: Kurt Pattyn Date: Mon, 23 Dec 2013 21:13:30 +0100 Subject: Fix to comply with Qt coding guidelines Change-Id: Ie6c62d3107d17e64c94fa01380b3b1d80f24d0de Reviewed-by: Giuseppe D'Angelo --- src/tools/qdoc/config.cpp | 51 ++++++++++++++++++----------------------------- 1 file changed, 19 insertions(+), 32 deletions(-) (limited to 'src/tools') diff --git a/src/tools/qdoc/config.cpp b/src/tools/qdoc/config.cpp index 2d8e98d64c..56e7287c40 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(); } -- cgit v1.2.3 From 7c11e7ec195955f6b66cdcd19110f6daf303e023 Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Sun, 12 Jan 2014 19:44:32 +0800 Subject: qdocconf: Remove nonexistent dependency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I9d2f36102691a2bd8ab0697d20f6eac59d59a84f Reviewed-by: Topi Reiniö --- src/tools/qdoc/doc/config/qdoc.qdocconf | 1 - 1 file changed, 1 deletion(-) (limited to 'src/tools') diff --git a/src/tools/qdoc/doc/config/qdoc.qdocconf b/src/tools/qdoc/doc/config/qdoc.qdocconf index 992cec65dc..0f4ad07711 100644 --- a/src/tools/qdoc/doc/config/qdoc.qdocconf +++ b/src/tools/qdoc/doc/config/qdoc.qdocconf @@ -62,7 +62,6 @@ depends += \ qtsql \ qtsvg \ qttestlib \ - qttools \ qtuitools \ qtversit \ qtwidgets \ -- cgit v1.2.3 From 55659fb5a4efd3fee813627350287c0b45a6dc9c Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 25 Sep 2013 21:36:15 +0200 Subject: moc: Fix parsing of complex defines defined via command line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since now in Qt5 the moc does full macro substitution, it needs to handle the defines passed is command argument, even if they span over multiple tokens, or if they do not have any token. Example: moc '-DCOMPLEX=QVector' '-DEMPTY=' foo.h [ChangeLog][moc] Fixed passing -D of a macro defined to something more complex than a single identifier. Task-number: QTBUG-33668 Change-Id: Ie8131de215f1659a24af4778d52ee40cda19759f Reviewed-by: Oswald Buddenhagen Reviewed-by: Jędrzej Nowacki --- src/tools/moc/main.cpp | 3 ++- src/tools/moc/preprocessor.cpp | 3 +-- src/tools/moc/preprocessor.h | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/tools') diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp index 3ae6445093..0a5f6ec241 100644 --- a/src/tools/moc/main.cpp +++ b/src/tools/moc/main.cpp @@ -343,7 +343,8 @@ int runMoc(int argc, char **argv) parser.showHelp(1); } Macro macro; - macro.symbols += Symbol(0, PP_IDENTIFIER, value); + macro.symbols = Preprocessor::tokenize(value, 1, Preprocessor::TokenizeDefine); + macro.symbols.removeLast(); // remove the EOF symbol pp.macros.insert(name, macro); } foreach (const QString &arg, parser.values(undefineOption)) { diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp index 3615262b67..2de495f010 100644 --- a/src/tools/moc/preprocessor.cpp +++ b/src/tools/moc/preprocessor.cpp @@ -158,8 +158,7 @@ bool Preprocessor::skipBranch() } -enum TokenizeMode { TokenizeCpp, TokenizePreprocessor, PreparePreprocessorStatement, TokenizePreprocessorStatement, TokenizeInclude, PrepareDefine, TokenizeDefine }; -static Symbols tokenize(const QByteArray &input, int lineNum = 1, TokenizeMode mode = TokenizeCpp) +Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocessor::TokenizeMode mode) { Symbols symbols; const char *begin = input.constData(); diff --git a/src/tools/moc/preprocessor.h b/src/tools/moc/preprocessor.h index dc7c98de85..6403955c1b 100644 --- a/src/tools/moc/preprocessor.h +++ b/src/tools/moc/preprocessor.h @@ -89,6 +89,8 @@ public: int evaluateCondition(); + enum TokenizeMode { TokenizeCpp, TokenizePreprocessor, PreparePreprocessorStatement, TokenizePreprocessorStatement, TokenizeInclude, PrepareDefine, TokenizeDefine }; + static Symbols tokenize(const QByteArray &input, int lineNum = 1, TokenizeMode mode = TokenizeCpp); private: void until(Token); -- cgit v1.2.3