Merge remote-tracking branch 'origin/3.5'

Change-Id: Ife5fdcd71b0adc99d4297a28a64515e9e93d7864
This commit is contained in:
Eike Ziller
2015-09-04 09:19:28 +02:00
45 changed files with 10790 additions and 9940 deletions

View File

@@ -12,4 +12,5 @@
<MaintenanceToolName>QtCreatorUninst</MaintenanceToolName>
<!-- @homeDir@ and @rootDir@ are some of the supported vars -->
<TargetDir>@rootDir@/Qt/qtcreator-{version}</TargetDir>
<StartMenuDir>Qt Creator</StartMenuDir>
</Installer>

View File

@@ -153,7 +153,7 @@ Component.prototype.createOperations = function()
{
component.addOperation( "CreateShortcut",
component.qtCreatorBinaryPath,
"@StartMenuDir@/Qt Creator.lnk",
"@StartMenuDir@/Qt Creator " + installer.value("ProductVersion") + ".lnk",
"workingDirectory=@homeDir@" );
// only install c runtime if it is needed, no minor version check of the c runtime till we need it

View File

@@ -17,5 +17,4 @@
<UserInterface>associatecommonfiletypesform.ui</UserInterface>
<UserInterface>launchqtcreatorcheckboxform.ui</UserInterface>
</UserInterfaces>
<StartMenuDir>Qt Creator {version}</StartMenuDir>
</Package>

View File

@@ -110,10 +110,10 @@
Starting with version 3.1, \QC requires the Python scripting extension. GDB
builds without Python scripting are not supported anymore and will not work.
The minimal supported version is GDB 7.5 using Python version 2.7, or 3.3,
The minimum supported version is GDB 7.5 using Python version 2.7, or 3.3,
or newer.
For remote debugging using GDB and GDB server, the minimal supported version
For remote debugging using GDB and GDB server, the minimum supported version
of GDB server on the target device is 7.0.
\section2 Supported CDB Versions
@@ -128,9 +128,10 @@
LLDB is typically used with the Clang compiler (even though you can use it
with GCC, too).
You can use the LLDB version delivered with Xcode, but we recommend that you
build it from sources using Xcode. The minimal supported version is LLDB
179.5.
On OS X you can use the LLDB version delivered with Xcode or build from source.
The minimum supported version is LLDB 320.4.
On Linux, the minimum supported version is LLDB 3.7.
\omit

View File

@@ -1,5 +1,5 @@
%{Cpp:LicenseTemplate}\
%{JS: QtSupport.qtIncludes([], ["QGui/QGuiApplication", "QQml/QQmlApplicationEngine"])}
%{JS: QtSupport.qtIncludes([], ["QtGui/QGuiApplication", "QtQml/QQmlApplicationEngine"])}
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);

View File

