summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@digia.com>2012-11-09 11:20:10 +0100
committerEike Ziller <eike.ziller@digia.com>2012-11-09 11:20:10 +0100
commitfe74a9a722e50b16b7f3f73ae96fb891f8613c3c (patch)
tree218f6f25240499ee2f7138332c7b73d76df6c2dd /src
parentb03ba2bdb1ca4e96fa8be5da5c53fe48d8393c6f (diff)
parent28bcc5634c2521d514fdae7dc05585dc20c1bde6 (diff)
downloadqt-creator-fe74a9a722e50b16b7f3f73ae96fb891f8613c3c.tar.gz
Merge remote-tracking branch 'origin/2.6'
Conflicts: qtcreator.pri qtcreator.qbs src/plugins/fakevim/fakevimhandler.cpp src/plugins/qtsupport/baseqtversion.cpp tests/auto/cplusplus/cxx11/cxx11.pro tests/auto/cplusplus/cxx11/tst_cxx11.cpp tests/auto/icheckbuild/icheckbuild.pro Change-Id: I3c8351ad35617f56d15b788c8a46d8a6f453ef70
Diffstat (limited to 'src')
-rw-r--r--src/libs/cplusplus/LookupContext.h2
-rw-r--r--src/plugins/autotoolsprojectmanager/makefileparser.cpp5
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp5
-rw-r--r--src/plugins/debugger/cdb/cdbengine.cpp4
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp1
-rw-r--r--src/plugins/debugger/qml/qmlengine.cpp10
-rw-r--r--src/plugins/git/gitclient.cpp8
-rw-r--r--src/plugins/qmldesigner/components/pluginmanager/iplugin.h2
-rw-r--r--src/plugins/qmldesigner/designercore/include/iwidgetplugin.h2
-rw-r--r--src/plugins/qtsupport/baseqtversion.cpp100
-rw-r--r--src/shared/proparser/profileevaluator.cpp2
-rw-r--r--src/shared/proparser/qmakeevaluator.cpp33
-rw-r--r--src/shared/proparser/qmakeevaluator.h1
-rw-r--r--src/shared/proparser/qmakeglobals.cpp3
-rw-r--r--src/tools/gen-cpp-ast/generate-ast.cpp26
15 files changed, 119 insertions, 85 deletions
diff --git a/src/libs/cplusplus/LookupContext.h b/src/libs/cplusplus/LookupContext.h
index ef591a3793..d14bd33403 100644
--- a/src/libs/cplusplus/LookupContext.h
+++ b/src/libs/cplusplus/LookupContext.h
@@ -71,7 +71,7 @@ public:
void clear(const T *item)
{
- if (_class != item)
+ if (_class != item || _container.size() == 1)
_container.clear();
}
diff --git a/src/plugins/autotoolsprojectmanager/makefileparser.cpp b/src/plugins/autotoolsprojectmanager/makefileparser.cpp
index 570db855dd..6ddeec0ed4 100644
--- a/src/plugins/autotoolsprojectmanager/makefileparser.cpp
+++ b/src/plugins/autotoolsprojectmanager/makefileparser.cpp
@@ -72,8 +72,11 @@ bool MakefileParser::parse()
m_makefiles.clear();
QFile *file = new QFile(m_makefile);
- if (!file->open(QIODevice::ReadOnly | QIODevice::Text))
+ if (!file->open(QIODevice::ReadOnly | QIODevice::Text)) {
+ qWarning("%s: %s", qPrintable(m_makefile), qPrintable(file->errorString()));
+ delete file;
return false;
+ }
QFileInfo info(m_makefile);
m_makefiles.append(info.fileName());
diff --git a/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp b/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp
index 1ddb1f6560..7ff68eca92 100644
--- a/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp
@@ -174,6 +174,8 @@ QList<GeneratorInfo> GeneratorInfo::generatorInfosFor(ProjectExplorer::Kit *k, N
{
QList<GeneratorInfo> results;
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
+ if (!tc)
+ return results;
ProjectExplorer::Abi targetAbi = tc->targetAbi();
if (n != ForceNinja) {
if (targetAbi.os() == ProjectExplorer::Abi::WindowsOS) {
@@ -574,9 +576,6 @@ void CMakeRunPage::initializePage()
ProjectExplorer::KitManager::instance()->kits();
foreach (ProjectExplorer::Kit *k, kitList) {
- ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
- if (!tc)
- continue;
QList<GeneratorInfo> infos = GeneratorInfo::generatorInfosFor(k,
hasNinjaGenerator ? GeneratorInfo::OfferNinja : GeneratorInfo::NoNinja,
hasCodeBlocksGenerator);
diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp
index 2ac44c5188..1aff3a94b9 100644
--- a/src/plugins/debugger/cdb/cdbengine.cpp
+++ b/src/plugins/debugger/cdb/cdbengine.cpp
@@ -66,6 +66,7 @@
#include <projectexplorer/taskhub.h>
#include <utils/synchronousprocess.h>
+#include <utils/qtcprocess.h>
#include <utils/winutils.h>
#include <utils/qtcassert.h>
#include <utils/savedaction.h>
@@ -681,7 +682,8 @@ bool CdbEngine::launchCDB(const DebuggerStartParameters &sp, QString *errorMessa
case StartExternal:
if (!nativeArguments.isEmpty())
nativeArguments.push_back(blank);
- nativeArguments += QDir::toNativeSeparators(sp.executable);
+ Utils::QtcProcess::addArgs(&nativeArguments,
+ QStringList(QDir::toNativeSeparators(sp.executable)));
break;
case AttachToRemoteServer:
break;
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index e4faf2ff73..b1377ac454 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -1765,6 +1765,7 @@ void DebuggerPluginPrivate::attachToQmlPort()
sp.startMode = AttachToRemoteProcess;
sp.closeMode = KillAtClose;
sp.languages = QmlLanguage;
+ sp.masterEngineType = QmlEngineType;
//
// get files from all the projects in the session
diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp
index cb1c86e472..c2274c5e68 100644
--- a/src/plugins/debugger/qml/qmlengine.cpp
+++ b/src/plugins/debugger/qml/qmlengine.cpp
@@ -420,17 +420,21 @@ void QmlEngine::beginConnection(quint16 port)
QTC_ASSERT(state() == EngineRunRequested, return);
+ QString host = startParameters().qmlServerAddress;
+ // Use localhost as default
+ if (host.isEmpty())
+ host = QLatin1String("localhost");
+
if (port > 0) {
QTC_ASSERT(startParameters().connParams.port == 0
|| startParameters().connParams.port == port,
qWarning() << "Port " << port << "from application output does not match"
<< startParameters().connParams.port << "from start parameters.");
- m_adapter.beginConnectionTcp(startParameters().qmlServerAddress, port);
+ m_adapter.beginConnectionTcp(host, port);
return;
}
// no port from application output, use the one from start parameters ...
- m_adapter.beginConnectionTcp(startParameters().qmlServerAddress,
- startParameters().qmlServerPort);
+ m_adapter.beginConnectionTcp(host, startParameters().qmlServerPort);
}
void QmlEngine::connectionStartupFailed()
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index 61747141ed..6facdc93a0 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -2373,12 +2373,12 @@ unsigned GitClient::synchronousGitVersion(QString *errorMessage) const
}
// cut 'git version 1.6.5.1.sha'
const QString output = commandOutputFromLocal8Bit(outputText);
- QRegExp versionPattern(QLatin1String("^[^\\d]+([\\d])\\.([\\d])\\.([\\d]).*$"));
+ QRegExp versionPattern(QLatin1String("^[^\\d]+(\\d+)\\.(\\d+)\\.(\\d+).*$"));
QTC_ASSERT(versionPattern.isValid(), return 0);
QTC_ASSERT(versionPattern.exactMatch(output), return 0);
- const unsigned major = versionPattern.cap(1).toUInt();
- const unsigned minor = versionPattern.cap(2).toUInt();
- const unsigned patch = versionPattern.cap(3).toUInt();
+ const unsigned major = versionPattern.cap(1).toUInt(0, 16);
+ const unsigned minor = versionPattern.cap(2).toUInt(0, 16);
+ const unsigned patch = versionPattern.cap(3).toUInt(0, 16);
return version(major, minor, patch);
}
diff --git a/src/plugins/qmldesigner/components/pluginmanager/iplugin.h b/src/plugins/qmldesigner/components/pluginmanager/iplugin.h
index fef22b3b15..23b41286f9 100644
--- a/src/plugins/qmldesigner/components/pluginmanager/iplugin.h
+++ b/src/plugins/qmldesigner/components/pluginmanager/iplugin.h
@@ -32,7 +32,7 @@
#include <QObject>
-#define QMLDESIGNER_PLUGIN_INTERFACE "com.Nokia.QmlDesigner.IPlugin.v10"
+#define QMLDESIGNER_PLUGIN_INTERFACE "com.Digia.QmlDesigner.IPlugin.v10"
namespace QmlDesigner {
diff --git a/src/plugins/qmldesigner/designercore/include/iwidgetplugin.h b/src/plugins/qmldesigner/designercore/include/iwidgetplugin.h
index 40af36daf9..6cfbfbcfae 100644
--- a/src/plugins/qmldesigner/designercore/include/iwidgetplugin.h
+++ b/src/plugins/qmldesigner/designercore/include/iwidgetplugin.h
@@ -32,7 +32,7 @@
#include <QObject>
-#define QMLDESIGNER_WIDGETPLUGIN_INTERFACE "com.Nokia.QmlDesigner.IWidgetPlugin.v10"
+#define QMLDESIGNER_WIDGETPLUGIN_INTERFACE "com.Digia.QmlDesigner.IWidgetPlugin.v10"
namespace QmlDesigner {
diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp
index 3f6297d940..6159673f21 100644
--- a/src/plugins/qtsupport/baseqtversion.cpp
+++ b/src/plugins/qtsupport/baseqtversion.cpp
@@ -627,9 +627,11 @@ QString BaseQtVersion::findQtBinary(Binaries binary) const
ensureMkSpecParsed();
switch (binary) {
case QmlScene:
- case QmlViewer:
baseDir = m_mkspecValues.value(QLatin1String("QT.qml.bins"));
break;
+ case QmlViewer:
+ baseDir = m_mkspecValues.value(QLatin1String("QT.declarative.bins"));
+ break;
case Designer:
case Linguist:
baseDir = m_mkspecValues.value(QLatin1String("QT.designer.bins"));
@@ -772,8 +774,10 @@ void BaseQtVersion::parseMkSpec(ProFileEvaluator *evaluator) const
m_defaultConfigIsDebugAndRelease = true;
}
const QString designerBins = QLatin1String("QT.designer.bins");
- const QString declarativeBins = QLatin1String("QT.qml.bins");
+ const QString qmlBins = QLatin1String("QT.qml.bins");
+ const QString declarativeBins = QLatin1String("QT.declarative.bins");
m_mkspecValues.insert(designerBins, evaluator->value(designerBins));
+ m_mkspecValues.insert(qmlBins, evaluator->value(qmlBins));
m_mkspecValues.insert(declarativeBins, evaluator->value(declarativeBins));
}
@@ -1260,61 +1264,69 @@ FileName BaseQtVersion::mkspecFromVersionInfo(const QHash<QString, QString> &ver
if (baseMkspecDir.isEmpty())
return FileName();
- FileName mkspecFullPath = FileName::fromString(baseMkspecDir.toString() + QLatin1String("/default"));
+ bool qt5 = false;
+ QString theSpec = qmakeProperty(versionInfo, "QMAKE_XSPEC");
+ if (theSpec.isEmpty())
+ theSpec = QLatin1String("default");
+ else
+ qt5 = true;
+
+ FileName mkspecFullPath = baseMkspecDir;
+ mkspecFullPath.appendPath(theSpec);
// qDebug() << "default mkspec is located at" << mkspecFullPath;
- switch (HostOsInfo::hostOs()) {
- case HostOsInfo::HostOsWindows: {
- QFile f2(mkspecFullPath.toString() + QLatin1String("/qmake.conf"));
- if (f2.exists() && f2.open(QIODevice::ReadOnly)) {
- while (!f2.atEnd()) {
- QByteArray line = f2.readLine();
- if (line.startsWith("QMAKESPEC_ORIGINAL")) {
- const QList<QByteArray> &temp = line.split('=');
- if (temp.size() == 2) {
- QString possibleFullPath = QString::fromLocal8Bit(temp.at(1).trimmed().constData());
- // We sometimes get a mix of different slash styles here...
- possibleFullPath = possibleFullPath.replace(QLatin1Char('\\'), QLatin1Char('/'));
- if (QFileInfo(possibleFullPath).exists()) // Only if the path exists
- mkspecFullPath = FileName::fromUserInput(possibleFullPath);
+ if (HostOsInfo::isWindowsHost()) {
+ if (!qt5) {
+ QFile f2(mkspecFullPath.toString() + QLatin1String("/qmake.conf"));
+ if (f2.exists() && f2.open(QIODevice::ReadOnly)) {
+ while (!f2.atEnd()) {
+ QByteArray line = f2.readLine();
+ if (line.startsWith("QMAKESPEC_ORIGINAL")) {
+ const QList<QByteArray> &temp = line.split('=');
+ if (temp.size() == 2) {
+ QString possibleFullPath = QString::fromLocal8Bit(temp.at(1).trimmed().constData());
+ // We sometimes get a mix of different slash styles here...
+ possibleFullPath = possibleFullPath.replace(QLatin1Char('\\'), QLatin1Char('/'));
+ if (QFileInfo(possibleFullPath).exists()) // Only if the path exists
+ mkspecFullPath = FileName::fromUserInput(possibleFullPath);
+ }
+ break;
}
- break;
}
+ f2.close();
}
- f2.close();
}
- break;
- }
- case HostOsInfo::HostOsMac: {
- QFile f2(mkspecFullPath.toString() + QLatin1String("/qmake.conf"));
- if (f2.exists() && f2.open(QIODevice::ReadOnly)) {
- while (!f2.atEnd()) {
- QByteArray line = f2.readLine();
- if (line.startsWith("MAKEFILE_GENERATOR")) {
- const QList<QByteArray> &temp = line.split('=');
- if (temp.size() == 2) {
- const QByteArray &value = temp.at(1);
- if (value.contains("XCODE")) {
- // we don't want to generate xcode projects...
- // qDebug() << "default mkspec is xcode, falling back to g++";
- mkspecFullPath = baseMkspecDir.appendPath(QLatin1String("macx-g++"));
+ } else {
+ if (HostOsInfo::isMacHost()) {
+ QFile f2(mkspecFullPath.toString() + QLatin1String("/qmake.conf"));
+ if (f2.exists() && f2.open(QIODevice::ReadOnly)) {
+ while (!f2.atEnd()) {
+ QByteArray line = f2.readLine();
+ if (line.startsWith("MAKEFILE_GENERATOR")) {
+ const QList<QByteArray> &temp = line.split('=');
+ if (temp.size() == 2) {
+ const QByteArray &value = temp.at(1);
+ if (value.contains("XCODE")) {
+ // we don't want to generate xcode projects...
+ // qDebug() << "default mkspec is xcode, falling back to g++";
+ return baseMkspecDir.appendPath(QLatin1String("macx-g++"));
+ }
}
- //resolve mkspec link
- mkspecFullPath = FileName::fromString(mkspecFullPath.toFileInfo().canonicalFilePath());
+ break;
}
- break;
}
+ f2.close();
}
- f2.close();
}
- break;
- }
- default:
- mkspecFullPath = FileName::fromString(mkspecFullPath.toFileInfo().canonicalFilePath());
- break;
+ if (!qt5) {
+ //resolve mkspec link
+ QString rspec = mkspecFullPath.toFileInfo().readLink();
+ if (!rspec.isEmpty())
+ mkspecFullPath = FileName::fromUserInput(
+ QDir(baseMkspecDir.toString()).absoluteFilePath(rspec));
+ }
}
-
return mkspecFullPath;
}
diff --git a/src/shared/proparser/profileevaluator.cpp b/src/shared/proparser/profileevaluator.cpp
index 6e3b995f85..6f2fcca56c 100644
--- a/src/shared/proparser/profileevaluator.cpp
+++ b/src/shared/proparser/profileevaluator.cpp
@@ -205,7 +205,7 @@ QString ProFileEvaluator::propertyValue(const QString &name) const
QString ProFileEvaluator::resolvedMkSpec() const
{
- return d->m_qmakespecFull;
+ return d->m_qmakespec;
}
#ifdef PROEVALUATOR_CUMULATIVE
diff --git a/src/shared/proparser/qmakeevaluator.cpp b/src/shared/proparser/qmakeevaluator.cpp
index 663be73f58..2a44bdd441 100644
--- a/src/shared/proparser/qmakeevaluator.cpp
+++ b/src/shared/proparser/qmakeevaluator.cpp
@@ -199,7 +199,6 @@ void QMakeEvaluator::initFrom(const QMakeEvaluator &other)
m_valuemapStack = other.m_valuemapStack;
m_valuemapInited = true;
m_qmakespec = other.m_qmakespec;
- m_qmakespecFull = other.m_qmakespecFull;
m_qmakespecName = other.m_qmakespecName;
m_mkspecPaths = other.m_mkspecPaths;
m_featureRoots = other.m_featureRoots;
@@ -1116,17 +1115,26 @@ bool QMakeEvaluator::loadSpecInternal()
evalError(fL1S("Could not read qmake configuration file %1.").arg(spec));
return false;
}
-#ifdef Q_OS_UNIX
- m_qmakespecFull = QFileInfo(m_qmakespec).canonicalFilePath();
-#else
+#ifndef QT_BUILD_QMAKE
+ // Legacy support for Qt4 default specs
+# ifdef Q_OS_UNIX
+ if (m_qmakespec.endsWith(QLatin1String("/default-host"))
+ || m_qmakespec.endsWith(QLatin1String("/default"))) {
+ QString rspec = QFileInfo(m_qmakespec).readLink();
+ if (!rspec.isEmpty())
+ m_qmakespec = QDir::cleanPath(QDir(m_qmakespec).absoluteFilePath(rspec));
+ }
+# else
// We can't resolve symlinks as they do on Unix, so configure.exe puts
// the source of the qmake.conf at the end of the default/qmake.conf in
// the QMAKESPEC_ORIGINAL variable.
const ProString &orig_spec = first(ProKey("QMAKESPEC_ORIGINAL"));
- m_qmakespecFull = orig_spec.isEmpty() ? m_qmakespec : orig_spec.toQString();
+ if (!orig_spec.isEmpty())
+ m_qmakespec = orig_spec.toQString();
+# endif
#endif
- valuesRef(ProKey("QMAKESPEC")) << ProString(m_qmakespecFull);
- m_qmakespecName = IoUtils::fileName(m_qmakespecFull).toString();
+ valuesRef(ProKey("QMAKESPEC")) << ProString(m_qmakespec);
+ m_qmakespecName = IoUtils::fileName(m_qmakespec).toString();
if (!evaluateFeatureFile(QLatin1String("spec_post.prf")))
return false;
// The MinGW and x-build specs may change the separator; $$shell_{path,quote}() need it
@@ -1168,7 +1176,12 @@ bool QMakeEvaluator::loadSpec()
updateMkspecPaths();
if (qmakespec.isEmpty())
+ qmakespec = propertyValue(ProKey(m_hostBuild ? "QMAKE_SPEC" : "QMAKE_XSPEC")).toQString();
+#ifndef QT_BUILD_QMAKE
+ // Legacy support for Qt4 qmake in Qt Creator, etc.
+ if (qmakespec.isEmpty())
qmakespec = m_hostBuild ? QLatin1String("default-host") : QLatin1String("default");
+#endif
if (IoUtils::isRelativePath(qmakespec)) {
foreach (const QString &root, m_mkspecPaths) {
QString mkspec = root + QLatin1Char('/') + qmakespec;
@@ -1409,12 +1422,12 @@ void QMakeEvaluator::updateFeaturePaths()
foreach (const QString &item, m_qmakepath)
feature_bases << (item + mkspecs_concat);
- if (!m_qmakespecFull.isEmpty()) {
+ if (!m_qmakespec.isEmpty()) {
// The spec is already platform-dependent, so no subdirs here.
- feature_roots << (m_qmakespecFull + features_concat);
+ feature_roots << (m_qmakespec + features_concat);
// Also check directly under the root directory of the mkspecs collection
- QDir specdir(m_qmakespecFull);
+ QDir specdir(m_qmakespec);
while (!specdir.isRoot() && specdir.cdUp()) {
const QString specpath = specdir.path();
if (specpath.endsWith(mkspecs_concat)) {
diff --git a/src/shared/proparser/qmakeevaluator.h b/src/shared/proparser/qmakeevaluator.h
index 2fa84ac05c..6ac7db9c28 100644
--- a/src/shared/proparser/qmakeevaluator.h
+++ b/src/shared/proparser/qmakeevaluator.h
@@ -262,7 +262,6 @@ public:
bool m_valuemapInited;
bool m_hostBuild;
QString m_qmakespec;
- QString m_qmakespecFull;
QString m_qmakespecName;
QString m_superfile;
QString m_conffile;
diff --git a/src/shared/proparser/qmakeglobals.cpp b/src/shared/proparser/qmakeglobals.cpp
index 48acb84a3a..1d5bd98fa6 100644
--- a/src/shared/proparser/qmakeglobals.cpp
+++ b/src/shared/proparser/qmakeglobals.cpp
@@ -314,7 +314,7 @@ bool QMakeGlobals::initProperties()
}
#endif
foreach (QByteArray line, data.split('\n'))
- if (!line.startsWith("QMAKE_")) {
+ {
int off = line.indexOf(':');
if (off < 0) // huh?
continue;
@@ -340,7 +340,6 @@ bool QMakeGlobals::initProperties()
}
}
}
- properties.insert(ProKey("QMAKE_VERSION"), ProString("2.01a"));
return true;
}
#else
diff --git a/src/tools/gen-cpp-ast/generate-ast.cpp b/src/tools/gen-cpp-ast/generate-ast.cpp
index 33b3c8c31a..34d83b7326 100644
--- a/src/tools/gen-cpp-ast/generate-ast.cpp
+++ b/src/tools/gen-cpp-ast/generate-ast.cpp
@@ -27,7 +27,6 @@
**
****************************************************************************/
-#include <QCoreApplication>
#include <QStringList>
#include <QTextDocument>
#include <QTextCursor>
@@ -35,6 +34,15 @@
#include <QDir>
#include <QDebug>
+#if QT_VERSION >= 0x050000
+ // Qt5: QTextDocument needs access to Fonts via QGuiApplication.
+ #include <QGuiApplication>
+ typedef QGuiApplication MyQApplication;
+#else
+ #include <QCoreApplication>
+ typedef QCoreApplication MyQApplication;
+#endif
+
#include <Control.h>
#include <Parser.h>
#include <AST.h>
@@ -1064,9 +1072,7 @@ void generateAST_cpp(const Snapshot &snapshot, const QDir &cplusplusDir)
QTextDocument cpp_document;
cpp_document.setPlainText(source);
- Document::Ptr AST_cpp_document = Document::create(fileName);
- const QByteArray preprocessedCode = snapshot.preprocessedCode(source, fileName);
- AST_cpp_document->setUtf8Source(preprocessedCode);
+ Document::Ptr AST_cpp_document = snapshot.preprocessedDocument(source, fileName);
AST_cpp_document->check();
Overview oo;
@@ -1368,9 +1374,7 @@ QStringList generateAST_H(const Snapshot &snapshot, const QDir &cplusplusDir, co
QTextDocument document;
document.setPlainText(source);
- AST_h_document = Document::create(fileName);
- const QByteArray preprocessedCode = snapshot.preprocessedCode(source, fileName);
- AST_h_document->setUtf8Source(preprocessedCode);
+ AST_h_document = snapshot.preprocessedDocument(source, fileName);
AST_h_document->check();
FindASTNodes process(AST_h_document, &document);
@@ -1514,10 +1518,7 @@ void generateASTFwd_h(const Snapshot &snapshot, const QDir &cplusplusDir, const
QTextDocument document;
document.setPlainText(source);
-
- Document::Ptr doc = Document::create(fileName);
- const QByteArray preprocessedCode = snapshot.preprocessedCode(source, fileName);
- doc->setUtf8Source(preprocessedCode);
+ Document::Ptr doc = snapshot.preprocessedDocument(source, fileName);
doc->check();
FindASTForwards process(doc, &document);
@@ -1667,7 +1668,8 @@ void generateASTPatternBuilder_h(const QDir &cplusplusDir)
int main(int argc, char *argv[])
{
- QCoreApplication app(argc, argv);
+ MyQApplication app(argc, argv);
+
QStringList files = app.arguments();
files.removeFirst();