summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-01-20 18:16:08 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-01-20 18:18:59 +0100
commit9033977d3971db5352a2bb51052a723a2ac57a8f (patch)
treed1a70bdf5e892cc391f7bbfd61ff5611fe25ce3d /src/tools
parente5e43a2386fb4a4c2cb90d5a8d9bb5ca81a2675e (diff)
parent03b6a2f0f98b70b24c0cce645d6d58c084111f91 (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')
-rw-r--r--src/tools/moc/main.cpp3
-rw-r--r--src/tools/moc/preprocessor.cpp3
-rw-r--r--src/tools/moc/preprocessor.h2
-rw-r--r--src/tools/qdoc/config.cpp51
-rw-r--r--src/tools/qdoc/doc/config/qdoc.qdocconf1
-rw-r--r--src/tools/qdoc/qdoc.pro1
6 files changed, 25 insertions, 36 deletions
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);
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();
}
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 \
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)