Merge remote-tracking branch 'origin/4.6'

Change-Id: I724da8f761275865e735e7dce10c3b2b2d99fe94
This commit is contained in:
Eike Ziller
2018-01-25 10:20:06 +01:00
53 changed files with 177 additions and 176 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

@@ -2565,7 +2565,7 @@ bool Parser::parseMemberSpecification(DeclarationAST *&node, ClassSpecifierAST *
case T_STATIC_ASSERT: case T_STATIC_ASSERT:
if (_languageFeatures.cxx11Enabled) if (_languageFeatures.cxx11Enabled)
CACHE_AND_RETURN(cacheKey, parseStaticAssertDeclaration(node)); CACHE_AND_RETURN(cacheKey, parseStaticAssertDeclaration(node));
// fall-through Q_FALLTHROUGH();
default: default:
CACHE_AND_RETURN(cacheKey, parseSimpleDeclaration(node, declaringClass)); CACHE_AND_RETURN(cacheKey, parseSimpleDeclaration(node, declaringClass));
@@ -3830,7 +3830,7 @@ bool Parser::parseBlockDeclaration(DeclarationAST *&node)
case T_STATIC_ASSERT: case T_STATIC_ASSERT:
if (_languageFeatures.cxx11Enabled) if (_languageFeatures.cxx11Enabled)
return parseStaticAssertDeclaration(node); return parseStaticAssertDeclaration(node);
// fall-through Q_FALLTHROUGH();
default: default:
return parseSimpleDeclaration(node); return parseSimpleDeclaration(node);
@@ -3914,7 +3914,7 @@ bool Parser::lookAtStorageClassSpecifier() const
case T_CONSTEXPR: case T_CONSTEXPR:
if (_languageFeatures.cxx11Enabled) if (_languageFeatures.cxx11Enabled)
return true; return true;
// fall-through Q_FALLTHROUGH();
default: default:
return false; return false;
} }
@@ -4514,7 +4514,7 @@ bool Parser::parsePrimaryExpression(ExpressionAST *&node)
case T_NULLPTR: case T_NULLPTR:
if (_languageFeatures.cxx11Enabled) if (_languageFeatures.cxx11Enabled)
return parsePointerLiteral(node); return parsePointerLiteral(node);
// fall-through Q_FALLTHROUGH();
case T_CHAR_LITERAL: // ### FIXME don't use NumericLiteral for chars case T_CHAR_LITERAL: // ### FIXME don't use NumericLiteral for chars
case T_WIDE_CHAR_LITERAL: case T_WIDE_CHAR_LITERAL:

View File

@@ -45,8 +45,7 @@ ClangCodeModelConnectionClient::ClangCodeModelConnectionClient(
: ConnectionClient(Utils::TemporaryDirectory::masterDirectoryPath() : ConnectionClient(Utils::TemporaryDirectory::masterDirectoryPath()
+ QStringLiteral("/ClangBackEnd-") + QStringLiteral("/ClangBackEnd-")
+ currentProcessId()), + currentProcessId()),
m_serverProxy(client, nullptr), m_serverProxy(client, nullptr)
m_client(client)
{ {
m_processCreator.setTemporaryDirectoryPattern("clangbackend-XXXXXX"); m_processCreator.setTemporaryDirectoryPattern("clangbackend-XXXXXX");
m_processCreator.setArguments({connectionName()}); m_processCreator.setArguments({connectionName()});

View File

@@ -45,7 +45,6 @@ protected:
private: private:
ClangCodeModelServerProxy m_serverProxy; ClangCodeModelServerProxy m_serverProxy;
ClangCodeModelClientInterface *m_client;
}; };
} // namespace ClangBackEnd } // namespace ClangBackEnd

View File

@@ -764,13 +764,13 @@ void DiagramController::removeObjects(MObject *modelObject)
DElement *diagramElement = findDelegate(modelObject, diagram); DElement *diagramElement = findDelegate(modelObject, diagram);
if (diagramElement) if (diagramElement)
removeElement(diagramElement, diagram); removeElement(diagramElement, diagram);
foreach (const Handle<MRelation> &relation, modelObject->relations()) { for (const Handle<MRelation> &relation : modelObject->relations()) {
DElement *diagramElement = findDelegate(relation.target(), diagram); DElement *diagramElement = findDelegate(relation.target(), diagram);
if (diagramElement) if (diagramElement)
removeElement(diagramElement, diagram); removeElement(diagramElement, diagram);
} }
} }
foreach (const Handle<MObject> &object, modelObject->children()) { for (const Handle<MObject> &object : modelObject->children()) {
if (object.hasTarget()) if (object.hasTarget())
removeObjects(object.target()); removeObjects(object.target());
} }

View File