@@ -1,6 +1,5 @@
//
// Draws a cube that has different colors assigned to the vertices.
// Each face of the cube has the linear interpolation of the corner colors.
// Draws a plain green cube.
//
var gl;
@@ -8,10 +7,8 @@ var vertexPositionAttrLoc;
var shaderProgram;
var cubeVertexPositionBuffer;
var cubeVertexIndexBuffer;
var cubeVertexColorBuffer;
var vertexShader;
var fragmentShader;
var vertexColorAttrLoc;
var pMatrixUniformLoc;
var mvMatrixUniformLoc;
@@ -26,7 +23,6 @@ function initializeGL(canvas) {
// Setup the OpenGL state
gl.enable(gl.DEPTH_TEST);
gl.enable(gl.DEPTH_WRITE);
gl.depthMask(true);
gl.enable(gl.CULL_FACE);
gl.cullFace(gl.BACK);
@@ -35,7 +31,7 @@ function initializeGL(canvas) {
// Set viewport
gl.viewport(0, 0, canvas.width * canvas.devicePixelRatio, canvas.height * canvas.devicePixelRatio);
// Initialize vertex and color buffers
// Initialize vertex and element array buffers
initBuffers();
// Initialize the shader program
@@ -78,17 +74,13 @@ function paintGL(canvas) {
gl.enableVertexAttribArray(vertexPositionAttrLoc);
gl.vertexAttribPointer(vertexPositionAttrLoc, 3, gl.FLOAT, false, 0, 0);
gl.bindBuffer(gl.ARRAY_BUFFER, cubeVertexColorBuffer);
gl.enableVertexAttribArray(vertexColorAttrLoc);
gl.vertexAttribPointer(vertexColorAttrLoc, 4, gl.FLOAT, false, 0, 0);
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, cubeVertexIndexBuffer);
gl.drawElements(gl.TRIANGLES, 36, gl.UNSIGNED_SHORT, 0);
}
function initBuffers() {
// Create a cubeVertexPositionBuffer and put a single clipspace rectangle in
// it (2 triangles)
// Create a buffer for cube vertices. Since we are not using textures, we don't need unique
// vertices for each face. We can define the cube using 8 vertices.
cubeVertexPositionBuffer = gl.createBuffer();
cubeVertexPositionBuffer.name = "cubeVertexPositionBuffer";
gl.bindBuffer(gl.ARRAY_BUFFER, cubeVertexPositionBuffer);
@@ -107,6 +99,8 @@ function initBuffers() {
]),
gl.STATIC_DRAW);
// Create buffer for element array indices. We define six sides, each composed of two
// triangles, using the vertices defined above.
cubeVertexIndexBuffer = gl.createBuffer();
cubeVertexIndexBuffer.name = "cubeVertexIndexBuffer";
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, cubeVertexIndexBuffer);
@@ -131,36 +125,17 @@ function initBuffers() {
6, 2, 1
]),
gl.STATIC_DRAW);
cubeVertexColorBuffer = gl.createBuffer();
cubeVertexColorBuffer.name = "cubeVertexColorBuffer";
gl.bindBuffer(gl.ARRAY_BUFFER, cubeVertexColorBuffer);
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([// front
0.000, 1.000, 0.000,
1.000, 0.000, 1.000,
1.000, 1.000, 0.000,
1.000, 0.000, 0.000,
// back
0.435, 0.602, 0.223,
0.310, 0.747, 0.185,
1.000, 1.000, 1.000,
0.000, 0.000, 1.000
]), gl.STATIC_DRAW);
}
function initShaders() {
vertexShader = getShader(gl, "attribute highp vec3 aVertexPosition; \
attribute highp vec4 aVertexColor; \
uniform highp mat4 uMVMatrix; \
uniform highp mat4 uPMatrix; \
varying highp vec4 vColor; \
void main(void) { \
gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); \
vColor = aVertexColor; \
}", gl.VERTEX_SHADER);
fragmentShader = getShader(gl, "varying highp vec4 vColor; \
void main(void) { \
gl_FragColor = vColor; \
fragmentShader = getShader(gl, "void main(void) { \
gl_FragColor = vec4(0.5, 0.76, 0.26, 1.0); \
}", gl.FRAGMENT_SHADER);
shaderProgram = gl.createProgram();
@@ -179,8 +154,6 @@ function initShaders() {
// look up where the vertex data needs to go.
vertexPositionAttrLoc = gl.getAttribLocation(shaderProgram, "aVertexPosition");
gl.enableVertexAttribArray(vertexPositionAttrLoc);
vertexColorAttrLoc = gl.getAttribLocation(shaderProgram, "aVertexColor");
gl.enableVertexAttribArray(vertexColorAttrLoc);
pMatrixUniformLoc = gl.getUniformLocation(shaderProgram, "uPMatrix");
pMatrixUniformLoc.name = "pMatrixUniformLoc";

View File

@@ -13,6 +13,7 @@ function initializeGL(canvas) {
shading: THREE.SmoothShading });
var cubeGeometry = new THREE.BoxGeometry(1, 1, 1);
cube = new THREE.Mesh(cubeGeometry, material);
cube.rotation.set(0.785, 0.785, 0.0);
scene.add(cube);
renderer = new THREE.Canvas3DRenderer(
@@ -29,8 +30,5 @@ function resizeGL(canvas) {
}
function paintGL(canvas) {
cube.rotation.x += 0.01;
cube.rotation.y += 0.01;
renderer.render(scene, camera);
}

View File

@@ -1,5 +1,5 @@
%{Cpp:LicenseTemplate}\
%{JS: QtSupport.qtIncludes([], ["QGui/QGuiApplication", "QQml/QQmlApplicationEngine"])}
%{JS: QtSupport.qtIncludes([], ["QtGui/QGuiApplication", "QtQml/QQmlApplicationEngine"])}
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);

View File

@@ -1,5 +1,5 @@
%{Cpp:LicenseTemplate}\
%{JS: QtSupport.qtIncludes([], [%{UseQApplication} ? "QWidgets/QApplication" : "QtGui/QGuiApplication", "QQml/QQmlApplicationEngine"])}
%{JS: QtSupport.qtIncludes([], [%{UseQApplication} ? "QtWidgets/QApplication" : "QtGui/QGuiApplication", "QtQml/QQmlApplicationEngine"])}
int main(int argc, char *argv[])
{
@if %{UseQApplication}

View File

@@ -2129,7 +2129,7 @@ void Preprocessor::maybeStartOutputLine()
// If previous line ends with \ (possibly followed by whitespace), add another \n
const char *start = buffer.constData();
const char *ch = start + buffer.length() - 2;
while (ch > start && (*ch != '\n') && std::isspace(*ch))
while (ch > start && (*ch != '\n') && pp_isspace(*ch))
--ch;
if (*ch == '\\')
buffer.append('\n');

View File

@@ -75,7 +75,7 @@ ClangEditorDocumentProcessor::ClangEditorDocumentProcessor(
TextEditor::TextDocument *document)
: BaseEditorDocumentProcessor(document)
, m_modelManagerSupport(modelManagerSupport)
, m_parser(document->filePath().toString())
, m_parser(new ClangEditorDocumentParser(document->filePath().toString()))
, m_parserRevision(0)
, m_semanticHighlighter(document)
, m_builtinProcessor(document, /*enableSemanticHighlighter=*/ false)
@@ -95,7 +95,7 @@ ClangEditorDocumentProcessor::ClangEditorDocumentProcessor(
const int firstLine = 1;
const int lastLine = baseTextDocument()->document()->blockCount();
CreateMarkers *createMarkers = CreateMarkers::create(m_parser.semanticMarker(),
CreateMarkers *createMarkers = CreateMarkers::create(m_parser->semanticMarker(),
baseTextDocument()->filePath().toString(),
firstLine, lastLine);
return createMarkers->start();
@@ -152,9 +152,9 @@ CppTools::SemanticInfo ClangEditorDocumentProcessor::recalculateSemanticInfo()
return m_builtinProcessor.recalculateSemanticInfo();
}
CppTools::BaseEditorDocumentParser *ClangEditorDocumentProcessor::parser()
CppTools::BaseEditorDocumentParser::Ptr ClangEditorDocumentProcessor::parser()
{
return &m_parser;
return m_parser;
}
CPlusPlus::Snapshot ClangEditorDocumentProcessor::snapshot()
@@ -188,7 +188,7 @@ ClangEditorDocumentProcessor *ClangEditorDocumentProcessor::get(const QString &f
void ClangEditorDocumentProcessor::updateProjectPartAndTranslationUnitForEditor()
{
const CppTools::ProjectPart::Ptr projectPart = m_parser.projectPart();
const CppTools::ProjectPart::Ptr projectPart = m_parser->projectPart();
QTC_ASSERT(projectPart, return);
updateTranslationUnitForEditor(*projectPart.data());
@@ -203,7 +203,7 @@ void ClangEditorDocumentProcessor::onParserFinished()
return;
// Emit ifdefed out blocks
const auto ifdefoutBlocks = toTextEditorBlocks(m_parser.ifdefedOutBlocks());
const auto ifdefoutBlocks = toTextEditorBlocks(m_parser->ifdefedOutBlocks());
emit ifdefedOutBlocksUpdated(revision(), ifdefoutBlocks);
// Run semantic highlighter

View File

@@ -66,7 +66,7 @@ public:
void semanticRehighlight() override;
void recalculateSemanticInfoDetached(bool force) override;
CppTools::SemanticInfo recalculateSemanticInfo() override;
CppTools::BaseEditorDocumentParser *parser() override;
CppTools::BaseEditorDocumentParser::Ptr parser() override;
CPlusPlus::Snapshot snapshot() override;
bool isParserRunning() const override;
@@ -94,7 +94,7 @@ private:
private:
QPointer<ModelManagerSupportClang> m_modelManagerSupport;
std::vector<ClangTextMark> m_clangTextMarks;
ClangEditorDocumentParser m_parser;
QSharedPointer<ClangEditorDocumentParser> m_parser;
CppTools::ProjectPart::Ptr m_projectPart;
QFutureWatcher<void> m_parserWatcher;
unsigned m_parserRevision;

View File

@@ -249,7 +249,7 @@ QStringList createPCHInclusionOptions(const QString &pchFile)
ProjectPart::Ptr projectPartForFile(const QString &filePath)
{
if (CppTools::BaseEditorDocumentParser *parser = CppTools::BaseEditorDocumentParser::get(filePath))
if (const auto parser = CppTools::BaseEditorDocumentParser::get(filePath))
return parser->projectPart();
return ProjectPart::Ptr();
}

View File

@@ -786,7 +786,7 @@ public:
if (totalTime.elapsed() > 10000)
return false;
if (writeFileAgainTime.elapsed() > 1000) {
if (writeFileAgainTime.elapsed() > 3000) {
// The timestamp did not change, try again now.
QTC_ASSERT(writeFile(m_filePath, m_fileContents), return false);
writeFileAgainTime.restart();

View File

@@ -467,6 +467,8 @@ ProjectExplorer::FolderNode *CMakeProject::findOrCreateFolder(CMakeProjectNode *
FileName path = rootNode->path().parentDir();
QDir rootParentDir(path.toString());
QString relativePath = rootParentDir.relativeFilePath(directory);
if (relativePath == QLatin1String("."))
relativePath.clear();
QStringList parts = relativePath.split(QLatin1Char('/'), QString::SkipEmptyParts);
ProjectExplorer::FolderNode *parent = rootNode;
foreach (const QString &part, parts) {

View File

@@ -265,7 +265,7 @@ void CppEditorDocument::updatePreprocessorSettings()
void CppEditorDocument::setPreprocessorSettings(const CppTools::ProjectPart::Ptr &projectPart,
const QByteArray &defines)
{
CppTools::BaseEditorDocumentParser *parser = processor()->parser();
const auto parser = processor()->parser();
QTC_ASSERT(parser, return);
if (parser->projectPart() != projectPart || parser->configuration().editorDefines != defines) {
CppTools::BaseEditorDocumentParser::Configuration config = parser->configuration();

View File

@@ -104,14 +104,14 @@ ProjectPart::Ptr BaseEditorDocumentParser::projectPart() const
return state().projectPart;
}
BaseEditorDocumentParser *BaseEditorDocumentParser::get(const QString &filePath)
BaseEditorDocumentParser::Ptr BaseEditorDocumentParser::get(const QString &filePath)
{
CppModelManager *cmmi = CppModelManager::instance();
if (CppEditorDocumentHandle *cppEditorDocument = cmmi->cppEditorDocument(filePath)) {
if (BaseEditorDocumentProcessor *processor = cppEditorDocument->processor())
return processor->parser();
}
return 0;
return BaseEditorDocumentParser::Ptr();
}
ProjectPart::Ptr BaseEditorDocumentParser::determineProjectPart(const QString &filePath,

View File

@@ -44,7 +44,8 @@ class CPPTOOLS_EXPORT BaseEditorDocumentParser : public QObject
Q_OBJECT
public:
static BaseEditorDocumentParser *get(const QString &filePath);
using Ptr = QSharedPointer<BaseEditorDocumentParser>;;
static Ptr get(const QString &filePath);
struct Configuration {
bool stickToPreviousProjectPart = true;

View File

@@ -118,7 +118,7 @@ QList<QTextEdit::ExtraSelection> BaseEditorDocumentProcessor::toTextEditorSelect
}
void BaseEditorDocumentProcessor::runParser(QFutureInterface<void> &future,
BaseEditorDocumentParser *parser,
BaseEditorDocumentParser::Ptr parser,
BaseEditorDocumentParser::InMemoryInfo info)
{
future.setProgressRange(0, 1);

View File

@@ -62,7 +62,7 @@ public:
virtual void recalculateSemanticInfoDetached(bool force) = 0;
virtual CppTools::SemanticInfo recalculateSemanticInfo() = 0;
virtual CPlusPlus::Snapshot snapshot() = 0;
virtual BaseEditorDocumentParser *parser() = 0;
virtual BaseEditorDocumentParser::Ptr parser() = 0;
virtual bool isParserRunning() const = 0;
public:
@@ -85,7 +85,7 @@ protected:
QTextDocument *textDocument);
static void runParser(QFutureInterface<void> &future,
CppTools::BaseEditorDocumentParser *parser,
BaseEditorDocumentParser::Ptr parser,
BaseEditorDocumentParser::InMemoryInfo info);
// Convenience

View File

@@ -226,11 +226,11 @@ ProjectPart::HeaderPaths BuiltinEditorDocumentParser::headerPaths() const
return extraState().headerPaths;
}
BuiltinEditorDocumentParser *BuiltinEditorDocumentParser::get(const QString &filePath)
BuiltinEditorDocumentParser::Ptr BuiltinEditorDocumentParser::get(const QString &filePath)
{
if (BaseEditorDocumentParser *b = BaseEditorDocumentParser::get(filePath))
return qobject_cast<BuiltinEditorDocumentParser *>(b);
return 0;
if (BaseEditorDocumentParser::Ptr b = BaseEditorDocumentParser::get(filePath))
return b.objectCast<BuiltinEditorDocumentParser>();
return BuiltinEditorDocumentParser::Ptr();
}
void BuiltinEditorDocumentParser::addFileAndDependencies(Snapshot *snapshot,

View File

@@ -61,7 +61,8 @@ signals:
void finished(CPlusPlus::Document::Ptr document, CPlusPlus::Snapshot snapshot);
public:
static BuiltinEditorDocumentParser *get(const QString &filePath);
using Ptr = QSharedPointer<BuiltinEditorDocumentParser>;
static Ptr get(const QString &filePath);
private:
void updateHelper(const InMemoryInfo &info) override;

View File

@@ -125,7 +125,7 @@ BuiltinEditorDocumentProcessor::BuiltinEditorDocumentProcessor(
TextEditor::TextDocument *document,
bool enableSemanticHighlighter)
: BaseEditorDocumentProcessor(document)
, m_parser(document->filePath().toString())
, m_parser(new BuiltinEditorDocumentParser(document->filePath().toString()))
, m_codeWarningsUpdated(false)
, m_semanticHighlighter(enableSemanticHighlighter
? new CppTools::SemanticHighlighter(document)
@@ -135,9 +135,9 @@ BuiltinEditorDocumentProcessor::BuiltinEditorDocumentProcessor(
QSharedPointer<CppCodeModelSettings> cms = CppToolsPlugin::instance()->codeModelSettings();
BaseEditorDocumentParser::Configuration config = m_parser.configuration();
BaseEditorDocumentParser::Configuration config = m_parser->configuration();
config.usePrecompiledHeaders = cms->pchUsage() != CppCodeModelSettings::PchUse_None;
m_parser.setConfiguration(config);
m_parser->setConfiguration(config);
if (m_semanticHighlighter) {
m_semanticHighlighter->setHighlightingRunner(
@@ -152,7 +152,7 @@ BuiltinEditorDocumentProcessor::BuiltinEditorDocumentProcessor(
});
}
connect(&m_parser, &BuiltinEditorDocumentParser::finished,
connect(m_parser.data(), &BuiltinEditorDocumentParser::finished,
this, &BuiltinEditorDocumentProcessor::onParserFinished);
connect(&m_semanticInfoUpdater, &SemanticInfoUpdater::updated,
this, &BuiltinEditorDocumentProcessor::onSemanticInfoUpdated);
@@ -171,14 +171,14 @@ void BuiltinEditorDocumentProcessor::run()
BuiltinEditorDocumentParser::InMemoryInfo(false));
}
BaseEditorDocumentParser *BuiltinEditorDocumentProcessor::parser()
BaseEditorDocumentParser::Ptr BuiltinEditorDocumentProcessor::parser()
{
return &m_parser;
return m_parser;
}
CPlusPlus::Snapshot BuiltinEditorDocumentProcessor::snapshot()
{
return m_parser.snapshot();
return m_parser->snapshot();
}
void BuiltinEditorDocumentProcessor::recalculateSemanticInfoDetached(bool force)

View File

@@ -53,7 +53,7 @@ public:
void recalculateSemanticInfoDetached(bool force) override;
void semanticRehighlight() override;
CppTools::SemanticInfo recalculateSemanticInfo() override;
BaseEditorDocumentParser *parser() override;
BaseEditorDocumentParser::Ptr parser() override;
CPlusPlus::Snapshot snapshot() override;
bool isParserRunning() const override;
@@ -66,7 +66,7 @@ private:
SemanticInfo::Source createSemanticInfoSource(bool force) const;
private:
BuiltinEditorDocumentParser m_parser;
BuiltinEditorDocumentParser::Ptr m_parser;
QFuture<void> m_parserFuture;
CPlusPlus::Snapshot m_documentSnapshot;

View File

@@ -426,13 +426,13 @@ AssistInterface *InternalCompletionAssistProvider::createAssistInterface(
{
QTC_ASSERT(textEditorWidget, return 0);
CppModelManager *modelManager = CppModelManager::instance();
return new CppCompletionAssistInterface(filePath,
textEditorWidget,
BuiltinEditorDocumentParser::get(filePath),
languageFeatures,
position,
reason,
modelManager->workingCopy());
CppModelManager::instance()->workingCopy());
}
// -----------------
@@ -2187,11 +2187,11 @@ void CppCompletionAssistInterface::getCppSpecifics() const
return;
m_gotCppSpecifics = true;
if (BuiltinEditorDocumentParser *parser = BuiltinEditorDocumentParser::get(fileName())) {
parser->update(BuiltinEditorDocumentParser::InMemoryInfo(false));
m_snapshot = parser->snapshot();
m_headerPaths = parser->headerPaths();
if (Document::Ptr document = parser->document())
if (m_parser) {
m_parser->update(BuiltinEditorDocumentParser::InMemoryInfo(false));
m_snapshot = m_parser->snapshot();
m_headerPaths = m_parser->headerPaths();
if (Document::Ptr document = m_parser->document())
m_languageFeatures = document->languageFeatures();
else
m_languageFeatures = LanguageFeatures::defaultFeatures();

View File

@@ -31,6 +31,7 @@
#ifndef CPPCOMPLETIONASSIST_H
#define CPPCOMPLETIONASSIST_H
#include "builtineditordocumentparser.h"
#include "cppcompletionassistprocessor.h"
#include "cppcompletionassistprovider.h"
#include "cppmodelmanager.h"
@@ -171,11 +172,13 @@ class CppCompletionAssistInterface : public TextEditor::AssistInterface
public:
CppCompletionAssistInterface(const QString &filePath,
const TextEditor::TextEditorWidget *textEditorWidget,
BuiltinEditorDocumentParser::Ptr parser,
const CPlusPlus::LanguageFeatures &languageFeatures,
int position,
TextEditor::AssistReason reason,
const WorkingCopy &workingCopy)
: TextEditor::AssistInterface(textEditorWidget->document(), position, filePath, reason)
, m_parser(parser)
, m_gotCppSpecifics(false)
, m_workingCopy(workingCopy)
, m_languageFeatures(languageFeatures)
@@ -204,6 +207,7 @@ public:
private:
void getCppSpecifics() const;
BuiltinEditorDocumentParser::Ptr m_parser;
mutable bool m_gotCppSpecifics;
WorkingCopy m_workingCopy;
mutable CPlusPlus::Snapshot m_snapshot;

View File

@@ -910,7 +910,7 @@ void CppToolsPlugin::test_modelmanager_precompiled_headers()
QCOMPARE(Core::DocumentModel::openedDocuments().size(), 1);
QVERIFY(mm->isCppEditor(editor));
auto *parser = BuiltinEditorDocumentParser::get(fileName);
auto parser = BuiltinEditorDocumentParser::get(fileName);
QVERIFY(parser);
BaseEditorDocumentParser::Configuration config = parser->configuration();
config.usePrecompiledHeaders = true;
@@ -994,7 +994,7 @@ void CppToolsPlugin::test_modelmanager_defines_per_editor()
QVERIFY(mm->isCppEditor(editor));
const QString filePath = editor->document()->filePath().toString();
BaseEditorDocumentParser *parser = BaseEditorDocumentParser::get(filePath);
const auto parser = BaseEditorDocumentParser::get(filePath);
BaseEditorDocumentParser::Configuration config = parser->configuration();
config.editorDefines = editorDefines.toUtf8();
parser->setConfiguration(config);

View File

@@ -934,7 +934,7 @@ Qt::ItemFlags WatchItem::flags(int column) const
const Qt::ItemFlags editable = notEditable | Qt::ItemIsEditable;
if (state == InferiorUnrunnable)
return notEditable;
return (isWatcher() && column == 0 && iname.count('.') == 1) ? editable : notEditable;
if (isWatcher()) {
if (state != InferiorStopOk

View File

@@ -196,12 +196,12 @@ public:
}
// Compare
BuiltinEditorDocumentParser *cppDocumentParser = BuiltinEditorDocumentParser::get(cppFile);
const auto cppDocumentParser = BuiltinEditorDocumentParser::get(cppFile);
QVERIFY(cppDocumentParser);
const Document::Ptr cppDocument = cppDocumentParser->document();
QVERIFY(checkDiagsnosticMessages(cppDocument));
BuiltinEditorDocumentParser *hDocumentParser = BuiltinEditorDocumentParser::get(hFile);
const auto hDocumentParser = BuiltinEditorDocumentParser::get(hFile);
QVERIFY(hDocumentParser);
const Document::Ptr hDocument = hDocumentParser->document();
QVERIFY(checkDiagsnosticMessages(hDocument));

View File

@@ -560,8 +560,8 @@ void MercurialPlugin::showCommitWidget(const QList<VcsBaseClient::StatusItem> &s
QString branch = versionControl()->vcsTopic(m_submitRepository);
commitEditor->setFields(m_submitRepository, branch,
mercurialSettings.stringValue(MercurialSettings::userNameKey),
mercurialSettings.stringValue(MercurialSettings::userEmailKey), status);
m_client->settings().stringValue(MercurialSettings::userNameKey),
m_client->settings().stringValue(MercurialSettings::userEmailKey), status);
}
void MercurialPlugin::diffFromEditorSelected(const QStringList &files)

View File

@@ -135,7 +135,6 @@ private:
// Variables
static MercurialPlugin *m_instance;
MercurialSettings mercurialSettings;
OptionsPage *optionsPage;
MercurialClient *m_client;

View File

@@ -199,7 +199,9 @@ void BuildSettingsWidget::updateBuildSettings()
clearWidgets();
// update buttons
m_removeButton->setEnabled(m_target->buildConfigurations().size() > 1);
QList<BuildConfiguration *> bcs = m_target->buildConfigurations();
m_removeButton->setEnabled(bcs.size() > 1);
m_renameButton->setEnabled(!bcs.isEmpty());
if (!m_buildConfiguration)
return;
@@ -288,6 +290,7 @@ QString BuildSettingsWidget::uniqueName(const QString & name)
void BuildSettingsWidget::renameConfiguration()
{
QTC_ASSERT(m_buildConfiguration, return);
bool ok;
QString name = QInputDialog::getText(this, tr("Rename..."),
tr("New name for build configuration <b>%1</b>:").

View File

@@ -62,14 +62,17 @@ using namespace WinRt::Internal::Constants;
static QString extractToolchainPrefix(QString *compilerName)
{
QString prefix;
if (compilerName->endsWith(QLatin1String("-g++"))
|| compilerName->endsWith(QLatin1String("-clang++"))
|| compilerName->endsWith(QLatin1String("-gcc"))
|| compilerName->endsWith(QLatin1String("-clang"))) {
const QStringList candidates = { QLatin1String("g++"), QLatin1String("clang++"),
QLatin1String("gcc"), QLatin1String("clang") };
foreach (const QString &candidate, candidates) {
const QString suffix = Utils::HostOsInfo::withExecutableSuffix(QLatin1Char('-')
+ candidate);
if (compilerName->endsWith(suffix)) {
const int idx = compilerName->lastIndexOf(QLatin1Char('-')) + 1;
prefix = compilerName->left(idx);
compilerName->remove(0, idx);
}
}
return prefix;
}

View File

@@ -232,6 +232,8 @@ bool MakeStep::init()
}
}
QString relObjectsDir = QDir(pp->workingDirectory()).relativeFilePath(objectsDir);
if (relObjectsDir == QLatin1String("."))
relObjectsDir.clear();
if (!relObjectsDir.isEmpty())
relObjectsDir += QLatin1Char('/');
QString objectFile = relObjectsDir +

View File

@@ -394,7 +394,7 @@ public:
// should probably try to make it relatve to some import path, not to the document path
QString relativeDir = dir.relativeFilePath(path);
QString name = relativeDir.replace(QLatin1Char('/'), QLatin1Char('.'));
if (!name.isEmpty())
if (!name.isEmpty() && name != QLatin1String("."))
typeName.prepend(name + QLatin1Char('.'));
} else if (importInfo.isValid() && importInfo.type() == ImportType::QrcDirectory) {
QString path = QrcParser::normalizedQrcDirectoryPath(importInfo.path());

View File

@@ -89,7 +89,6 @@ public:
virtual bool eventFilter(QObject *o, QEvent *e);
private:
void finalizeRequest();
void proposalComputed();
void processProposalItem(AssistProposalItem *proposalItem);
void handlePrefixExpansion(const QString &newPrefix);
@@ -251,7 +250,7 @@ void CodeAssistantPrivate::requestProposal(AssistReason reason,
connect(m_requestRunner, &ProcessorRunner::finished,
this, &CodeAssistantPrivate::proposalComputed);
connect(m_requestRunner, &ProcessorRunner::finished,
this, &CodeAssistantPrivate::finalizeRequest);
m_requestRunner, &QObject::deleteLater);
connect(m_requestRunner, &ProcessorRunner::finished,
q, &CodeAssistant::finished);
assistInterface->prepareForAsyncUse();
@@ -383,12 +382,6 @@ void CodeAssistantPrivate::handlePrefixExpansion(const QString &newPrefix)
notifyChange();
}
void CodeAssistantPrivate::finalizeRequest()
{
if (ProcessorRunner *runner = qobject_cast<ProcessorRunner *>(sender()))
delete runner;
}
void CodeAssistantPrivate::finalizeProposal()
{
stopAutomaticProposalTimer();
@@ -550,6 +543,7 @@ CodeAssistant::CodeAssistant() : d(new CodeAssistantPrivate(this))
CodeAssistant::~CodeAssistant()
{
destroyContext();
delete d;
}

View File

@@ -409,6 +409,7 @@ private slots:
void undef();
void concat();
void excessive_nesting();
void multi_byte_code_point_in_expansion();
};
// Remove all #... lines, and 'simplify' string, to allow easily comparing the result
@@ -2064,6 +2065,26 @@ void tst_Preprocessor::excessive_nesting()
QCOMPARE(prep, output);
}
void tst_Preprocessor::multi_byte_code_point_in_expansion()
{
Environment env;
Preprocessor preprocess(0, &env);
const QByteArray input =
"#define FOO(x) x\n"
"FOO(arg" UC_U00FC "\n)\n";
const QByteArray actual = preprocess.run(QLatin1String("<stdin>"), input);
const QByteArray expected =
"# 1 \"<stdin>\"\n"
"\n"
"# expansion begin 17,3 2:4\n"
"arg" UC_U00FC "\n"
"# expansion end\n"
"# 4 \"<stdin>\"\n";
QCOMPARE(actual, expected);
}
void tst_Preprocessor::compare_input_output(bool keepComments)
{
QFETCH(QByteArray, input);

View File

@@ -3,7 +3,7 @@ include(../../../qttest.pri)
include($$IDE_SOURCE_TREE/src/rpath.pri)
DEFINES += QMLJS_BUILD_DIR
QT +=script xml
QT += qml xml
# direct dependency on qmljs for quicker turnaround when editing them
INCLUDEPATH+=$$IDE_SOURCE_TREE/src/libs
INCLUDEPATH+=$$IDE_SOURCE_TREE/src/libs/qmljs

View File

@@ -1,5 +1,5 @@
"filename"
"creator/README"
"creator/README.md"
"creator/qtcreator.pri"
"creator/tests/manual/qml/testfiles_quick2/views.qml"
"creator/share/qtcreator/glsl/glsl_120.frag"
1 filename
2 creator/README creator/README.md
3 creator/qtcreator.pri
4 creator/tests/manual/qml/testfiles_quick2/views.qml
5 creator/share/qtcreator/glsl/glsl_120.frag

View File

@@ -31,7 +31,8 @@
source("../../shared/qtcreator.py")
def main():
test.warning("This test is known to fail, see QTCREATORBUG-14828. Skipping it.")
if platform.system() == 'Darwin':
test.warning("This needs a Qt 5.4 kit. Skipping it.")
return
pathCreator = os.path.join(srcPath, "creator", "qtcreator.qbs")
if not neededFilePresent(pathCreator):
@@ -41,12 +42,19 @@ def main():
if not startedWithoutPluginError():
return
openQbsProject(pathCreator)
switchViewTo(ViewConstants.PROJECTS)
clickButton(waitForObject(":*Qt Creator.Add Kit_QPushButton"))
menuItem = Targets.getStringForTarget(Targets.DESKTOP_541_GCC)
activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1' "
"window=':Qt Creator_Core::Internal::MainWindow'}", menuItem))
switchToBuildOrRunSettingsFor(2, 1, ProjectSettings.BUILD)
switchViewTo(ViewConstants.EDIT)
test.log("Start parsing project")
naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='qtcreator( \[\S+\])?' type='QModelIndex'}"
ntwObject = waitForObject(naviTreeView)
rootNodeTemplate = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='%s( \[\S+\])?' type='QModelIndex'}"
ntwObject = waitForObject(rootNodeTemplate % "qtcreator.qbs")
if waitFor("ntwObject.model().rowCount(ntwObject) > 2", 200000): # No need to wait for C++-parsing
test.log("Parsing project done") # we only need the project
else:
test.warning("Parsing project timed out")
compareProjectTree(naviTreeView, "projecttree_creator.tsv")
compareProjectTree(rootNodeTemplate % "Qt Creator", "projecttree_creator.tsv")
invokeMenuItem("File", "Exit")

View File

@@ -31,7 +31,7 @@
source("../../shared/qtcreator.py")
def main():
pathReadme = srcPath + "/creator/README"
pathReadme = srcPath + "/creator/README.md"
if not neededFilePresent(pathReadme):
return