@@ -45,7 +45,7 @@ void MChildrenVisitor::visitMElement(MElement *element)
void MChildrenVisitor::visitMObject(MObject *object) void MChildrenVisitor::visitMObject(MObject *object)
{ {
foreach (const Handle<MObject> &handle, object->children()) { for (const Handle<MObject> &handle : object->children()) {
MObject *child = handle.target(); MObject *child = handle.target();
if (child) if (child)
child->accept(this); child->accept(this);

View File

@@ -159,7 +159,7 @@ void MCloneDeepVisitor::visitMObject(const MObject *object)
visitMElement(object); visitMElement(object);
auto cloned = dynamic_cast<MObject *>(m_cloned); auto cloned = dynamic_cast<MObject *>(m_cloned);
QMT_ASSERT(cloned, return); QMT_ASSERT(cloned, return);
foreach (const Handle<MObject> &handle, object->children()) { for (const Handle<MObject> &handle : object->children()) {
if (handle.hasTarget()) { if (handle.hasTarget()) {
MCloneDeepVisitor visitor; MCloneDeepVisitor visitor;
handle.target()->accept(&visitor); handle.target()->accept(&visitor);
@@ -170,7 +170,7 @@ void MCloneDeepVisitor::visitMObject(const MObject *object)
cloned->addChild(handle.uid()); cloned->addChild(handle.uid());
} }
} }
foreach (const Handle<MRelation> &handle, object->relations()) { for (const Handle<MRelation> &handle : object->relations()) {
if (handle.hasTarget()) { if (handle.hasTarget()) {
MCloneDeepVisitor visitor; MCloneDeepVisitor visitor;
handle.target()->accept(&visitor); handle.target()->accept(&visitor);

View File

@@ -1060,9 +1060,9 @@ void ModelController::renewElementKey(MElement *element, QHash<Uid, Uid> *renewe
} }
auto object = dynamic_cast<MObject *>(element); auto object = dynamic_cast<MObject *>(element);
if (object) { if (object) {
foreach (const Handle<MObject> &child, object->children()) for (const Handle<MObject> &child : object->children())
renewElementKey(child.target(), renewedKeys); renewElementKey(child.target(), renewedKeys);
foreach (const Handle<MRelation> &relation, object->relations()) for (const Handle<MRelation> &relation : object->relations())
renewElementKey(relation.target(), renewedKeys); renewElementKey(relation.target(), renewedKeys);
} }
} }
@@ -1071,9 +1071,9 @@ void ModelController::renewElementKey(MElement *element, QHash<Uid, Uid> *renewe
void ModelController::updateRelationKeys(MElement *element, const QHash<Uid, Uid> &renewedKeys) void ModelController::updateRelationKeys(MElement *element, const QHash<Uid, Uid> &renewedKeys)
{ {
if (auto object = dynamic_cast<MObject *>(element)) { if (auto object = dynamic_cast<MObject *>(element)) {
foreach (const Handle<MRelation> &handle, object->relations()) for (const Handle<MRelation> &handle : object->relations())
updateRelationEndKeys(handle.target(), renewedKeys); updateRelationEndKeys(handle.target(), renewedKeys);
foreach (const Handle<MObject> &child, object->children()) for (const Handle<MObject> &child : object->children())
updateRelationKeys(child.target(), renewedKeys); updateRelationKeys(child.target(), renewedKeys);
} else if (auto relation = dynamic_cast<MRelation *>(element)) { } else if (auto relation = dynamic_cast<MRelation *>(element)) {
updateRelationEndKeys(relation, renewedKeys); updateRelationEndKeys(relation, renewedKeys);
@@ -1097,9 +1097,9 @@ void ModelController::mapObject(MObject *object)
if (object) { if (object) {
QMT_CHECK(!m_objectsMap.contains(object->uid())); QMT_CHECK(!m_objectsMap.contains(object->uid()));
m_objectsMap.insert(object->uid(), object); m_objectsMap.insert(object->uid(), object);
foreach (const Handle<MObject> &child, object->children()) for (const Handle<MObject> &child : object->children())
mapObject(child.target()); mapObject(child.target());
foreach (const Handle<MRelation> &relation, object->relations()) for (const Handle<MRelation> &relation : object->relations())
mapRelation(relation.target()); mapRelation(relation.target());
} }
} }
@@ -1108,9 +1108,9 @@ void ModelController::unmapObject(MObject *object)
{ {
if (object) { if (object) {
QMT_CHECK(m_objectsMap.contains(object->uid())); QMT_CHECK(m_objectsMap.contains(object->uid()));
foreach (const Handle<MRelation> &relation, object->relations()) for (const Handle<MRelation> &relation : object->relations())
unmapRelation(relation.target()); unmapRelation(relation.target());
foreach (const Handle<MObject> &child, object->children()) for (const Handle<MObject> &child : object->children())
unmapObject(child.target()); unmapObject(child.target());
m_objectsMap.remove(object->uid()); m_objectsMap.remove(object->uid());
} }
@@ -1209,7 +1209,7 @@ void ModelController::verifyModelIntegrity(const MObject *object, QHash<Uid, con
QMT_ASSERT(object, return); QMT_ASSERT(object, return);
QMT_ASSERT(!objectsMap->contains(object->uid()), return); QMT_ASSERT(!objectsMap->contains(object->uid()), return);
objectsMap->insert(object->uid(), object); objectsMap->insert(object->uid(), object);
foreach (const Handle<MRelation> &handle, object->relations()) { for (const Handle<MRelation> &handle : object->relations()) {
MRelation *relation = handle.target(); MRelation *relation = handle.target();
if (relation) { if (relation) {
QMT_ASSERT(!relationsMap->contains(relation->uid()), return); QMT_ASSERT(!relationsMap->contains(relation->uid()), return);
@@ -1222,7 +1222,7 @@ void ModelController::verifyModelIntegrity(const MObject *object, QHash<Uid, con
objectRelationsMap->insert(relation->endBUid(), relation); objectRelationsMap->insert(relation->endBUid(), relation);
} }
} }
foreach (const Handle<MObject> &handle, object->children()) { for (const Handle<MObject> &handle : object->children()) {
MObject *childObject = handle.target(); MObject *childObject = handle.target();
if (childObject) if (childObject)
verifyModelIntegrity(childObject, objectsMap, relationsMap, objectRelationsMap); verifyModelIntegrity(childObject, objectsMap, relationsMap, objectRelationsMap);

View File

@@ -755,14 +755,14 @@ void TreeModel::createChildren(const MObject *parentObject, ModelItem *parentIte
m_objectToItemMap.insert(parentObject, parentItem); m_objectToItemMap.insert(parentObject, parentItem);
QMT_CHECK(!m_itemToObjectMap.contains(parentItem)); QMT_CHECK(!m_itemToObjectMap.contains(parentItem));
m_itemToObjectMap.insert(parentItem, parentObject); m_itemToObjectMap.insert(parentItem, parentObject);
foreach (const Handle<MObject> &object, parentObject->children()) { for (const Handle<MObject> &object : parentObject->children()) {
if (object.hasTarget()) { if (object.hasTarget()) {
ModelItem *item = createItem(object.target()); ModelItem *item = createItem(object.target());
parentItem->appendRow(item); parentItem->appendRow(item);
createChildren(object.target(), item); createChildren(object.target(), item);
} }
} }
foreach (const Handle<MRelation> &handle, parentObject->relations()) { for (const Handle<MRelation> &handle : parentObject->relations()) {
if (handle.hasTarget()) { if (handle.hasTarget()) {
MRelation *relation = handle.target(); MRelation *relation = handle.target();
ModelItem *item = createItem(relation); ModelItem *item = createItem(relation);
@@ -780,7 +780,7 @@ void TreeModel::removeObjectFromItemMap(const MObject *object)
QMT_CHECK(m_itemToObjectMap.contains(item)); QMT_CHECK(m_itemToObjectMap.contains(item));
m_itemToObjectMap.remove(item); m_itemToObjectMap.remove(item);
m_objectToItemMap.remove(object); m_objectToItemMap.remove(object);
foreach (const Handle<MObject> &child, object->children()) { for (const Handle<MObject> &child : object->children()) {
if (child.hasTarget()) if (child.hasTarget())
removeObjectFromItemMap(child.target()); removeObjectFromItemMap(child.target());
} }

View File

@@ -504,7 +504,7 @@ MPackage *DiagramSceneController::findSuitableParentPackage(DElement *topmostDia
MDiagram *DiagramSceneController::findDiagramBySearchId(MPackage *package, const QString &diagramName) MDiagram *DiagramSceneController::findDiagramBySearchId(MPackage *package, const QString &diagramName)
{ {
QString diagramSearchId = NameController::calcElementNameSearchId(diagramName); QString diagramSearchId = NameController::calcElementNameSearchId(diagramName);
foreach (const Handle<MObject> &handle, package->children()) { for (const Handle<MObject> &handle : package->children()) {
if (handle.hasTarget()) { if (handle.hasTarget()) {
if (auto diagram = dynamic_cast<MDiagram *>(handle.target())) { if (auto diagram = dynamic_cast<MDiagram *>(handle.target())) {
if (NameController::calcElementNameSearchId(diagram->name()) == diagramSearchId) if (NameController::calcElementNameSearchId(diagram->name()) == diagramSearchId)
@@ -745,7 +745,7 @@ DObject *DiagramSceneController::addObject(MObject *modelObject, const QPointF &
if (dobject) { if (dobject) {
MObject *mobject = m_modelController->findObject(dobject->modelUid()); MObject *mobject = m_modelController->findObject(dobject->modelUid());
if (mobject) { if (mobject) {
foreach (const Handle<MRelation> &handle, mobject->relations()) { for (const Handle<MRelation> &handle : mobject->relations()) {
if (handle.hasTarget() if (handle.hasTarget()
&& ((handle.target()->endAUid() == modelObject->uid() && ((handle.target()->endAUid() == modelObject->uid()
&& handle.target()->endBUid() == mobject->uid()) && handle.target()->endBUid() == mobject->uid())
@@ -754,7 +754,7 @@ DObject *DiagramSceneController::addObject(MObject *modelObject, const QPointF &
addRelation(handle.target(), QList<QPointF>(), diagram); addRelation(handle.target(), QList<QPointF>(), diagram);
} }
} }
foreach (const Handle<MRelation> &handle, modelObject->relations()) { for (const Handle<MRelation> &handle : modelObject->relations()) {
if (handle.hasTarget() if (handle.hasTarget()
&& ((handle.target()->endAUid() == modelObject->uid() && ((handle.target()->endAUid() == modelObject->uid()
&& handle.target()->endBUid() == mobject->uid()) && handle.target()->endBUid() == mobject->uid())
@@ -769,7 +769,7 @@ DObject *DiagramSceneController::addObject(MObject *modelObject, const QPointF &
} }
// add all self relations // add all self relations
foreach (const Handle<MRelation> &handle, modelObject->relations()) { for (const Handle<MRelation> &handle : modelObject->relations()) {
if (handle.hasTarget () if (handle.hasTarget ()
&& handle.target()->endAUid() == modelObject->uid() && handle.target()->endAUid() == modelObject->uid()
&& handle.target()->endBUid() == modelObject->uid()) { && handle.target()->endBUid() == modelObject->uid()) {

View File

@@ -40,7 +40,7 @@ FindDiagramVisitor::~FindDiagramVisitor()
void FindDiagramVisitor::visitMObject(const MObject *object) void FindDiagramVisitor::visitMObject(const MObject *object)
{ {
foreach (const Handle<MObject> &child, object->children()) { for (const Handle<MObject> &child : object->children()) {
if (child.hasTarget()) { if (child.hasTarget()) {
if (auto diagram = dynamic_cast<MDiagram *>(child.target())) { if (auto diagram = dynamic_cast<MDiagram *>(child.target())) {
m_diagram = diagram; m_diagram = diagram;

View File

@@ -40,7 +40,7 @@ FindRootDiagramVisitor::~FindRootDiagramVisitor()
void FindRootDiagramVisitor::visitMObject(MObject *object) void FindRootDiagramVisitor::visitMObject(MObject *object)
{ {
// first search flat // first search flat
foreach(const Handle<MObject> &child, object->children()) { for (const Handle<MObject> &child : object->children()) {
if (child.hasTarget()) { if (child.hasTarget()) {
auto diagram = dynamic_cast<MDiagram *>(child.target()); auto diagram = dynamic_cast<MDiagram *>(child.target());
if (diagram) { if (diagram) {
@@ -50,7 +50,7 @@ void FindRootDiagramVisitor::visitMObject(MObject *object)
} }
} }
// then search in children // then search in children
foreach(const Handle<MObject> &child, object->children()) { for (const Handle<MObject> &child : object->children()) {
if (child.hasTarget()) { if (child.hasTarget()) {
child.target()->accept(this); child.target()->accept(this);
if (m_diagram) if (m_diagram)

View File

Before

Width:  |  Height:  |  Size: 270 B

After

Width:  |  Height:  |  Size: 270 B

View File

@@ -32,6 +32,8 @@
#include <QtCore/qvarlengtharray.h> #include <QtCore/qvarlengtharray.h>
#include <QtCore/qdebug.h> #include <QtCore/qdebug.h>
#include <utils/qtcfallthrough.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
Q_CORE_EXPORT double qstrtod(const char *s00, char const **se, bool *ok); Q_CORE_EXPORT double qstrtod(const char *s00, char const **se, bool *ok);
QT_END_NAMESPACE QT_END_NAMESPACE
@@ -759,7 +761,7 @@ again:
u = QLatin1Char('\0'); u = QLatin1Char('\0');
break; break;
} }
// fall through Q_FALLTHROUGH();
case '1': case '1':
case '2': case '2':
case '3': case '3':

View File

@@ -30,6 +30,8 @@
#include <QTextBlock> #include <QTextBlock>
#include <QTextDocument> #include <QTextDocument>
#include <utils/qtcfallthrough.h>
static Q_LOGGING_CATEGORY(formatterLog, "qtc.qmljs.formatter") static Q_LOGGING_CATEGORY(formatterLog, "qtc.qmljs.formatter")
namespace QmlJS { namespace QmlJS {
@@ -278,7 +280,7 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
enter(expression_continuation); enter(expression_continuation);
break; break;
} }
// fallthrough Q_FALLTHROUGH();
case ternary_op_after_colon: case ternary_op_after_colon:
case expression: case expression:
if (tryInsideExpression()) if (tryInsideExpression())
@@ -1142,7 +1144,7 @@ void QtStyleCodeFormatter::onEnter(int newState, int *indentDepth, int *savedInd
*savedIndentDepth = parentState.savedIndentDepth; *savedIndentDepth = parentState.savedIndentDepth;
break; break;
} }
// fallthrough Q_FALLTHROUGH();
case substatement_open: case substatement_open:
// special case for "foo: {" and "property int foo: {" // special case for "foo: {" and "property int foo: {"
if (parentState.type == binding_assignment) if (parentState.type == binding_assignment)

View File

@@ -29,6 +29,8 @@
#include "qmljsvalueowner.h" #include "qmljsvalueowner.h"
#include "parser/qmljsast_p.h" #include "parser/qmljsast_p.h"
#include <utils/qtcfallthrough.h>
using namespace QmlJS; using namespace QmlJS;
/*! /*!
@@ -444,7 +446,7 @@ bool Evaluate::visit(AST::BinaryExpression *ast)
//case QSOperator::And: // ### enable once implemented below //case QSOperator::And: // ### enable once implemented below
//case QSOperator::Or: //case QSOperator::Or:
lhs = value(ast->left); lhs = value(ast->left);
// fallthrough Q_FALLTHROUGH();
case QSOperator::Assign: case QSOperator::Assign:
rhs = value(ast->right); rhs = value(ast->right);
break; break;

View File

@@ -37,6 +37,7 @@
#include <cplusplus/cppmodelmanagerbase.h> #include <cplusplus/cppmodelmanagerbase.h>
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <utils/qtcfallthrough.h>
#include <utils/runextensions.h> #include <utils/runextensions.h>
#include <QDir> #include <QDir>
@@ -1391,7 +1392,7 @@ ViewerContext ModelManagerInterface::completeVContext(const ViewerContext &vCtx,
break; break;
case ViewerContext::AddAllPathsAndDefaultSelectors: case ViewerContext::AddAllPathsAndDefaultSelectors:
res.selectors.append(defaultVCtx.selectors); res.selectors.append(defaultVCtx.selectors);
// fallthrough Q_FALLTHROUGH();
case ViewerContext::AddAllPaths: case ViewerContext::AddAllPaths:
{ {
foreach (const QString &path, defaultVCtx.paths) foreach (const QString &path, defaultVCtx.paths)
@@ -1400,10 +1401,10 @@ ViewerContext ModelManagerInterface::completeVContext(const ViewerContext &vCtx,
case Dialect::AnyLanguage: case Dialect::AnyLanguage:
case Dialect::Qml: case Dialect::Qml:
res.maybeAddPath(info.qtQmlPath); res.maybeAddPath(info.qtQmlPath);
// fallthrough Q_FALLTHROUGH();
case Dialect::QmlQtQuick1: case Dialect::QmlQtQuick1:
res.maybeAddPath(info.qtImportsPath); res.maybeAddPath(info.qtImportsPath);
// fallthrough Q_FALLTHROUGH();
case Dialect::QmlQtQuick2: case Dialect::QmlQtQuick2:
case Dialect::QmlQtQuick2Ui: case Dialect::QmlQtQuick2Ui:
{ {
@@ -1439,7 +1440,7 @@ ViewerContext ModelManagerInterface::completeVContext(const ViewerContext &vCtx,
} }
case ViewerContext::AddDefaultPathsAndSelectors: case ViewerContext::AddDefaultPathsAndSelectors:
res.selectors.append(defaultVCtx.selectors); res.selectors.append(defaultVCtx.selectors);
// fallthrough Q_FALLTHROUGH();
case ViewerContext::AddDefaultPaths: case ViewerContext::AddDefaultPaths:
foreach (const QString &path, defaultVCtx.paths) foreach (const QString &path, defaultVCtx.paths)
res.maybeAddPath(path); res.maybeAddPath(path);

View File

@@ -277,6 +277,8 @@ bool GTestTreeItem::modify(const TestParseResult *result)
TestTreeItem *GTestTreeItem::createParentGroupNode() const TestTreeItem *GTestTreeItem::createParentGroupNode() const
{ {
if (type() != TestCase)
return nullptr;
const QFileInfo fileInfo(filePath()); const QFileInfo fileInfo(filePath());
const QFileInfo base(fileInfo.absolutePath()); const QFileInfo base(fileInfo.absolutePath());
return new GTestTreeItem(base.baseName(), fileInfo.absolutePath(), TestTreeItem::GroupNode); return new GTestTreeItem(base.baseName(), fileInfo.absolutePath(), TestTreeItem::GroupNode);

View File

@@ -42,6 +42,7 @@
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/mapreduce.h> #include <utils/mapreduce.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/qtcfallthrough.h>
#include <utils/runextensions.h> #include <utils/runextensions.h>
#include <QDirIterator> #include <QDirIterator>
@@ -276,7 +277,7 @@ bool TestCodeParser::postponed(const QStringList &fileList)
m_reparseTimer.start(); m_reparseTimer.start();
return true; return true;
} }
// intentional fall-through Q_FALLTHROUGH();
default: default:
m_postponedFiles.insert(fileList.first()); m_postponedFiles.insert(fileList.first());
m_reparseTimer.stop(); m_reparseTimer.stop();

View File

@@ -70,11 +70,9 @@ static QString backendProcessPath()
namespace ClangCodeModel { namespace ClangCodeModel {
namespace Internal { namespace Internal {
class DummyBackendSender : public BackendSender class DummyBackendSender : public ClangBackEnd::ClangCodeModelServerInterface
{ {
public: public:
DummyBackendSender() : BackendSender(nullptr) {}
void end() override {} void end() override {}
void registerTranslationUnitsForEditor(const RegisterTranslationUnitForEditorMessage &) override {} void registerTranslationUnitsForEditor(const RegisterTranslationUnitForEditorMessage &) override {}
void updateTranslationUnitsForEditor(const UpdateTranslationUnitsForEditorMessage &) override {} void updateTranslationUnitsForEditor(const UpdateTranslationUnitsForEditorMessage &) override {}
@@ -87,10 +85,10 @@ public:
void requestDocumentAnnotations(const RequestDocumentAnnotationsMessage &) override {} void requestDocumentAnnotations(const RequestDocumentAnnotationsMessage &) override {}
void requestReferences(const RequestReferencesMessage &) override {} void requestReferences(const RequestReferencesMessage &) override {}
void requestFollowSymbol(const RequestFollowSymbolMessage &) override {} void requestFollowSymbol(const RequestFollowSymbolMessage &) override {}
void requestToolTip(const RequestToolTipMessage &) override {}
void updateVisibleTranslationUnits(const UpdateVisibleTranslationUnitsMessage &) override {} void updateVisibleTranslationUnits(const UpdateVisibleTranslationUnitsMessage &) override {}
}; };
BackendCommunicator::BackendCommunicator() BackendCommunicator::BackendCommunicator()
: m_connection(&m_receiver) : m_connection(&m_receiver)
, m_sender(new DummyBackendSender()) , m_sender(new DummyBackendSender())
@@ -521,20 +519,6 @@ void BackendCommunicator::initializeBackendWithCurrentData()
registerCurrentCodeModelUiHeaders(); registerCurrentCodeModelUiHeaders();
restoreCppEditorDocuments(); restoreCppEditorDocuments();
updateTranslationUnitVisiblity(); updateTranslationUnitVisiblity();
emit backendReinitialized();
}
BackendSender *BackendCommunicator::setBackendSender(BackendSender *sender)
{
BackendSender *previousSender = m_sender.take();
m_sender.reset(sender);
return previousSender;
}
void BackendCommunicator::killBackendProcess()
{
m_connection.processForTestOnly()->kill();
} }
void BackendCommunicator::registerTranslationUnitsForEditor(const FileContainers &fileContainers) void BackendCommunicator::registerTranslationUnitsForEditor(const FileContainers &fileContainers)

View File

@@ -113,13 +113,6 @@ public:
bool isNotWaitingForCompletion() const; bool isNotWaitingForCompletion() const;
public: // for tests
BackendSender *setBackendSender(BackendSender *sender);
void killBackendProcess();
signals: // for tests
void backendReinitialized();
private: private:
void initializeBackend(); void initializeBackend();
void initializeBackendWithCurrentData(); void initializeBackendWithCurrentData();
@@ -147,7 +140,7 @@ private:
BackendReceiver m_receiver; BackendReceiver m_receiver;
ClangBackEnd::ClangCodeModelConnectionClient m_connection; ClangBackEnd::ClangCodeModelConnectionClient m_connection;
QTimer m_backendStartTimeOut; QTimer m_backendStartTimeOut;
QScopedPointer<BackendSender> m_sender; QScopedPointer<ClangBackEnd::ClangCodeModelServerInterface> m_sender;
int m_connectedCount = 0; int m_connectedCount = 0;
}; };

View File

@@ -141,10 +141,5 @@ void BackendSender::updateVisibleTranslationUnits(const UpdateVisibleTranslation
m_connection->serverProxy().updateVisibleTranslationUnits(message); m_connection->serverProxy().updateVisibleTranslationUnits(message);
} }
bool BackendSender::isConnected() const
{
return m_connection && m_connection->isConnected();
}
} // namespace Internal } // namespace Internal
} // namespace ClangCodeModel } // namespace ClangCodeModel

View File

@@ -52,9 +52,6 @@ public:
void requestFollowSymbol(const ClangBackEnd::RequestFollowSymbolMessage &message) override; void requestFollowSymbol(const ClangBackEnd::RequestFollowSymbolMessage &message) override;
void updateVisibleTranslationUnits(const ClangBackEnd::UpdateVisibleTranslationUnitsMessage &message) override; void updateVisibleTranslationUnits(const ClangBackEnd::UpdateVisibleTranslationUnitsMessage &message) override;
private:
bool isConnected() const;
private: private:
ClangBackEnd::ClangCodeModelConnectionClient *m_connection = nullptr; ClangBackEnd::ClangCodeModelConnectionClient *m_connection = nullptr;
}; };

View File

@@ -54,6 +54,7 @@
#include <utils/textutils.h> #include <utils/textutils.h>
#include <utils/mimetypes/mimedatabase.h> #include <utils/mimetypes/mimedatabase.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/qtcfallthrough.h>
#include <QDirIterator> #include <QDirIterator>
#include <QTextDocument> #include <QTextDocument>
@@ -242,7 +243,7 @@ IAssistProposal *ClangCompletionAssistProcessor::startCompletionHelper()
case ClangCompletionContextAnalyzer::CompleteSlot: case ClangCompletionContextAnalyzer::CompleteSlot:
modifiedFileContent = modifyInput(m_interface->textDocument(), modifiedFileContent = modifyInput(m_interface->textDocument(),
analyzer.positionEndOfExpression()); analyzer.positionEndOfExpression());
// Fall through! Q_FALLTHROUGH();
case ClangCompletionContextAnalyzer::PassThroughToLibClang: { case ClangCompletionContextAnalyzer::PassThroughToLibClang: {
m_addSnippets = m_completionOperator == T_EOF_SYMBOL; m_addSnippets = m_completionOperator == T_EOF_SYMBOL;
m_sentRequestType = NormalCompletion; m_sentRequestType = NormalCompletion;

View File

@@ -32,6 +32,7 @@
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/qtcfallthrough.h>
namespace ClangStaticAnalyzer { namespace ClangStaticAnalyzer {
namespace Internal { namespace Internal {
@@ -100,22 +101,26 @@ QList<Diagnostic> LogFileReader::read(const QString &filePath, QString *errorMes
if (errorMessage) { if (errorMessage) {
*errorMessage = tr("Could not read file \"%1\": UnexpectedElementError.") *errorMessage = tr("Could not read file \"%1\": UnexpectedElementError.")
.arg(filePath); .arg(filePath);
} // fall-through }
Q_FALLTHROUGH();
case QXmlStreamReader::CustomError: case QXmlStreamReader::CustomError:
if (errorMessage) { if (errorMessage) {
*errorMessage = tr("Could not read file \"%1\": CustomError.") *errorMessage = tr("Could not read file \"%1\": CustomError.")
.arg(filePath); .arg(filePath);
} // fall-through }
Q_FALLTHROUGH();
case QXmlStreamReader::NotWellFormedError: case QXmlStreamReader::NotWellFormedError:
if (errorMessage) { if (errorMessage) {
*errorMessage = tr("Could not read file \"%1\": NotWellFormedError.") *errorMessage = tr("Could not read file \"%1\": NotWellFormedError.")
.arg(filePath); .arg(filePath);
} // fall-through }
Q_FALLTHROUGH();
case QXmlStreamReader::PrematureEndOfDocumentError: case QXmlStreamReader::PrematureEndOfDocumentError:
if (errorMessage) { if (errorMessage) {
*errorMessage = tr("Could not read file \"%1\": PrematureEndOfDocumentError.") *errorMessage = tr("Could not read file \"%1\": PrematureEndOfDocumentError.")
.arg(filePath); .arg(filePath);
} // fall-through }
Q_FALLTHROUGH();
default: default:
return emptyList; return emptyList;
} }

View File

@@ -29,6 +29,7 @@
#include <cplusplus/Lexer.h> #include <cplusplus/Lexer.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/qtcfallthrough.h>
#include <QDebug> #include <QDebug>
#include <QMetaEnum> #include <QMetaEnum>
@@ -848,7 +849,7 @@ bool CodeFormatter::tryDeclaration()
return true; return true;
} }
} }
// fallthrough Q_FALLTHROUGH();
case T_CHAR: case T_CHAR:
case T_CHAR16_T: case T_CHAR16_T:
case T_CHAR32_T: case T_CHAR32_T:
@@ -1231,7 +1232,7 @@ void QtStyleCodeFormatter::onEnter(int newState, int *indentDepth, int *savedInd
case assign_open: case assign_open:
if (parentState.type == assign_open_or_initializer) if (parentState.type == assign_open_or_initializer)
break; break;
// fallthrough Q_FALLTHROUGH();
case assign_open_or_initializer: case assign_open_or_initializer:
if (!lastToken && m_styleSettings.alignAssignments) if (!lastToken && m_styleSettings.alignAssignments)
*paddingDepth = nextTokenPosition-*indentDepth; *paddingDepth = nextTokenPosition-*indentDepth;

View File

@@ -29,6 +29,8 @@
#include "cpptoolssettings.h" #include "cpptoolssettings.h"
#include "cppcodestylepreferences.h" #include "cppcodestylepreferences.h"
#include <utils/qtcfallthrough.h>
#include <QChar> #include <QChar>
#include <QTextDocument> #include <QTextDocument>
#include <QTextBlock> #include <QTextBlock>
@@ -79,7 +81,7 @@ static bool isElectricInLine(const QChar ch, const QString &text)
return true; return true;
} }
// fall-through Q_FALLTHROUGH();
// lines that start with : might have a constructor initializer list // lines that start with : might have a constructor initializer list
case '<': case '<':
case '>': { case '>': {

View File

@@ -27,6 +27,8 @@
#include "demanglerexceptions.h" #include "demanglerexceptions.h"
#include "../../../libs/utils/qtcfallthrough.h"
#include <iostream> #include <iostream>
#include <cctype> #include <cctype>
#include <cstring> #include <cstring>
@@ -1293,25 +1295,29 @@ void ExprPrimaryNode::parse()
switch (typeNode->type()) { switch (typeNode->type()) {
case BuiltinTypeNode::UnsignedShortType: case BuiltinTypeNode::UnsignedShortType:
case BuiltinTypeNode::UnsignedIntType: case BuiltinTypeNode::UnsignedIntType:
m_suffix = "U"; // Fall-through. m_suffix = "U";
Q_FALLTHROUGH();
case BuiltinTypeNode::SignedShortType: case BuiltinTypeNode::SignedShortType:
case BuiltinTypeNode::SignedIntType: case BuiltinTypeNode::SignedIntType:
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NumberNode); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NumberNode);
break; break;
case BuiltinTypeNode::UnsignedLongType: case BuiltinTypeNode::UnsignedLongType:
m_suffix = "U"; // Fall-through. m_suffix = "U";
Q_FALLTHROUGH();
case BuiltinTypeNode::SignedLongType: case BuiltinTypeNode::SignedLongType:
m_suffix = "L"; m_suffix = "L";
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NumberNode); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NumberNode);
break; break;
case BuiltinTypeNode::UnsignedLongLongType: case BuiltinTypeNode::UnsignedLongLongType:
m_suffix = "U"; // Fall-through. m_suffix = "U";
Q_FALLTHROUGH();
case BuiltinTypeNode::SignedLongLongType: case BuiltinTypeNode::SignedLongLongType:
m_suffix = "LL"; m_suffix = "LL";
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NumberNode); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NumberNode);
break; break;
case BuiltinTypeNode::FloatType: case BuiltinTypeNode::FloatType:
m_suffix = "f"; // Fall-through. m_suffix = "f";
Q_FALLTHROUGH();
case BuiltinTypeNode::DoubleType: case BuiltinTypeNode::DoubleType:
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(FloatValueNode); PARSE_RULE_AND_ADD_RESULT_AS_CHILD(FloatValueNode);
break; break;

View File

@@ -60,6 +60,7 @@
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/qtcfallthrough.h>
#include <QDebug> #include <QDebug>
#include <QFile> #include <QFile>
@@ -5662,7 +5663,7 @@ bool FakeVimHandler::Private::handleExMapCommand(const ExCommand &cmd0) // :map
foreach (char c, modes) foreach (char c, modes)
MappingsIterator(&g.mappings, c, key).remove(); MappingsIterator(&g.mappings, c, key).remove();
break; break;
case Map: // fall through case Map: Q_FALLTHROUGH();
case Noremap: { case Noremap: {
Inputs inputs(rhs, type == Noremap, silent); Inputs inputs(rhs, type == Noremap, silent);
foreach (char c, modes) foreach (char c, modes)

View File

@@ -287,6 +287,7 @@ void LocalHelpManager::setupGuiHelpEngine()
if (m_needsCollectionFile) { if (m_needsCollectionFile) {
m_needsCollectionFile = false; m_needsCollectionFile = false;
helpEngine().setCollectionFile(Core::HelpManager::collectionFilePath()); helpEngine().setCollectionFile(Core::HelpManager::collectionFilePath());
m_guiNeedsSetup = true;
} }
if (m_guiNeedsSetup) { if (m_guiNeedsSetup) {

View File

@@ -26,6 +26,7 @@
#include "abi.h" #include "abi.h"
#include <utils/fileutils.h> #include <utils/fileutils.h>
#include <utils/qtcfallthrough.h>
#include <QDebug> #include <QDebug>
#include <QtEndian> #include <QtEndian>
@@ -50,6 +51,27 @@ namespace ProjectExplorer {
// Helpers // Helpers
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
static Abi::Architecture architectureFromQt()
{
const QString arch = QSysInfo::buildCpuArchitecture();
if (arch.startsWith("arm"))
return Abi::ArmArchitecture;
if (arch.startsWith("x86") || arch == "i386")
return Abi::X86Architecture;
if (arch == "ia64")
return Abi::ItaniumArchitecture;
if (arch.startsWith("mips"))
return Abi::MipsArchitecture;
if (arch.startsWith("power"))
return Abi::PowerPCArchitecture;
if (arch.startsWith("sh")) // Not in Qt documentation!
return Abi::ShArchitecture;
if (arch.startsWith("avr")) // Not in Qt documentation!
return Abi::AvrArchitecture;
return Abi::UnknownArchitecture;
}
static quint8 getUint8(const QByteArray &data, int pos) static quint8 getUint8(const QByteArray &data, int pos)
{ {
return static_cast<quint8>(data.at(pos)); return static_cast<quint8>(data.at(pos));
@@ -681,7 +703,8 @@ QString Abi::toString(const Architecture &a)
return QLatin1String("itanium"); return QLatin1String("itanium");
case ShArchitecture: case ShArchitecture:
return QLatin1String("sh"); return QLatin1String("sh");
case UnknownArchitecture: // fall through! case UnknownArchitecture:
Q_FALLTHROUGH();
default: default:
return QLatin1String("unknown"); return QLatin1String("unknown");
} }
@@ -706,7 +729,8 @@ QString Abi::toString(const OS &o)
return QLatin1String("qnx"); return QLatin1String("qnx");
case BareMetalOS: case BareMetalOS:
return QLatin1String("baremetal"); return QLatin1String("baremetal");
case UnknownOS: // fall through! case UnknownOS:
Q_FALLTHROUGH();
default: default:
return QLatin1String("unknown"); return QLatin1String("unknown");
}; };
@@ -754,7 +778,8 @@ QString Abi::toString(const OSFlavor &of)
case GenericQnxFlavor: case GenericQnxFlavor:
case GenericBareMetalFlavor: case GenericBareMetalFlavor:
return QLatin1String("generic"); return QLatin1String("generic");
case UnknownFlavor: // fall through! case UnknownFlavor:
Q_FALLTHROUGH();
default: default:
return QLatin1String("unknown"); return QLatin1String("unknown");
} }
@@ -771,7 +796,8 @@ QString Abi::toString(const BinaryFormat &bf)
return QLatin1String("mach_o"); return QLatin1String("mach_o");
case RuntimeQmlFormat: case RuntimeQmlFormat:
return QLatin1String("qml_rt"); return QLatin1String("qml_rt");
case UnknownFormat: // fall through! case UnknownFormat:
Q_FALLTHROUGH();
default: default:
return QLatin1String("unknown"); return QLatin1String("unknown");
} }
@@ -835,7 +861,7 @@ Abi::OSFlavor Abi::flavorForMsvcVersion(int version)
Abi Abi::hostAbi() Abi Abi::hostAbi()
{ {
Architecture arch = QTC_CPU; // define set by qmake Architecture arch = architectureFromQt();
OS os = UnknownOS; OS os = UnknownOS;
OSFlavor subos = UnknownFlavor; OSFlavor subos = UnknownFlavor;
BinaryFormat format = UnknownFormat; BinaryFormat format = UnknownFormat;

View File

@@ -96,7 +96,8 @@ public:
Utils::FileName targetFilePath(const QString &targetName) { Utils::FileName targetFilePath(const QString &targetName) {
return Utils::findOrDefault(list, [&targetName](const BuildTargetInfo &ti) { return Utils::findOrDefault(list, [&targetName](const BuildTargetInfo &ti) {
return ti.targetName == targetName; return ti.targetName == targetName
|| ti.projectFilePath.toString() == targetName;
}).targetFilePath; }).targetFilePath;
} }

View File

@@ -332,11 +332,4 @@ journald {
RESOURCES += projectexplorer.qrc RESOURCES += projectexplorer.qrc
# Some way to override the architecture used in Abi:
!isEmpty($$(QTC_CPU)) {
DEFINES += QTC_CPU=$$(QTC_CPU)
} else {
DEFINES += QTC_CPU=X86Architecture
}
DEFINES += PROJECTEXPLORER_LIBRARY DEFINES += PROJECTEXPLORER_LIBRARY

View File

@@ -15,8 +15,6 @@ Project {
Depends { name: "TextEditor" } Depends { name: "TextEditor" }
Depends { name: "app_version_header" } Depends { name: "app_version_header" }
cpp.defines: base.concat("QTC_CPU=X86Architecture")
Group { Group {
name: "General" name: "General"
files: [ files: [

View File

@@ -385,9 +385,9 @@ public:
if (m_activeSwitchToRect.contains(pos)) if (m_activeSwitchToRect.contains(pos))
sessionModel->switchToSession(sessionName); sessionModel->switchToSession(sessionName);
else if (m_activeActionRects[0].contains(pos)) else if (m_activeActionRects[0].contains(pos))
sessionModel->cloneSession(sessionName); sessionModel->cloneSession(ICore::mainWindow(), sessionName);
else if (m_activeActionRects[1].contains(pos)) else if (m_activeActionRects[1].contains(pos))
sessionModel->renameSession(sessionName); sessionModel->renameSession(ICore::mainWindow(), sessionName);
else if (m_activeActionRects[2].contains(pos)) else if (m_activeActionRects[2].contains(pos))
sessionModel->deleteSession(sessionName); sessionModel->deleteSession(sessionName);
return true; return true;

View File

@@ -59,7 +59,7 @@ class SessionNameInputDialog : public QDialog
Q_OBJECT Q_OBJECT
public: public:
explicit SessionNameInputDialog(QWidget *parent = nullptr); explicit SessionNameInputDialog(QWidget *parent);
void setActionText(const QString &actionText, const QString &openActionText); void setActionText(const QString &actionText, const QString &openActionText);
void setValue(const QString &value); void setValue(const QString &value);

View File

@@ -186,9 +186,9 @@ void SessionModel::resetSessions()
endResetModel(); endResetModel();
} }
void SessionModel::newSession() void SessionModel::newSession(QWidget *parent)
{ {
SessionNameInputDialog sessionInputDialog; SessionNameInputDialog sessionInputDialog(parent);
sessionInputDialog.setWindowTitle(tr("New Session Name")); sessionInputDialog.setWindowTitle(tr("New Session Name"));
sessionInputDialog.setActionText(tr("&Create"), tr("Create and &Open")); sessionInputDialog.setActionText(tr("&Create"), tr("Create and &Open"));
@@ -197,9 +197,9 @@ void SessionModel::newSession()
}); });
} }
void SessionModel::cloneSession(const QString &session) void SessionModel::cloneSession(QWidget *parent, const QString &session)
{ {
SessionNameInputDialog sessionInputDialog; SessionNameInputDialog sessionInputDialog(parent);
sessionInputDialog.setWindowTitle(tr("New Session Name")); sessionInputDialog.setWindowTitle(tr("New Session Name"));
sessionInputDialog.setActionText(tr("&Clone"), tr("Clone and &Open")); sessionInputDialog.setActionText(tr("&Clone"), tr("Clone and &Open"));
sessionInputDialog.setValue(session + " (2)"); sessionInputDialog.setValue(session + " (2)");
@@ -218,9 +218,9 @@ void SessionModel::deleteSession(const QString &session)
endResetModel(); endResetModel();
} }
void SessionModel::renameSession(const QString &session) void SessionModel::renameSession(QWidget *parent, const QString &session)
{ {
SessionNameInputDialog sessionInputDialog; SessionNameInputDialog sessionInputDialog(parent);
sessionInputDialog.setWindowTitle(tr("Rename Session")); sessionInputDialog.setWindowTitle(tr("Rename Session"));
sessionInputDialog.setActionText(tr("&Rename"), tr("Rename and &Open")); sessionInputDialog.setActionText(tr("&Rename"), tr("Rename and &Open"));
sessionInputDialog.setValue(session); sessionInputDialog.setValue(session);

View File

@@ -70,10 +70,10 @@ signals:
public slots: public slots:
void resetSessions(); void resetSessions();
void newSession(); void newSession(QWidget *parent);
void cloneSession(const QString &session); void cloneSession(QWidget *parent, const QString &session);
void deleteSession(const QString &session); void deleteSession(const QString &session);
void renameSession(const QString &session); void renameSession(QWidget *parent, const QString &session);
void switchToSession(const QString &session); void switchToSession(const QString &session);
private: private:

View File

@@ -89,7 +89,7 @@ SessionView::SessionView(QWidget *parent)
void SessionView::createNewSession() void SessionView::createNewSession()
{ {
m_sessionModel.newSession(); m_sessionModel.newSession(this);
} }
void SessionView::deleteCurrentSession() void SessionView::deleteCurrentSession()
@@ -99,12 +99,12 @@ void SessionView::deleteCurrentSession()
void SessionView::cloneCurrentSession() void SessionView::cloneCurrentSession()
{ {
m_sessionModel.cloneSession(currentSession()); m_sessionModel.cloneSession(this, currentSession());
} }
void SessionView::renameCurrentSession() void SessionView::renameCurrentSession()
{ {
m_sessionModel.renameSession(currentSession()); m_sessionModel.renameSession(this, currentSession());
} }
void SessionView::switchToCurrentSession() void SessionView::switchToCurrentSession()

View File

@@ -74,63 +74,49 @@ static QString extractToolchainPrefix(QString *compilerName)
return prefix; return prefix;
} }
static QStringList targetOSList(const ProjectExplorer::Abi &abi, const ProjectExplorer::Kit *k) static QString targetPlatform(const ProjectExplorer::Abi &abi, const ProjectExplorer::Kit *k)
{ {
const Core::Id device = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(k); const Core::Id device = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(k);
QStringList os;
switch (abi.os()) { switch (abi.os()) {
case ProjectExplorer::Abi::WindowsOS: case ProjectExplorer::Abi::WindowsOS:
if (device == WINRT_DEVICE_TYPE_LOCAL || return QLatin1String("windows");
device == WINRT_DEVICE_TYPE_PHONE ||
device == WINRT_DEVICE_TYPE_EMULATOR) {
os << QLatin1String("winrt");
} else if (abi.osFlavor() == ProjectExplorer::Abi::WindowsCEFlavor) {
os << QLatin1String("windowsce");
}
os << QLatin1String("windows");
break;
case ProjectExplorer::Abi::DarwinOS: case ProjectExplorer::Abi::DarwinOS:
if (device == DESKTOP_DEVICE_TYPE) if (device == DESKTOP_DEVICE_TYPE)
os << QLatin1String("macos") << QLatin1String("osx"); return QLatin1String("macos");
else if (device == IOS_DEVICE_TYPE) if (device == IOS_DEVICE_TYPE)
os << QLatin1String("ios"); return QLatin1String("ios");
else if (device == IOS_SIMULATOR_TYPE) if (device == IOS_SIMULATOR_TYPE)
os << QLatin1String("ios-simulator") << QLatin1String("ios"); return QLatin1String("ios-simulator");
os << QLatin1String("darwin") << QLatin1String("bsd") << QLatin1String("unix"); return QLatin1String("darwin");
break;
case ProjectExplorer::Abi::LinuxOS: case ProjectExplorer::Abi::LinuxOS:
if (abi.osFlavor() == ProjectExplorer::Abi::AndroidLinuxFlavor) if (abi.osFlavor() == ProjectExplorer::Abi::AndroidLinuxFlavor)
os << QLatin1String("android"); return QLatin1String("android");
os << QLatin1String("linux") << QLatin1String("unix"); return QLatin1String("linux");
break;
case ProjectExplorer::Abi::BsdOS: case ProjectExplorer::Abi::BsdOS:
switch (abi.osFlavor()) { switch (abi.osFlavor()) {
case ProjectExplorer::Abi::FreeBsdFlavor: case ProjectExplorer::Abi::FreeBsdFlavor:
os << QLatin1String("freebsd"); return QLatin1String("freebsd");
break;
case ProjectExplorer::Abi::NetBsdFlavor: case ProjectExplorer::Abi::NetBsdFlavor:
os << QLatin1String("netbsd"); return QLatin1String("netbsd");
break;
case ProjectExplorer::Abi::OpenBsdFlavor: case ProjectExplorer::Abi::OpenBsdFlavor:
os << QLatin1String("openbsd"); return QLatin1String("openbsd");
break;
default: default:
break; break;
} }
os << QLatin1String("bsd") << QLatin1String("unix"); return QLatin1String("bsd");
break;
case ProjectExplorer::Abi::QnxOS: case ProjectExplorer::Abi::QnxOS:
os << QLatin1String("qnx") << QLatin1String("unix"); return QLatin1String("qnx");
break;
case ProjectExplorer::Abi::UnixOS: case ProjectExplorer::Abi::UnixOS:
if (abi.osFlavor() == ProjectExplorer::Abi::SolarisUnixFlavor) if (abi.osFlavor() == ProjectExplorer::Abi::SolarisUnixFlavor)
os << QLatin1String("solaris"); return QLatin1String("solaris");
os << QLatin1String("unix"); return QLatin1String("unix");
break; case ProjectExplorer::Abi::VxWorks:
default: return QLatin1String("vxworks");
case ProjectExplorer::Abi::BareMetalOS:
case ProjectExplorer::Abi::UnknownOS:
break; break;
} }
return os; return QString();
} }
static QStringList toolchainList(const ProjectExplorer::ToolChain *tc) static QStringList toolchainList(const ProjectExplorer::ToolChain *tc)
@@ -258,7 +244,7 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor
ProjectExplorer::Abi::abiFromTargetTriplet(mainTc->originalTargetTriple())) { ProjectExplorer::Abi::abiFromTargetTriplet(mainTc->originalTargetTriple())) {
data.insert(QLatin1String(QBS_ARCHITECTURE), architecture(mainTc->targetAbi())); data.insert(QLatin1String(QBS_ARCHITECTURE), architecture(mainTc->targetAbi()));
} }
data.insert(QLatin1String(QBS_TARGETOS), targetOSList(targetAbi, k)); data.insert(QLatin1String(QBS_TARGETPLATFORM), targetPlatform(targetAbi, k));
QStringList toolchain = toolchainList(mainTc); QStringList toolchain = toolchainList(mainTc);

View File

@@ -76,7 +76,7 @@ const char QBS_GROUP_ICON[] = ":/qbsprojectmanager/images/groups.png";
const char QBS_PRODUCT_OVERLAY_ICON[] = ":/qbsprojectmanager/images/productgear.png"; const char QBS_PRODUCT_OVERLAY_ICON[] = ":/qbsprojectmanager/images/productgear.png";
// Toolchain related settings: // Toolchain related settings:
const char QBS_TARGETOS[] = "qbs.targetOS"; const char QBS_TARGETPLATFORM[] = "qbs.targetPlatform";
const char QBS_SYSROOT[] = "qbs.sysroot"; const char QBS_SYSROOT[] = "qbs.sysroot";
const char QBS_ARCHITECTURES[] = "qbs.architectures"; const char QBS_ARCHITECTURES[] = "qbs.architectures";
const char QBS_ARCHITECTURE[] = "qbs.architecture"; const char QBS_ARCHITECTURE[] = "qbs.architecture";

View File

@@ -29,6 +29,8 @@
#include <timeline/timelineformattime.h> #include <timeline/timelineformattime.h>
#include <utils/qtcfallthrough.h>
#include <QKeyEvent> #include <QKeyEvent>
#include <QMouseEvent> #include <QMouseEvent>
#include <QMetaEnum> #include <QMetaEnum>
@@ -84,7 +86,7 @@ QVariantMap InputEventsModel::details(int index) const
switch (event.type) { switch (event.type) {
case InputKeyPress: case InputKeyPress:
type = tr("Key Press"); type = tr("Key Press");
// fallthrough Q_FALLTHROUGH();
case InputKeyRelease: case InputKeyRelease:
if (type.isEmpty()) if (type.isEmpty())
type = tr("Key Release"); type = tr("Key Release");
@@ -98,11 +100,11 @@ QVariantMap InputEventsModel::details(int index) const
break; break;
case InputMouseDoubleClick: case InputMouseDoubleClick:
type = tr("Double Click"); type = tr("Double Click");
// fallthrough Q_FALLTHROUGH();
case InputMousePress: case InputMousePress:
if (type.isEmpty()) if (type.isEmpty())
type = tr("Mouse Press"); type = tr("Mouse Press");
// fallthrough Q_FALLTHROUGH();
case InputMouseRelease: case InputMouseRelease:
if (type.isEmpty()) if (type.isEmpty())
type = tr("Mouse Release"); type = tr("Mouse Release");

View File

@@ -25,13 +25,6 @@
\" <comment>Linguist compiled translations</comment>\", \" <comment>Linguist compiled translations</comment>\",
\" <glob pattern=\'*.qm\'/>\", \" <glob pattern=\'*.qm\'/>\",
\" </mime-type>\", \" </mime-type>\",
\" <mime-type type=\'application/x-linguist\'>\",
\" <comment>Linguist source translations</comment>\",
\" <magic>\",
\" <match value=\'&lt;TS\' type=\'string\' offset=\'0:256\'/>\",
\" </magic>\",
\" <glob pattern=\'*.ts\' weight=\'70\'/>\",
\" </mime-type>\",
\" <mime-type type=\'application/scxml+xml\'>\", \" <mime-type type=\'application/scxml+xml\'>\",
\" <comment>SCXML State Chart</comment>\", \" <comment>SCXML State Chart</comment>\",
\" <sub-class-of type=\'application/xml\'/>\", \" <sub-class-of type=\'application/xml\'/>\",

View File

@@ -29,6 +29,7 @@
#include "serializer.h" #include "serializer.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/qtcfallthrough.h>
#include <QAction> #include <QAction>
#include <QPointF> #include <QPointF>
@@ -112,7 +113,7 @@ QVector<TagType> allowedChildTypes(TagType tagType)
case State: case State:
childTags << Initial; childTags << Initial;
childTags << Final; childTags << Final;
// FALL THROUGH Q_FALLTHROUGH();
case Parallel: case Parallel:
childTags << OnEntry; childTags << OnEntry;
childTags << OnExit; childTags << OnExit;
@@ -135,7 +136,7 @@ QVector<TagType> allowedChildTypes(TagType tagType)
case If: case If:
childTags << ElseIf; childTags << ElseIf;
childTags << Else; childTags << Else;
// FALL THROUGH Q_FALLTHROUGH();
case Transition: case Transition:
case OnEntry: case OnEntry:
case OnExit: case OnExit:
@@ -169,7 +170,7 @@ QVector<TagType> allowedChildTypes(TagType tagType)
break; break;
case Invoke: case Invoke:
childTags << Finalize; childTags << Finalize;
// FALL THROUGH Q_FALLTHROUGH();
case Donedata: case Donedata:
case Send: case Send:
childTags << Param; childTags << Param;
@@ -211,7 +212,7 @@ QVector<TagType> childTypes(TagType tagType)
case If: case If:
childTags << ElseIf; childTags << ElseIf;
childTags << Else; childTags << Else;
// FALL THROUGH Q_FALLTHROUGH();
case Transition: case Transition:
case OnEntry: case OnEntry:
case OnExit: case OnExit:
@@ -245,7 +246,7 @@ QVector<TagType> childTypes(TagType tagType)
break; break;
case Invoke: case Invoke:
childTags << Finalize; childTags << Finalize;
// FALL THROUGH Q_FALLTHROUGH();
case Donedata: case Donedata:
case Send: case Send:
childTags << Param; childTags << Param;

View File

@@ -88,6 +88,10 @@ void ValgrindToolRunner::start()
connect(&m_runner, &ValgrindRunner::processOutputReceived, connect(&m_runner, &ValgrindRunner::processOutputReceived,
this, &ValgrindToolRunner::receiveProcessOutput); this, &ValgrindToolRunner::receiveProcessOutput);
connect(&m_runner, &ValgrindRunner::valgrindExecuted,
this, [this](const QString &commandLine) {
appendMessage(commandLine, NormalMessageFormat);
});
connect(&m_runner, &ValgrindRunner::processErrorReceived, connect(&m_runner, &ValgrindRunner::processErrorReceived,
this, &ValgrindToolRunner::receiveProcessError); this, &ValgrindToolRunner::receiveProcessError);
connect(&m_runner, &ValgrindRunner::finished, connect(&m_runner, &ValgrindRunner::finished,

View File

@@ -114,6 +114,8 @@ void ValgrindRunner::Private::run()
valgrind.device = m_device; valgrind.device = m_device;
valgrind.commandLineArguments = QtcProcess::joinArgs(fullArgs, m_device->osType()); valgrind.commandLineArguments = QtcProcess::joinArgs(fullArgs, m_device->osType());
Utils::QtcProcess::addArgs(&valgrind.commandLineArguments, m_debuggee.commandLineArguments); Utils::QtcProcess::addArgs(&valgrind.commandLineArguments, m_debuggee.commandLineArguments);
emit q->valgrindExecuted(QtcProcess::quoteArg(valgrind.executable) + ' '
+ valgrind.commandLineArguments);
if (m_device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) if (m_device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE)
m_valgrindProcess.start(valgrind); m_valgrindProcess.start(valgrind);

View File

@@ -64,6 +64,7 @@ signals:
void logMessageReceived(const QByteArray &); void logMessageReceived(const QByteArray &);
void processOutputReceived(const QString &, Utils::OutputFormat); void processOutputReceived(const QString &, Utils::OutputFormat);
void processErrorReceived(const QString &, QProcess::ProcessError); void processErrorReceived(const QString &, QProcess::ProcessError);
void valgrindExecuted(const QString &);
void valgrindStarted(qint64 pid); void valgrindStarted(qint64 pid);
void finished(); void finished();
void extraProcessFinished(); void extraProcessFinished();

View File

@@ -37,6 +37,7 @@
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <qtsupport/baseqtversion.h> #include <qtsupport/baseqtversion.h>
#include <qtsupport/qtkitinformation.h> #include <qtsupport/qtkitinformation.h>
#include <utils/qtcfallthrough.h>
#include <utils/qtcprocess.h> #include <utils/qtcprocess.h>
#include <QDir> #include <QDir>
@@ -169,7 +170,7 @@ void WinRtRunnerHelper::startWinRtRunner(const RunConf &conf)
QtcProcess::addArg(&runnerArgs, QStringLiteral("--debugger-arguments")); QtcProcess::addArg(&runnerArgs, QStringLiteral("--debugger-arguments"));
QtcProcess::addArg(&runnerArgs, m_debuggerArguments); QtcProcess::addArg(&runnerArgs, m_debuggerArguments);
} }
// fall through Q_FALLTHROUGH();
case Start: case Start:
QtcProcess::addArgs(&runnerArgs, QStringLiteral("--start --stop --install --wait 0")); QtcProcess::addArgs(&runnerArgs, QStringLiteral("--start --stop --install --wait 0"));
connectProcess = true; connectProcess = true;

View File

@@ -51,7 +51,6 @@
#include "json.h" #include "json.h"
//#define PARSER_DEBUG //#define PARSER_DEBUG
#ifdef PARSER_DEBUG #ifdef PARSER_DEBUG
static int indent = 0; static int indent = 0;