From d2db54b451bda4553ec171eb5802131a3a694f59 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 22 Jul 2014 15:45:09 +0300 Subject: VCS: Fix filter line in nickname dialog Change-Id: I5e9c6768fa5357c7d3b046216efcda41e2c1eca6 Reviewed-by: Tobias Hunger --- src/plugins/vcsbase/nicknamedialog.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/vcsbase/nicknamedialog.cpp b/src/plugins/vcsbase/nicknamedialog.cpp index 1aba9261a1..f4533b44aa 100644 --- a/src/plugins/vcsbase/nicknamedialog.cpp +++ b/src/plugins/vcsbase/nicknamedialog.cpp @@ -187,6 +187,7 @@ NickNameDialog::NickNameDialog(QStandardItemModel *model, QWidget *parent) : treeWidth += m_ui->filterTreeView->columnWidth(c); } m_ui->filterTreeView->setMinimumWidth(treeWidth + 20); + m_ui->filterLineEdit->setFiltering(true); connect(m_ui->filterTreeView, SIGNAL(activated(QModelIndex)), this, SLOT(slotActivated(QModelIndex))); connect(m_ui->filterTreeView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), -- cgit v1.2.1 From 45b1169d063321c72002dd732e920b87c219e0af Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Tue, 15 Jul 2014 12:37:19 +0200 Subject: C++: Support alignas in C++11 mode. Change-Id: Ifa81a481bf92b5b71495a105ae292f3e9895f704 Task-number: QTCREATORBUG-9279 Reviewed-by: Nikolai Kosjar --- src/libs/3rdparty/cplusplus/AST.cpp | 42 +++++++- src/libs/3rdparty/cplusplus/AST.h | 62 +++++++++-- src/libs/3rdparty/cplusplus/ASTClone.cpp | 24 +++-- src/libs/3rdparty/cplusplus/ASTMatch0.cpp | 16 ++- src/libs/3rdparty/cplusplus/ASTMatcher.cpp | 25 ++++- src/libs/3rdparty/cplusplus/ASTMatcher.h | 5 +- src/libs/3rdparty/cplusplus/ASTPatternBuilder.h | 31 +++--- src/libs/3rdparty/cplusplus/ASTVisit.cpp | 12 ++- src/libs/3rdparty/cplusplus/ASTVisitor.h | 10 +- src/libs/3rdparty/cplusplus/ASTfwd.h | 6 +- src/libs/3rdparty/cplusplus/Bind.cpp | 16 ++- src/libs/3rdparty/cplusplus/Bind.h | 7 +- src/libs/3rdparty/cplusplus/Parser.cpp | 118 ++++++++++++--------- src/libs/3rdparty/cplusplus/Parser.h | 6 +- src/libs/cplusplus/FindUsages.cpp | 8 +- src/libs/cplusplus/FindUsages.h | 6 +- tests/auto/cplusplus/ast/tst_ast.cpp | 12 +-- .../auto/cplusplus/cxx11/data/alignofAlignas.1.cpp | 6 ++ tests/auto/cplusplus/findusages/tst_findusages.cpp | 33 ++++++ tests/tools/cplusplus-ast2png/dumpers.inc | 20 +++- 20 files changed, 345 insertions(+), 120 deletions(-) diff --git a/src/libs/3rdparty/cplusplus/AST.cpp b/src/libs/3rdparty/cplusplus/AST.cpp index 312b1dcfc2..0eb73f58fb 100644 --- a/src/libs/3rdparty/cplusplus/AST.cpp +++ b/src/libs/3rdparty/cplusplus/AST.cpp @@ -68,7 +68,7 @@ bool AST::match(AST *pattern, ASTMatcher *matcher) return match0(pattern, matcher); } -unsigned AttributeSpecifierAST::firstToken() const +unsigned GnuAttributeSpecifierAST::firstToken() const { return attribute_token; } @@ -242,7 +242,7 @@ unsigned AsmDefinitionAST::lastToken() const } /** \generated */ -unsigned AttributeAST::firstToken() const +unsigned GnuAttributeAST::firstToken() const { if (identifier_token) return identifier_token; @@ -259,7 +259,7 @@ unsigned AttributeAST::firstToken() const } /** \generated */ -unsigned AttributeAST::lastToken() const +unsigned GnuAttributeAST::lastToken() const { if (rparen_token) return rparen_token + 1; @@ -4194,7 +4194,7 @@ unsigned WhileStatementAST::lastToken() const } /** \generated */ -unsigned AttributeSpecifierAST::lastToken() const +unsigned GnuAttributeSpecifierAST::lastToken() const { if (second_rparen_token) return second_rparen_token + 1; @@ -4524,3 +4524,37 @@ unsigned DotDesignatorAST::lastToken() const return 1; } +/** \generated */ +unsigned AlignmentSpecifierAST::firstToken() const +{ + if (align_token) + return align_token; + if (lparen_token) + return lparen_token; + if (typeIdExprOrAlignmentExpr) + if (unsigned candidate = typeIdExprOrAlignmentExpr->firstToken()) + return candidate; + if (ellipses_token) + return ellipses_token; + if (rparen_token) + return rparen_token; + return 0; +} + +/** \generated */ +unsigned AlignmentSpecifierAST::lastToken() const +{ + if (rparen_token) + return rparen_token + 1; + if (ellipses_token) + return ellipses_token + 1; + if (typeIdExprOrAlignmentExpr) + if (unsigned candidate = typeIdExprOrAlignmentExpr->lastToken()) + return candidate; + if (lparen_token) + return lparen_token + 1; + if (align_token) + return align_token + 1; + return 1; +} + diff --git a/src/libs/3rdparty/cplusplus/AST.h b/src/libs/3rdparty/cplusplus/AST.h index a0f5a2fa64..e0e76f0323 100644 --- a/src/libs/3rdparty/cplusplus/AST.h +++ b/src/libs/3rdparty/cplusplus/AST.h @@ -126,13 +126,13 @@ public: virtual AccessDeclarationAST *asAccessDeclaration() { return 0; } virtual AliasDeclarationAST *asAliasDeclaration() { return 0; } + virtual AlignmentSpecifierAST *asAlignmentSpecifier() { return 0; } virtual AlignofExpressionAST *asAlignofExpression() { return 0; } virtual AnonymousNameAST *asAnonymousName() { return 0; } virtual ArrayAccessAST *asArrayAccess() { return 0; } virtual ArrayDeclaratorAST *asArrayDeclarator() { return 0; } virtual ArrayInitializerAST *asArrayInitializer() { return 0; } virtual AsmDefinitionAST *asAsmDefinition() { return 0; } - virtual AttributeAST *asAttribute() { return 0; } virtual AttributeSpecifierAST *asAttributeSpecifier() { return 0; } virtual BaseSpecifierAST *asBaseSpecifier() { return 0; } virtual BinaryExpressionAST *asBinaryExpression() { return 0; } @@ -182,6 +182,8 @@ public: virtual ForeachStatementAST *asForeachStatement() { return 0; } virtual FunctionDeclaratorAST *asFunctionDeclarator() { return 0; } virtual FunctionDefinitionAST *asFunctionDefinition() { return 0; } + virtual GnuAttributeAST *asGnuAttribute() { return 0; } + virtual GnuAttributeSpecifierAST *asGnuAttributeSpecifier() { return 0; } virtual GotoStatementAST *asGotoStatement() { return 0; } virtual IdExpressionAST *asIdExpression() { return 0; } virtual IfStatementAST *asIfStatement() { return 0; } @@ -462,16 +464,58 @@ protected: class CPLUSPLUS_EXPORT AttributeSpecifierAST: public SpecifierAST { +public: + AttributeSpecifierAST() + {} + + virtual AttributeSpecifierAST *asAttributeSpecifier() { return this; } + + virtual AttributeSpecifierAST *clone(MemoryPool *pool) const = 0; +}; + +class CPLUSPLUS_EXPORT AlignmentSpecifierAST: public AttributeSpecifierAST +{ +public: + unsigned align_token; + unsigned lparen_token; + ExpressionAST *typeIdExprOrAlignmentExpr; + unsigned ellipses_token; + unsigned rparen_token; + +public: + AlignmentSpecifierAST() + : align_token(0) + , lparen_token(0) + , typeIdExprOrAlignmentExpr(0) + , ellipses_token(0) + , rparen_token(0) + {} + + virtual AlignmentSpecifierAST *asAlignmentSpecifier() { return this; } + + virtual unsigned firstToken() const; + virtual unsigned lastToken() const; + + virtual AlignmentSpecifierAST *clone(MemoryPool *pool) const; + +protected: + virtual void accept0(ASTVisitor *visitor); + virtual bool match0(AST *, ASTMatcher *); +}; + + +class CPLUSPLUS_EXPORT GnuAttributeSpecifierAST: public AttributeSpecifierAST +{ public: unsigned attribute_token; unsigned first_lparen_token; unsigned second_lparen_token; - AttributeListAST *attribute_list; + GnuAttributeListAST *attribute_list; unsigned first_rparen_token; unsigned second_rparen_token; public: - AttributeSpecifierAST() + GnuAttributeSpecifierAST() : attribute_token(0) , first_lparen_token(0) , second_lparen_token(0) @@ -480,19 +524,19 @@ public: , second_rparen_token(0) {} - virtual AttributeSpecifierAST *asAttributeSpecifier() { return this; } + virtual GnuAttributeSpecifierAST *asGnuAttributeSpecifier() { return this; } virtual unsigned firstToken() const; virtual unsigned lastToken() const; - virtual AttributeSpecifierAST *clone(MemoryPool *pool) const; + virtual GnuAttributeSpecifierAST *clone(MemoryPool *pool) const; protected: virtual void accept0(ASTVisitor *visitor); virtual bool match0(AST *, ASTMatcher *); }; -class CPLUSPLUS_EXPORT AttributeAST: public AST +class CPLUSPLUS_EXPORT GnuAttributeAST: public AST { public: unsigned identifier_token; @@ -502,7 +546,7 @@ public: unsigned rparen_token; public: - AttributeAST() + GnuAttributeAST() : identifier_token(0) , lparen_token(0) , tag_token(0) @@ -510,12 +554,12 @@ public: , rparen_token(0) {} - virtual AttributeAST *asAttribute() { return this; } + virtual GnuAttributeAST *asGnuAttribute() { return this; } virtual unsigned firstToken() const; virtual unsigned lastToken() const; - virtual AttributeAST *clone(MemoryPool *pool) const; + virtual GnuAttributeAST *clone(MemoryPool *pool) const; protected: virtual void accept0(ASTVisitor *visitor); diff --git a/src/libs/3rdparty/cplusplus/ASTClone.cpp b/src/libs/3rdparty/cplusplus/ASTClone.cpp index 969adef311..3458846ea0 100644 --- a/src/libs/3rdparty/cplusplus/ASTClone.cpp +++ b/src/libs/3rdparty/cplusplus/ASTClone.cpp @@ -55,23 +55,35 @@ SimpleSpecifierAST *SimpleSpecifierAST::clone(MemoryPool *pool) const return ast; } -AttributeSpecifierAST *AttributeSpecifierAST::clone(MemoryPool *pool) const +AlignmentSpecifierAST *AlignmentSpecifierAST::clone(MemoryPool *pool) const { - AttributeSpecifierAST *ast = new (pool) AttributeSpecifierAST; + AlignmentSpecifierAST *ast = new (pool) AlignmentSpecifierAST; + ast->align_token = align_token; + ast->lparen_token = lparen_token; + if (typeIdExprOrAlignmentExpr) + ast->typeIdExprOrAlignmentExpr = typeIdExprOrAlignmentExpr->clone(pool); + ast->ellipses_token = ellipses_token; + ast->rparen_token = rparen_token; + return ast; +} + +GnuAttributeSpecifierAST *GnuAttributeSpecifierAST::clone(MemoryPool *pool) const +{ + GnuAttributeSpecifierAST *ast = new (pool) GnuAttributeSpecifierAST; ast->attribute_token = attribute_token; ast->first_lparen_token = first_lparen_token; ast->second_lparen_token = second_lparen_token; - for (AttributeListAST *iter = attribute_list, **ast_iter = &ast->attribute_list; + for (GnuAttributeListAST *iter = attribute_list, **ast_iter = &ast->attribute_list; iter; iter = iter->next, ast_iter = &(*ast_iter)->next) - *ast_iter = new (pool) AttributeListAST((iter->value) ? iter->value->clone(pool) : 0); + *ast_iter = new (pool) GnuAttributeListAST((iter->value) ? iter->value->clone(pool) : 0); ast->first_rparen_token = first_rparen_token; ast->second_rparen_token = second_rparen_token; return ast; } -AttributeAST *AttributeAST::clone(MemoryPool *pool) const +GnuAttributeAST *GnuAttributeAST::clone(MemoryPool *pool) const { - AttributeAST *ast = new (pool) AttributeAST; + GnuAttributeAST *ast = new (pool) GnuAttributeAST; ast->identifier_token = identifier_token; ast->lparen_token = lparen_token; ast->tag_token = tag_token; diff --git a/src/libs/3rdparty/cplusplus/ASTMatch0.cpp b/src/libs/3rdparty/cplusplus/ASTMatch0.cpp index ff51efcd1a..b0e732b257 100644 --- a/src/libs/3rdparty/cplusplus/ASTMatch0.cpp +++ b/src/libs/3rdparty/cplusplus/ASTMatch0.cpp @@ -56,17 +56,25 @@ bool SimpleSpecifierAST::match0(AST *pattern, ASTMatcher *matcher) return false; } -bool AttributeSpecifierAST::match0(AST *pattern, ASTMatcher *matcher) +bool AlignmentSpecifierAST::match0(AST *pattern, ASTMatcher *matcher) { - if (AttributeSpecifierAST *_other = pattern->asAttributeSpecifier()) + if (AlignmentSpecifierAST *_other = pattern->asAlignmentSpecifier()) return matcher->match(this, _other); return false; } -bool AttributeAST::match0(AST *pattern, ASTMatcher *matcher) +bool GnuAttributeSpecifierAST::match0(AST *pattern, ASTMatcher *matcher) { - if (AttributeAST *_other = pattern->asAttribute()) + if (GnuAttributeSpecifierAST *_other = pattern->asGnuAttributeSpecifier()) + return matcher->match(this, _other); + + return false; +} + +bool GnuAttributeAST::match0(AST *pattern, ASTMatcher *matcher) +{ + if (GnuAttributeAST *_other = pattern->asGnuAttribute()) return matcher->match(this, _other); return false; diff --git a/src/libs/3rdparty/cplusplus/ASTMatcher.cpp b/src/libs/3rdparty/cplusplus/ASTMatcher.cpp index 415adbcf3d..055b55a32d 100644 --- a/src/libs/3rdparty/cplusplus/ASTMatcher.cpp +++ b/src/libs/3rdparty/cplusplus/ASTMatcher.cpp @@ -73,7 +73,28 @@ bool ASTMatcher::match(SimpleSpecifierAST *node, SimpleSpecifierAST *pattern) return true; } -bool ASTMatcher::match(AttributeSpecifierAST *node, AttributeSpecifierAST *pattern) +bool ASTMatcher::match(AlignmentSpecifierAST *node, AlignmentSpecifierAST *pattern) +{ + (void) node; + (void) pattern; + + pattern->align_token = node->align_token; + + pattern->lparen_token = node->lparen_token; + + if (! pattern->typeIdExprOrAlignmentExpr) + pattern->typeIdExprOrAlignmentExpr = node->typeIdExprOrAlignmentExpr; + else if (! AST::match(node->typeIdExprOrAlignmentExpr, pattern->typeIdExprOrAlignmentExpr, this)) + return false; + + pattern->ellipses_token = node->ellipses_token; + + pattern->rparen_token = node->rparen_token; + + return true; +} + +bool ASTMatcher::match(GnuAttributeSpecifierAST *node, GnuAttributeSpecifierAST *pattern) { (void) node; (void) pattern; @@ -96,7 +117,7 @@ bool ASTMatcher::match(AttributeSpecifierAST *node, AttributeSpecifierAST *patte return true; } -bool ASTMatcher::match(AttributeAST *node, AttributeAST *pattern) +bool ASTMatcher::match(GnuAttributeAST *node, GnuAttributeAST *pattern) { (void) node; (void) pattern; diff --git a/src/libs/3rdparty/cplusplus/ASTMatcher.h b/src/libs/3rdparty/cplusplus/ASTMatcher.h index 042d5c9c9d..888ada0c20 100644 --- a/src/libs/3rdparty/cplusplus/ASTMatcher.h +++ b/src/libs/3rdparty/cplusplus/ASTMatcher.h @@ -33,14 +33,13 @@ public: virtual bool match(AccessDeclarationAST *node, AccessDeclarationAST *pattern); virtual bool match(AliasDeclarationAST *node, AliasDeclarationAST *pattern); + virtual bool match(AlignmentSpecifierAST *node, AlignmentSpecifierAST *pattern); virtual bool match(AlignofExpressionAST *node, AlignofExpressionAST *pattern); virtual bool match(AnonymousNameAST *node, AnonymousNameAST *pattern); virtual bool match(ArrayAccessAST *node, ArrayAccessAST *pattern); virtual bool match(ArrayDeclaratorAST *node, ArrayDeclaratorAST *pattern); virtual bool match(ArrayInitializerAST *node, ArrayInitializerAST *pattern); virtual bool match(AsmDefinitionAST *node, AsmDefinitionAST *pattern); - virtual bool match(AttributeAST *node, AttributeAST *pattern); - virtual bool match(AttributeSpecifierAST *node, AttributeSpecifierAST *pattern); virtual bool match(BaseSpecifierAST *node, BaseSpecifierAST *pattern); virtual bool match(BinaryExpressionAST *node, BinaryExpressionAST *pattern); virtual bool match(BoolLiteralAST *node, BoolLiteralAST *pattern); @@ -84,6 +83,8 @@ public: virtual bool match(ForeachStatementAST *node, ForeachStatementAST *pattern); virtual bool match(FunctionDeclaratorAST *node, FunctionDeclaratorAST *pattern); virtual bool match(FunctionDefinitionAST *node, FunctionDefinitionAST *pattern); + virtual bool match(GnuAttributeAST *node, GnuAttributeAST *pattern); + virtual bool match(GnuAttributeSpecifierAST *node, GnuAttributeSpecifierAST *pattern); virtual bool match(GotoStatementAST *node, GotoStatementAST *pattern); virtual bool match(IdExpressionAST *node, IdExpressionAST *pattern); virtual bool match(IfStatementAST *node, IfStatementAST *pattern); diff --git a/src/libs/3rdparty/cplusplus/ASTPatternBuilder.h b/src/libs/3rdparty/cplusplus/ASTPatternBuilder.h index 929337ee9b..c8c9d50d6d 100644 --- a/src/libs/3rdparty/cplusplus/ASTPatternBuilder.h +++ b/src/libs/3rdparty/cplusplus/ASTPatternBuilder.h @@ -63,16 +63,23 @@ public: return __ast; } - AttributeSpecifierAST *AttributeSpecifier(AttributeListAST *attribute_list = 0) + AlignmentSpecifierAST *AlignmentSpecifier(ExpressionAST *typeIdExprOrAlignmentExpr = 0) { - AttributeSpecifierAST *__ast = new (&pool) AttributeSpecifierAST; + AlignmentSpecifierAST *__ast = new (&pool) AlignmentSpecifierAST; + __ast->typeIdExprOrAlignmentExpr = typeIdExprOrAlignmentExpr; + return __ast; + } + + GnuAttributeSpecifierAST *GnuAttributeSpecifier(GnuAttributeListAST *attribute_list = 0) + { + GnuAttributeSpecifierAST *__ast = new (&pool) GnuAttributeSpecifierAST; __ast->attribute_list = attribute_list; return __ast; } - AttributeAST *Attribute(ExpressionListAST *expression_list = 0) + GnuAttributeAST *GnuAttribute(ExpressionListAST *expression_list = 0) { - AttributeAST *__ast = new (&pool) AttributeAST; + GnuAttributeAST *__ast = new (&pool) GnuAttributeAST; __ast->expression_list = expression_list; return __ast; } @@ -1168,14 +1175,6 @@ public: return __ast; } - AttributeListAST *AttributeList(AttributeAST *value, AttributeListAST *next = 0) - { - AttributeListAST *__list = new (&pool) AttributeListAST; - __list->next = next; - __list->value = value; - return __list; - } - BaseSpecifierListAST *BaseSpecifierList(BaseSpecifierAST *value, BaseSpecifierListAST *next = 0) { BaseSpecifierListAST *__list = new (&pool) BaseSpecifierListAST; @@ -1240,6 +1239,14 @@ public: return __list; } + GnuAttributeListAST *GnuAttributeList(GnuAttributeAST *value, GnuAttributeListAST *next = 0) + { + GnuAttributeListAST *__list = new (&pool) GnuAttributeListAST; + __list->next = next; + __list->value = value; + return __list; + } + MemInitializerListAST *MemInitializerList(MemInitializerAST *value, MemInitializerListAST *next = 0) { MemInitializerListAST *__list = new (&pool) MemInitializerListAST; diff --git a/src/libs/3rdparty/cplusplus/ASTVisit.cpp b/src/libs/3rdparty/cplusplus/ASTVisit.cpp index af8b916c9b..77b7e1b3fd 100644 --- a/src/libs/3rdparty/cplusplus/ASTVisit.cpp +++ b/src/libs/3rdparty/cplusplus/ASTVisit.cpp @@ -54,7 +54,15 @@ void SimpleSpecifierAST::accept0(ASTVisitor *visitor) visitor->endVisit(this); } -void AttributeSpecifierAST::accept0(ASTVisitor *visitor) +void AlignmentSpecifierAST::accept0(ASTVisitor *visitor) +{ + if (visitor->visit(this)) { + accept(typeIdExprOrAlignmentExpr, visitor); + } + visitor->endVisit(this); +} + +void GnuAttributeSpecifierAST::accept0(ASTVisitor *visitor) { if (visitor->visit(this)) { accept(attribute_list, visitor); @@ -62,7 +70,7 @@ void AttributeSpecifierAST::accept0(ASTVisitor *visitor) visitor->endVisit(this); } -void AttributeAST::accept0(ASTVisitor *visitor) +void GnuAttributeAST::accept0(ASTVisitor *visitor) { if (visitor->visit(this)) { accept(expression_list, visitor); diff --git a/src/libs/3rdparty/cplusplus/ASTVisitor.h b/src/libs/3rdparty/cplusplus/ASTVisitor.h index 2d22680380..16b6ebd58b 100644 --- a/src/libs/3rdparty/cplusplus/ASTVisitor.h +++ b/src/libs/3rdparty/cplusplus/ASTVisitor.h @@ -75,14 +75,13 @@ public: virtual bool visit(AccessDeclarationAST *) { return true; } virtual bool visit(AliasDeclarationAST *) { return true; } + virtual bool visit(AlignmentSpecifierAST *) { return true; } virtual bool visit(AlignofExpressionAST *) { return true; } virtual bool visit(AnonymousNameAST *) { return true; } virtual bool visit(ArrayAccessAST *) { return true; } virtual bool visit(ArrayDeclaratorAST *) { return true; } virtual bool visit(ArrayInitializerAST *) { return true; } virtual bool visit(AsmDefinitionAST *) { return true; } - virtual bool visit(AttributeAST *) { return true; } - virtual bool visit(AttributeSpecifierAST *) { return true; } virtual bool visit(BaseSpecifierAST *) { return true; } virtual bool visit(BinaryExpressionAST *) { return true; } virtual bool visit(BoolLiteralAST *) { return true; } @@ -126,6 +125,8 @@ public: virtual bool visit(ForeachStatementAST *) { return true; } virtual bool visit(FunctionDeclaratorAST *) { return true; } virtual bool visit(FunctionDefinitionAST *) { return true; } + virtual bool visit(GnuAttributeAST *) { return true; } + virtual bool visit(GnuAttributeSpecifierAST *) { return true; } virtual bool visit(GotoStatementAST *) { return true; } virtual bool visit(IdExpressionAST *) { return true; } virtual bool visit(IfStatementAST *) { return true; } @@ -224,14 +225,13 @@ public: virtual void endVisit(AccessDeclarationAST *) {} virtual void endVisit(AliasDeclarationAST *) {} + virtual void endVisit(AlignmentSpecifierAST *) {} virtual void endVisit(AlignofExpressionAST *) {} virtual void endVisit(AnonymousNameAST *) {} virtual void endVisit(ArrayAccessAST *) {} virtual void endVisit(ArrayDeclaratorAST *) {} virtual void endVisit(ArrayInitializerAST *) {} virtual void endVisit(AsmDefinitionAST *) {} - virtual void endVisit(AttributeAST *) {} - virtual void endVisit(AttributeSpecifierAST *) {} virtual void endVisit(BaseSpecifierAST *) {} virtual void endVisit(BinaryExpressionAST *) {} virtual void endVisit(BoolLiteralAST *) {} @@ -275,6 +275,8 @@ public: virtual void endVisit(ForeachStatementAST *) {} virtual void endVisit(FunctionDeclaratorAST *) {} virtual void endVisit(FunctionDefinitionAST *) {} + virtual void endVisit(GnuAttributeAST *) {} + virtual void endVisit(GnuAttributeSpecifierAST *) {} virtual void endVisit(GotoStatementAST *) {} virtual void endVisit(IdExpressionAST *) {} virtual void endVisit(IfStatementAST *) {} diff --git a/src/libs/3rdparty/cplusplus/ASTfwd.h b/src/libs/3rdparty/cplusplus/ASTfwd.h index 744fd57756..f48ae335f6 100644 --- a/src/libs/3rdparty/cplusplus/ASTfwd.h +++ b/src/libs/3rdparty/cplusplus/ASTfwd.h @@ -33,13 +33,13 @@ class ASTMatcher; class AccessDeclarationAST; class AliasDeclarationAST; +class AlignmentSpecifierAST; class AlignofExpressionAST; class AnonymousNameAST; class ArrayAccessAST; class ArrayDeclaratorAST; class ArrayInitializerAST; class AsmDefinitionAST; -class AttributeAST; class AttributeSpecifierAST; class BaseSpecifierAST; class BinaryExpressionAST; @@ -89,6 +89,8 @@ class ForStatementAST; class ForeachStatementAST; class FunctionDeclaratorAST; class FunctionDefinitionAST; +class GnuAttributeAST; +class GnuAttributeSpecifierAST; class GotoStatementAST; class IdExpressionAST; class IfStatementAST; @@ -201,7 +203,7 @@ typedef List MemInitializerListAST; typedef List NewArrayDeclaratorListAST; typedef List PostfixListAST; typedef List PostfixDeclaratorListAST; -typedef List AttributeListAST; +typedef List GnuAttributeListAST; typedef List NestedNameSpecifierListAST; typedef List CatchClauseListAST; typedef List PtrOperatorListAST; diff --git a/src/libs/3rdparty/cplusplus/Bind.cpp b/src/libs/3rdparty/cplusplus/Bind.cpp index 4f7be860df..ed39f95c1c 100644 --- a/src/libs/3rdparty/cplusplus/Bind.cpp +++ b/src/libs/3rdparty/cplusplus/Bind.cpp @@ -303,14 +303,14 @@ const Name *Bind::objCSelectorArgument(ObjCSelectorArgumentAST *ast, bool *hasAr return identifier(ast->name_token); } -bool Bind::visit(AttributeAST *ast) +bool Bind::visit(GnuAttributeAST *ast) { (void) ast; CPP_CHECK(!"unreachable"); return false; } -void Bind::attribute(AttributeAST *ast) +void Bind::attribute(GnuAttributeAST *ast) { if (! ast) return; @@ -2902,12 +2902,20 @@ bool Bind::visit(SimpleSpecifierAST *ast) return false; } -bool Bind::visit(AttributeSpecifierAST *ast) +bool Bind::visit(AlignmentSpecifierAST *ast) +{ + // Prevent visiting the type-id or alignment expression from changing the currently + // calculated type: + expression(ast->typeIdExprOrAlignmentExpr); + return false; +} + +bool Bind::visit(GnuAttributeSpecifierAST *ast) { // unsigned attribute_token = ast->attribute_token; // unsigned first_lparen_token = ast->first_lparen_token; // unsigned second_lparen_token = ast->second_lparen_token; - for (AttributeListAST *it = ast->attribute_list; it; it = it->next) { + for (GnuAttributeListAST *it = ast->attribute_list; it; it = it->next) { this->attribute(it->value); } // unsigned first_rparen_token = ast->first_rparen_token; diff --git a/src/libs/3rdparty/cplusplus/Bind.h b/src/libs/3rdparty/cplusplus/Bind.h index ded74a9da8..d7dc7073db 100644 --- a/src/libs/3rdparty/cplusplus/Bind.h +++ b/src/libs/3rdparty/cplusplus/Bind.h @@ -77,7 +77,7 @@ protected: unsigned calculateScopeStart(ObjCProtocolDeclarationAST *ast) const; const Name *objCSelectorArgument(ObjCSelectorArgumentAST *ast, bool *hasArg); - void attribute(AttributeAST *ast); + void attribute(GnuAttributeAST *ast); FullySpecifiedType declarator(DeclaratorAST *ast, const FullySpecifiedType &init, DeclaratorIdAST **declaratorId); void qtInterfaceName(QtInterfaceNameAST *ast); void baseSpecifier(BaseSpecifierAST *ast, unsigned colon_token, Class *klass); @@ -112,7 +112,7 @@ protected: // AST virtual bool visit(ObjCSelectorArgumentAST *ast); - virtual bool visit(AttributeAST *ast); + virtual bool visit(GnuAttributeAST *ast); virtual bool visit(DeclaratorAST *ast); virtual bool visit(QtPropertyDeclarationItemAST *ast); virtual bool visit(QtInterfaceNameAST *ast); @@ -245,7 +245,8 @@ protected: // SpecifierAST virtual bool visit(SimpleSpecifierAST *ast); - virtual bool visit(AttributeSpecifierAST *ast); + virtual bool visit(AlignmentSpecifierAST *ast); + virtual bool visit(GnuAttributeSpecifierAST *ast); virtual bool visit(TypeofSpecifierAST *ast); virtual bool visit(DecltypeSpecifierAST *ast); virtual bool visit(ClassSpecifierAST *ast); diff --git a/src/libs/3rdparty/cplusplus/Parser.cpp b/src/libs/3rdparty/cplusplus/Parser.cpp index 5023e982dd..75580a2efa 100644 --- a/src/libs/3rdparty/cplusplus/Parser.cpp +++ b/src/libs/3rdparty/cplusplus/Parser.cpp @@ -633,7 +633,7 @@ bool Parser::parseDeclaration(DeclarationAST *&node) if (_languageFeatures.objCEnabled && LA() == T___ATTRIBUTE__) { const unsigned start = cursor(); SpecifierListAST *attributes = 0, **attr = &attributes; - while (parseAttributeSpecifier(*attr)) + while (parseGnuAttributeSpecifier(*attr)) attr = &(*attr)->next; if (LA() == T_AT_INTERFACE) return parseObjCInterface(node, attributes); @@ -761,11 +761,7 @@ bool Parser::parseNamespace(DeclarationAST *&node) ast->namespace_token = namespace_token; if (LA() == T_IDENTIFIER) ast->identifier_token = consumeToken(); - SpecifierListAST **attr_ptr = &ast->attribute_list; - while (LA() == T___ATTRIBUTE__) { - parseAttributeSpecifier(*attr_ptr); - attr_ptr = &(*attr_ptr)->next; - } + parseOptionalAttributeSpecifierSequence(ast->attribute_list); if (LA() == T_LBRACE) { parseLinkageBody(ast->linkage_body); } else { // attempt to do error recovery @@ -1196,9 +1192,8 @@ bool Parser::parseCvQualifiers(SpecifierListAST *&node) spec->specifier_token = consumeToken(); *ast = new (_pool) SpecifierListAST(spec); ast = &(*ast)->next; - } else if (LA() == T___ATTRIBUTE__) { - parseAttributeSpecifier(*ast); - ast = &(*ast)->next; + } else if (parseOptionalAttributeSpecifierSequence(*ast)) { + continue; } else { break; } @@ -1398,11 +1393,7 @@ bool Parser::parseCoreDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_sp DEBUG_THIS_RULE(); unsigned start = cursor(); SpecifierListAST *attributes = 0; - SpecifierListAST **attribute_ptr = &attributes; - while (LA() == T___ATTRIBUTE__) { - parseAttributeSpecifier(*attribute_ptr); - attribute_ptr = &(*attribute_ptr)->next; - } + parseOptionalAttributeSpecifierSequence(attributes); PtrOperatorListAST *ptr_operators = 0, **ptr_operators_tail = &ptr_operators; while (parsePtrOperator(*ptr_operators_tail)) @@ -1577,12 +1568,7 @@ bool Parser::parseDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_specif consumeToken(); // skip T_RPAREN } - SpecifierListAST **spec_ptr = &node->post_attribute_list; - while (LA() == T___ATTRIBUTE__) { - parseAttributeSpecifier(*spec_ptr); - spec_ptr = &(*spec_ptr)->next; - } - + parseOptionalAttributeSpecifierSequence(node->post_attribute_list); return true; } @@ -1985,11 +1971,8 @@ bool Parser::parseClassSpecifier(SpecifierListAST *&node) unsigned classkey_token = consumeToken(); - SpecifierListAST *attributes = 0, **attr_ptr = &attributes; - while (LA() == T___ATTRIBUTE__) { - parseAttributeSpecifier(*attr_ptr); - attr_ptr = &(*attr_ptr)->next; - } + SpecifierListAST *attributes = 0; + parseOptionalAttributeSpecifierSequence(attributes); if (LA(1) == T_IDENTIFIER && LA(2) == T_IDENTIFIER) { const Identifier *id = tok(2).identifier; @@ -2464,12 +2447,8 @@ bool Parser::parseElaboratedTypeSpecifier(SpecifierListAST *&node) if (lookAtClassKey() || LA() == T_ENUM || LA() == T_TYPENAME) { unsigned classkey_token = consumeToken(); - SpecifierListAST *attributes = 0, **attr_ptr = &attributes; - while (LA() == T___ATTRIBUTE__) { - parseAttributeSpecifier(*attr_ptr); - attr_ptr = &(*attr_ptr)->next; - } - + SpecifierListAST *attributes = 0; + parseOptionalAttributeSpecifierSequence(attributes); NameAST *name = 0; if (parseName(name)) { ElaboratedTypeSpecifierAST *ast = new (_pool) ElaboratedTypeSpecifierAST; @@ -3780,39 +3759,83 @@ bool Parser::lookAtClassKey() const } } -bool Parser::parseAttributeSpecifier(SpecifierListAST *&node) +bool Parser::parseOptionalAttributeSpecifierSequence(SpecifierListAST *&attribute_list) +{ + bool didRead = false; + while (parseAttributeSpecifier(attribute_list)) + didRead = true; + return didRead; +} + +bool Parser::parseAttributeSpecifier(SpecifierListAST *&attribute_list) +{ + SpecifierListAST **attr_ptr = &attribute_list; + switch (LA()) { + case T_ALIGNAS: { + AlignmentSpecifierAST *ast = new (_pool) AlignmentSpecifierAST; + ast->align_token = consumeToken(); + match(T_LPAREN, &ast->lparen_token); + + const unsigned saved = cursor(); + if (!parseTypeId(ast->typeIdExprOrAlignmentExpr) || + (LA() != T_RPAREN && + (LA(1) != T_DOT_DOT_DOT || LA(2) != T_RPAREN))) { + rewind(saved); + parseExpression(ast->typeIdExprOrAlignmentExpr); + } + + if (LA() == T_DOT_DOT_DOT) + ast->ellipses_token = consumeToken(); + match(T_RPAREN, &ast->rparen_token); + attribute_list = new (_pool) SpecifierListAST(ast); + return true; + } + //### TODO: C++11-style attributes +// case T_LBRACKET: + case T___ATTRIBUTE__: + while (LA() == T___ATTRIBUTE__) { + parseGnuAttributeSpecifier(*attr_ptr); + attr_ptr = &(*attr_ptr)->next; + } + return true; + default: + return false; + } +} + +bool Parser::parseGnuAttributeSpecifier(SpecifierListAST *&node) { DEBUG_THIS_RULE(); if (LA() != T___ATTRIBUTE__) return false; - AttributeSpecifierAST *ast = new (_pool) AttributeSpecifierAST; + GnuAttributeSpecifierAST *ast = new (_pool) GnuAttributeSpecifierAST; ast->attribute_token = consumeToken(); match(T_LPAREN, &ast->first_lparen_token); match(T_LPAREN, &ast->second_lparen_token); - parseAttributeList(ast->attribute_list); + parseGnuAttributeList(ast->attribute_list); match(T_RPAREN, &ast->first_rparen_token); match(T_RPAREN, &ast->second_rparen_token); node = new (_pool) SpecifierListAST(ast); return true; } -bool Parser::parseAttributeList(AttributeListAST *&node) +bool Parser::parseGnuAttributeList(GnuAttributeListAST *&node) { DEBUG_THIS_RULE(); - AttributeListAST **iter = &node; + GnuAttributeListAST **iter = &node; while (LA() == T_CONST || LA() == T_IDENTIFIER) { - *iter = new (_pool) AttributeListAST; + *iter = new (_pool) GnuAttributeListAST; if (LA() == T_CONST) { - AttributeAST *attr = new (_pool) AttributeAST; + GnuAttributeAST *attr = new (_pool) GnuAttributeAST; attr->identifier_token = consumeToken(); (*iter)->value = attr; iter = &(*iter)->next; } else if (LA() == T_IDENTIFIER) { - AttributeAST *attr = new (_pool) AttributeAST; + GnuAttributeAST *attr = new (_pool) GnuAttributeAST; attr->identifier_token = consumeToken(); if (LA() == T_LPAREN) { attr->lparen_token = consumeToken(); @@ -3837,7 +3860,7 @@ bool Parser::parseBuiltinTypeSpecifier(SpecifierListAST *&node) { DEBUG_THIS_RULE(); if (LA() == T___ATTRIBUTE__) { - return parseAttributeSpecifier(node); + return parseGnuAttributeSpecifier(node); } else if (LA() == T___TYPEOF__) { TypeofSpecifierAST *ast = new (_pool) TypeofSpecifierAST; ast->typeof_token = consumeToken(); @@ -3893,8 +3916,7 @@ bool Parser::parseSimpleDeclaration(DeclarationAST *&node, ClassSpecifierAST *de spec->specifier_token = consumeToken(); *decl_specifier_seq_ptr = new (_pool) SpecifierListAST(spec); decl_specifier_seq_ptr = &(*decl_specifier_seq_ptr)->next; - } else if (LA() == T___ATTRIBUTE__) { - parseAttributeSpecifier(*decl_specifier_seq_ptr); + } else if (parseAttributeSpecifier(*decl_specifier_seq_ptr)) { decl_specifier_seq_ptr = &(*decl_specifier_seq_ptr)->next; } else if (! named_type_specifier && ! has_complex_type_specifier && lookAtBuiltinTypeSpecifier()) { parseBuiltinTypeSpecifier(*decl_specifier_seq_ptr); @@ -5609,7 +5631,7 @@ bool Parser::parseObjCInterface(DeclarationAST *&node, DEBUG_THIS_RULE(); if (! attributes && LA() == T___ATTRIBUTE__) { SpecifierListAST **attr = &attributes; - while (parseAttributeSpecifier(*attr)) + while (parseGnuAttributeSpecifier(*attr)) attr = &(*attr)->next; } @@ -5698,7 +5720,7 @@ bool Parser::parseObjCProtocol(DeclarationAST *&node, DEBUG_THIS_RULE(); if (! attributes && LA() == T___ATTRIBUTE__) { SpecifierListAST **attr = &attributes; - while (parseAttributeSpecifier(*attr)) + while (parseGnuAttributeSpecifier(*attr)) attr = &(*attr)->next; } @@ -6200,7 +6222,7 @@ bool Parser::parseObjCMethodPrototype(ObjCMethodPrototypeAST *&node) } SpecifierListAST **attr = &ast->attribute_list; - while (parseAttributeSpecifier(*attr)) + while (parseGnuAttributeSpecifier(*attr)) attr = &(*attr)->next; node = ast; @@ -6309,7 +6331,7 @@ bool Parser::parseObjCKeywordDeclaration(ObjCSelectorArgumentAST *&argument, Obj parseObjCTypeName(node->type_name); SpecifierListAST **attr = &node->attribute_list; - while (parseAttributeSpecifier(*attr)) + while (parseGnuAttributeSpecifier(*attr)) attr = &(*attr)->next; SimpleNameAST *param_name = new (_pool) SimpleNameAST; @@ -6509,7 +6531,7 @@ bool Parser::parseLambdaDeclarator(LambdaDeclaratorAST *&node) match(T_RPAREN, &ast->rparen_token); SpecifierListAST **attr = &ast->attributes; - while (parseAttributeSpecifier(*attr)) + while (parseGnuAttributeSpecifier(*attr)) attr = &(*attr)->next; if (LA() == T_MUTABLE) @@ -6533,7 +6555,7 @@ bool Parser::parseTrailingReturnType(TrailingReturnTypeAST *&node) ast->arrow_token = consumeToken(); SpecifierListAST **attr = &ast->attributes; - while (parseAttributeSpecifier(*attr)) + while (parseGnuAttributeSpecifier(*attr)) attr = &(*attr)->next; parseTrailingTypeSpecifierSeq(ast->type_specifier_list); diff --git a/src/libs/3rdparty/cplusplus/Parser.h b/src/libs/3rdparty/cplusplus/Parser.h index 10f8f6c542..05a600e04f 100644 --- a/src/libs/3rdparty/cplusplus/Parser.h +++ b/src/libs/3rdparty/cplusplus/Parser.h @@ -164,8 +164,10 @@ public: bool parseTypeParameter(DeclarationAST *&node); bool parseBuiltinTypeSpecifier(SpecifierListAST *&node); - bool parseAttributeSpecifier(SpecifierListAST *&node); - bool parseAttributeList(AttributeListAST *&node); + bool parseOptionalAttributeSpecifierSequence(SpecifierListAST *&attribute_list); + bool parseAttributeSpecifier(SpecifierListAST *&attribute_list); + bool parseGnuAttributeSpecifier(SpecifierListAST *&node); + bool parseGnuAttributeList(GnuAttributeListAST *&node); bool parseDeclSpecifierSeq(SpecifierListAST *&node, bool noStorageSpecifiers = false, diff --git a/src/libs/cplusplus/FindUsages.cpp b/src/libs/cplusplus/FindUsages.cpp index 813acc3ebc..0b776e30f4 100644 --- a/src/libs/cplusplus/FindUsages.cpp +++ b/src/libs/cplusplus/FindUsages.cpp @@ -348,14 +348,14 @@ void FindUsages::objCSelectorArgument(ObjCSelectorArgumentAST *ast) // unsigned colon_token = ast->colon_token; } -bool FindUsages::visit(AttributeAST *ast) +bool FindUsages::visit(GnuAttributeAST *ast) { (void) ast; Q_ASSERT(!"unreachable"); return false; } -void FindUsages::attribute(AttributeAST *ast) +void FindUsages::attribute(GnuAttributeAST *ast) { if (! ast) return; @@ -1971,12 +1971,12 @@ bool FindUsages::visit(SimpleSpecifierAST *ast) return false; } -bool FindUsages::visit(AttributeSpecifierAST *ast) +bool FindUsages::visit(GnuAttributeSpecifierAST *ast) { // unsigned attribute_token = ast->attribute_token; // unsigned first_lparen_token = ast->first_lparen_token; // unsigned second_lparen_token = ast->second_lparen_token; - for (AttributeListAST *it = ast->attribute_list; it; it = it->next) { + for (GnuAttributeListAST *it = ast->attribute_list; it; it = it->next) { this->attribute(it->value); } // unsigned first_rparen_token = ast->first_rparen_token; diff --git a/src/libs/cplusplus/FindUsages.h b/src/libs/cplusplus/FindUsages.h index 2d63c2a859..c09652da2c 100644 --- a/src/libs/cplusplus/FindUsages.h +++ b/src/libs/cplusplus/FindUsages.h @@ -95,7 +95,7 @@ protected: void postfixDeclarator(PostfixDeclaratorAST *ast); void objCSelectorArgument(ObjCSelectorArgumentAST *ast); - void attribute(AttributeAST *ast); + void attribute(GnuAttributeAST *ast); void declarator(DeclaratorAST *ast, Scope *symbol = 0); void qtPropertyDeclarationItem(QtPropertyDeclarationItemAST *ast); void qtInterfaceName(QtInterfaceNameAST *ast); @@ -127,7 +127,7 @@ protected: // AST virtual bool visit(ObjCSelectorArgumentAST *ast); - virtual bool visit(AttributeAST *ast); + virtual bool visit(GnuAttributeAST *ast); virtual bool visit(DeclaratorAST *ast); virtual bool visit(QtPropertyDeclarationItemAST *ast); virtual bool visit(QtInterfaceNameAST *ast); @@ -258,7 +258,7 @@ protected: // SpecifierAST virtual bool visit(SimpleSpecifierAST *ast); - virtual bool visit(AttributeSpecifierAST *ast); + virtual bool visit(GnuAttributeSpecifierAST *ast); virtual bool visit(TypeofSpecifierAST *ast); virtual bool visit(DecltypeSpecifierAST *ast); virtual bool visit(ClassSpecifierAST *ast); diff --git a/tests/auto/cplusplus/ast/tst_ast.cpp b/tests/auto/cplusplus/ast/tst_ast.cpp index 05712ce5f3..1cd04ce471 100644 --- a/tests/auto/cplusplus/ast/tst_ast.cpp +++ b/tests/auto/cplusplus/ast/tst_ast.cpp @@ -207,12 +207,12 @@ void tst_AST::gcc_attributes_2() QVERIFY(ns->attribute_list); QVERIFY(!ns->attribute_list->next); QVERIFY(ns->attribute_list->value); - AttributeSpecifierAST *attrSpec = ns->attribute_list->value->asAttributeSpecifier(); + GnuAttributeSpecifierAST *attrSpec = ns->attribute_list->value->asGnuAttributeSpecifier(); QVERIFY(attrSpec); QVERIFY(attrSpec->attribute_list); QVERIFY(!attrSpec->attribute_list->next); QVERIFY(attrSpec->attribute_list->value); - AttributeAST *attr = attrSpec->attribute_list->value->asAttribute(); + GnuAttributeAST *attr = attrSpec->attribute_list->value->asGnuAttribute(); QVERIFY(attr); QCOMPARE(unit->spell(attr->identifier_token), "__visibility__"); QVERIFY(attr->expression_list); @@ -1371,13 +1371,13 @@ void tst_AST::objc_method_attributes_1() QVERIFY(foo->attribute_list); QVERIFY(foo->attribute_list->value); QVERIFY(! (foo->attribute_list->next)); - AttributeSpecifierAST *deprecatedSpec = foo->attribute_list->value->asAttributeSpecifier(); + GnuAttributeSpecifierAST *deprecatedSpec = foo->attribute_list->value->asGnuAttributeSpecifier(); QVERIFY(deprecatedSpec); QCOMPARE(unit->tokenKind(deprecatedSpec->attribute_token), (int) T___ATTRIBUTE__); QVERIFY(deprecatedSpec->attribute_list); QVERIFY(deprecatedSpec->attribute_list->value); QVERIFY(! (deprecatedSpec->attribute_list->next)); - AttributeAST *deprecatedAttr = deprecatedSpec->attribute_list->value->asAttribute(); + GnuAttributeAST *deprecatedAttr = deprecatedSpec->attribute_list->value->asGnuAttribute(); QVERIFY(deprecatedAttr); QVERIFY(! deprecatedAttr->expression_list); QCOMPARE(unit->spell(deprecatedAttr->identifier_token), "deprecated"); @@ -1399,13 +1399,13 @@ void tst_AST::objc_method_attributes_1() QVERIFY(bar->attribute_list); QVERIFY(bar->attribute_list->value); QVERIFY(! (bar->attribute_list->next)); - AttributeSpecifierAST *unavailableSpec = bar->attribute_list->value->asAttributeSpecifier(); + GnuAttributeSpecifierAST *unavailableSpec = bar->attribute_list->value->asGnuAttributeSpecifier(); QVERIFY(unavailableSpec); QCOMPARE(unit->tokenKind(unavailableSpec->attribute_token), (int) T___ATTRIBUTE__); QVERIFY(unavailableSpec->attribute_list); QVERIFY(unavailableSpec->attribute_list->value); QVERIFY(! (unavailableSpec->attribute_list->next)); - AttributeAST *unavailableAttr = unavailableSpec->attribute_list->value->asAttribute(); + GnuAttributeAST *unavailableAttr = unavailableSpec->attribute_list->value->asGnuAttribute(); QVERIFY(unavailableAttr); QVERIFY(! unavailableAttr->expression_list); QCOMPARE(unit->spell(unavailableAttr->identifier_token), "unavailable"); diff --git a/tests/auto/cplusplus/cxx11/data/alignofAlignas.1.cpp b/tests/auto/cplusplus/cxx11/data/alignofAlignas.1.cpp index 5ba43661ed..05768769f6 100644 --- a/tests/auto/cplusplus/cxx11/data/alignofAlignas.1.cpp +++ b/tests/auto/cplusplus/cxx11/data/alignofAlignas.1.cpp @@ -1,2 +1,8 @@ int i = alignof(int); int t = alignof(C::foo) * 7 + alignof(Foo *); + +struct alignas(f()) Foo {}; +struct alignas(42) Foo {}; +struct alignas(double) Bar {}; +alignas(Foo) alignas(Bar) Foo *buffer; +struct alignas(Mooze...) Gnarf {}; diff --git a/tests/auto/cplusplus/findusages/tst_findusages.cpp b/tests/auto/cplusplus/findusages/tst_findusages.cpp index 2235034c31..97162be99a 100644 --- a/tests/auto/cplusplus/findusages/tst_findusages.cpp +++ b/tests/auto/cplusplus/findusages/tst_findusages.cpp @@ -115,6 +115,8 @@ private Q_SLOTS: void usingInDifferentNamespace_QTCREATORBUG7978(); void unicodeIdentifier(); + + void inAlignas(); }; void tst_FindUsages::dump(const QList &usages) const @@ -984,5 +986,36 @@ void tst_FindUsages::unicodeIdentifier() QCOMPARE(usages.at(1).len, 7); } +void tst_FindUsages::inAlignas() +{ + const QByteArray src = "\n" + "struct One {};\n" + "struct alignas(One) Two {};\n" + ; + + Document::Ptr doc = Document::create("inAlignas"); + doc->setUtf8Source(src); + doc->parse(); + doc->check(); + + QVERIFY(doc->diagnosticMessages().isEmpty()); + QCOMPARE(doc->globalSymbolCount(), 2U); + + Snapshot snapshot; + snapshot.insert(doc); + + Class *c = doc->globalSymbolAt(0)->asClass(); + QVERIFY(c); + QCOMPARE(c->name()->identifier()->chars(), "One"); + + FindUsages find(src, doc, snapshot); + find(c); + QCOMPARE(find.usages().size(), 2); + QCOMPARE(find.usages()[0].line, 1); + QCOMPARE(find.usages()[0].col, 7); + QCOMPARE(find.usages()[1].line, 2); + QCOMPARE(find.usages()[1].col, 15); +} + QTEST_APPLESS_MAIN(tst_FindUsages) #include "tst_findusages.moc" diff --git a/tests/tools/cplusplus-ast2png/dumpers.inc b/tests/tools/cplusplus-ast2png/dumpers.inc index 5e901c386c..5e5bb1a10b 100644 --- a/tests/tools/cplusplus-ast2png/dumpers.inc +++ b/tests/tools/cplusplus-ast2png/dumpers.inc @@ -50,7 +50,21 @@ virtual bool visit(SimpleSpecifierAST *ast) return false; } -virtual bool visit(AttributeSpecifierAST *ast) +virtual bool visit(AlignmentSpecifierAST *ast) +{ + if (ast->align_token) + terminal(ast->align_token, ast); + if (ast->lparen_token) + terminal(ast->lparen_token, ast); + nonterminal(ast->typeIdExprOrAlignmentExpr); + if (ast->ellipses_token) + terminal(ast->ellipses_token, ast); + if (ast->rparen_token) + terminal(ast->rparen_token, ast); + return false; +} + +virtual bool visit(GnuAttributeSpecifierAST *ast) { if (ast->attribute_token) terminal(ast->attribute_token, ast); @@ -58,7 +72,7 @@ virtual bool visit(AttributeSpecifierAST *ast) terminal(ast->first_lparen_token, ast); if (ast->second_lparen_token) terminal(ast->second_lparen_token, ast); - for (AttributeListAST *iter = ast->attribute_list; iter; iter = iter->next) + for (GnuAttributeListAST *iter = ast->attribute_list; iter; iter = iter->next) nonterminal(iter->value); if (ast->first_rparen_token) terminal(ast->first_rparen_token, ast); @@ -67,7 +81,7 @@ virtual bool visit(AttributeSpecifierAST *ast) return false; } -virtual bool visit(AttributeAST *ast) +virtual bool visit(GnuAttributeAST *ast) { if (ast->identifier_token) terminal(ast->identifier_token, ast); -- cgit v1.2.1 From 1fe054c6b7c410bcf8d0c5cb536ff6dafc078ac8 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Fri, 18 Jul 2014 16:29:56 +0200 Subject: Doc: update docs for Version Control General options Change-Id: Ibe7fdf312ad18a06f787d32caca963e058475003 Reviewed-by: Orgad Shaneh Reviewed-by: Eike Ziller --- doc/src/howto/creator-vcs.qdoc | 35 +++++++++++++++++-------------- src/plugins/vcsbase/commonsettingspage.ui | 2 +- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/doc/src/howto/creator-vcs.qdoc b/doc/src/howto/creator-vcs.qdoc index 5b35e2f064..02abcec556 100644 --- a/doc/src/howto/creator-vcs.qdoc +++ b/doc/src/howto/creator-vcs.qdoc @@ -96,9 +96,9 @@ to \c %HOMEDRIVE%%HOMEPATH% when the Git executable is run and authorization works as it would with \c {git bash}. - \section1 Setting Up Common Options + \section1 Setting Up General Options - Select \gui{Tools} > \gui{Options} > \gui{Version Control} > \gui{Common} + Select \gui{Tools} > \gui{Options} > \gui{Version Control} > \gui{General} to specify settings for submit messages: \list @@ -109,33 +109,36 @@ parameter. If there is an error, the script should output a message on standard error and return a non-zero exit code. - \li \gui{User/alias configuration file} takes a file in mailmap format - that lists user names and aliases. For example: + \li \gui{User/alias configuration file} is a text file that lists + author names in mailmap format. For each author, you must specify a + real name and email address and optionally an alias and a second + email address. For example: \code - Jon Doe + Jon Doe jdoe Hans Mustermann hm \endcode - \note The second line above specifies the alias \e{hm} and the - corresponding email address for \e{Hans Mustermann}. If the - user/alias configuration file is present, the submit editor - displays a context menu with \gui{Insert name} that pops up a - dialog letting the user select a name. + After you specify a file in this field, you can select authors + as values of the submit message fields in the \gui Nicknames dialog. \li \gui{User fields configuration file} is a simple text file consisting of lines specifying submit message fields that take - user names, for example: + authors as values, for example: \code - Reviewed-by: + Acked-by: + Initial-patch-by: + Reported-by: + Rubber-stamped-by: Signed-off-by: + Tested-by: \endcode - The fields above appear below the submit message. They provide - completion for the aliases/public user names specified in the - \e{User/alias configuration file} as well as a button that opens the - aforementioned user name dialog. + After you specify a file in this field, you can add authors as + values of the submit message fields when submitting changes. If + you also specified a \gui{User/alias configuration file}, you can + select authors in the \gui Nicknames dialog. \li \gui{SSH prompt command} specifies an ssh-askpass command that you can use (on Linux) to prompt the user for a password when using SSH. diff --git a/src/plugins/vcsbase/commonsettingspage.ui b/src/plugins/vcsbase/commonsettingspage.ui index b0c2d6f07b..c8b894c8d3 100644 --- a/src/plugins/vcsbase/commonsettingspage.ui +++ b/src/plugins/vcsbase/commonsettingspage.ui @@ -72,7 +72,7 @@ - A file listing user names and email addresses in a 4-column mailmap format: + A file listing nicknames in a 4-column mailmap format: 'name <email> alias <email>'. -- cgit v1.2.1 From 37f92acccb08a6c4b2ec1c0841952a3c2a42efbd Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 22 Jul 2014 15:47:48 +0200 Subject: Qbs: Make qbs build system files accessible to Locator Change-Id: I0bdfadbc24b38f86ad5ec668c44f7fe18b7619fe Reviewed-by: Christian Kandeler --- src/plugins/qbsprojectmanager/qbsproject.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index 2747d3d5bf..45a26e3a5d 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -183,6 +183,7 @@ QStringList QbsProject::files(Project::FilesMode fileMode) const return QStringList(); QSet result; collectFilesForProject(m_rootProjectNode->qbsProjectData(), result); + result.unite(qbsProject().buildSystemFiles()); return result.toList(); } -- cgit v1.2.1 From 6166caee20d51e3f28e714b8fade06f8494041b9 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Tue, 22 Jul 2014 15:40:02 +0200 Subject: QmlDesigner: Cleanup DragTool::dropEvent Change-Id: Ic13347efdd14039115957bec28b9cebf2f007a47 Reviewed-by: Tim Jenssen --- src/plugins/qmldesigner/components/formeditor/dragtool.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/plugins/qmldesigner/components/formeditor/dragtool.cpp b/src/plugins/qmldesigner/components/formeditor/dragtool.cpp index 93f665dfb0..b2922bd80d 100644 --- a/src/plugins/qmldesigner/components/formeditor/dragtool.cpp +++ b/src/plugins/qmldesigner/components/formeditor/dragtool.cpp @@ -234,11 +234,9 @@ void DragTool::dropEvent(const QList &/*itemList*/, QGraphicsSce m_rewriterTransaction.commit(); - if (m_dragNode.isValid()) { - QList nodeList; - nodeList.append(m_dragNode); - view()->setSelectedModelNodes(toModelNodeList(nodeList)); - } + if (m_dragNode.isValid()) + view()->setSelectedModelNode(m_dragNode); + m_dragNode = QmlItemNode(); -- cgit v1.2.1 From e9e1f77965621522a2d44d90155f943d4cd34948 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 22 Jul 2014 15:43:10 +0200 Subject: Qbs: Show build qbs files not referenced in the products/groups Show build system files used by Qbs that are part of the project hierarchy in the Projects Pane. Change-Id: Ie7d1f1833fb00376f92c1436bd83e4f0518ae3ac Reviewed-by: Christian Kandeler --- src/plugins/qbsprojectmanager/qbsnodes.cpp | 40 ++++++++++++++++++++++++++++-- src/plugins/qbsprojectmanager/qbsnodes.h | 9 ++++++- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsnodes.cpp b/src/plugins/qbsprojectmanager/qbsnodes.cpp index f244f23313..4046f90cac 100644 --- a/src/plugins/qbsprojectmanager/qbsnodes.cpp +++ b/src/plugins/qbsprojectmanager/qbsnodes.cpp @@ -437,7 +437,7 @@ void QbsGroupNode::updateQbsGroupData(const qbs::GroupData *grp, const QString & emitNodeUpdated(); } -void QbsGroupNode::setupFiles(QbsBaseProjectNode *root, const QStringList &files, +void QbsGroupNode::setupFiles(ProjectExplorer::FolderNode *root, const QStringList &files, const QString &productPath, bool updateExisting) { // Build up a tree of nodes: @@ -797,17 +797,53 @@ QbsProjectNode *QbsProjectNode::findProjectNode(const QString &name) return 0; } +// -------------------------------------------------------------------- +// QbsRootProjectNode: +// -------------------------------------------------------------------- QbsRootProjectNode::QbsRootProjectNode(QbsProject *project) : QbsProjectNode(project->projectFilePath().toString()), - m_project(project) + m_project(project), + m_buildSystemFiles(new ProjectExplorer::FolderNode(project->projectDirectory().toString())) { + m_buildSystemFiles->setDisplayName(tr("Qbs files")); + addFolderNodes(QList() << m_buildSystemFiles); } void QbsRootProjectNode::update() { + QStringList buildSystemFiles = unreferencedBuildSystemFiles(m_project->qbsProject()); + + QStringList projectBuildSystemFiles; + Utils::FileName base = m_project->projectDirectory(); + foreach (const QString &f, buildSystemFiles) { + if (Utils::FileName::fromString(f).isChildOf(base)) + projectBuildSystemFiles.append(f); + } + QbsGroupNode::setupFiles(m_buildSystemFiles, projectBuildSystemFiles, base.toString(), false); + update(m_project->qbsProjectData()); } +static QSet referencedBuildSystemFiles(const qbs::ProjectData &data) +{ + QSet result; + result.insert(data.location().fileName()); + foreach (const qbs::ProjectData &subProject, data.subProjects()) + result.unite(referencedBuildSystemFiles(subProject)); + foreach (const qbs::ProductData &product, data.products()) { + result.insert(product.location().fileName()); + foreach (const qbs::GroupData &group, product.groups()) + result.insert(group.location().fileName()); + } + + return result; +} + +QStringList QbsRootProjectNode::unreferencedBuildSystemFiles(const qbs::Project &p) const +{ + return p.buildSystemFiles().subtract(referencedBuildSystemFiles(p.projectData())).toList(); +} + } // namespace Internal } // namespace QbsProjectManager diff --git a/src/plugins/qbsprojectmanager/qbsnodes.h b/src/plugins/qbsprojectmanager/qbsnodes.h index bc3bc56962..92dfde80a7 100644 --- a/src/plugins/qbsprojectmanager/qbsnodes.h +++ b/src/plugins/qbsprojectmanager/qbsnodes.h @@ -111,7 +111,7 @@ public: QString productPath() const; - static void setupFiles(QbsBaseProjectNode *root, const QStringList &files, + static void setupFiles(FolderNode *root, const QStringList &files, const QString &productPath, bool updateExisting); private: @@ -184,6 +184,10 @@ private: static QIcon m_projectIcon; }; +// -------------------------------------------------------------------- +// QbsRootProjectNode: +// -------------------------------------------------------------------- + class QbsRootProjectNode : public QbsProjectNode { Q_OBJECT @@ -197,7 +201,10 @@ public: QbsProject *project() const { return m_project; } private: + QStringList unreferencedBuildSystemFiles(const qbs::Project &p) const; + QbsProject * const m_project; + ProjectExplorer::FolderNode *m_buildSystemFiles; }; -- cgit v1.2.1 From 07db90c04fcea5f13c836fd78534036a7eb16b59 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 23 Jul 2014 10:41:34 +0200 Subject: Debugger: Activate editor when re-using disassembler contents Task-number: QTCREATORBUG-12694 Change-Id: Ibba4501db687a86afae6ff5908dfe6377d2ae158 Reviewed-by: Christian Stenger --- src/plugins/debugger/disassembleragent.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/debugger/disassembleragent.cpp b/src/plugins/debugger/disassembleragent.cpp index c400d92a65..b0bbd4771f 100644 --- a/src/plugins/debugger/disassembleragent.cpp +++ b/src/plugins/debugger/disassembleragent.cpp @@ -314,6 +314,8 @@ void DisassemblerAgent::setContentsToDocument(const DisassemblerLines &contents) d->document->setProperty(Debugger::Constants::OPENED_BY_DEBUGGER, true); d->document->setProperty(Debugger::Constants::OPENED_WITH_DISASSEMBLY, true); d->configureMimeType(); + } else { + EditorManager::activateEditorForDocument(d->document); } d->document->setPlainText(contents.toString()); -- cgit v1.2.1 From 06dc8140ff38996c60097db3604423b118bba5ea Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Tue, 22 Jul 2014 17:05:28 +0200 Subject: qmljs: disable console warnings for failed dumping Change-Id: I7905dedb15ae7d84bf55013abdd822dd40984588 Reviewed-by: Christian Kandeler --- src/libs/qmljs/qmljsmodelmanagerinterface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp index 067a42e4a1..281e7461c5 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp @@ -210,7 +210,7 @@ QHash ModelManagerInterface::languageForSuffix() const void ModelManagerInterface::writeMessageInternal(const QString &msg) const { - qCWarning(qmljsLog) << msg; + qCDebug(qmljsLog) << msg; } ModelManagerInterface::WorkingCopy ModelManagerInterface::workingCopyInternal() const @@ -631,7 +631,7 @@ void ModelManagerInterface::updateDocument(Document::Ptr doc) void ModelManagerInterface::updateLibraryInfo(const QString &path, const LibraryInfo &info) { if (!info.pluginTypeInfoError().isEmpty()) - qCWarning(qmljsLog) << "Dumping errors for " << path << ":" << info.pluginTypeInfoError(); + qCDebug(qmljsLog) << "Dumping errors for " << path << ":" << info.pluginTypeInfoError(); { QMutexLocker locker(&m_mutex); -- cgit v1.2.1 From 5a16eaca04886433a6e380f7acb742861a266298 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 22 Jul 2014 18:03:47 +0200 Subject: Update qbs submodule. And do the necessary adaptations. Change-Id: I35b5c3e02a7265bdc9730154d6d1aa6b19371310 Reviewed-by: Joerg Bornemann --- qtcreator.pro | 2 +- src/shared/qbs | 2 +- src/src.qbs | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/qtcreator.pro b/qtcreator.pro index ad7b7d763c..5d22eb0409 100644 --- a/qtcreator.pro +++ b/qtcreator.pro @@ -65,7 +65,7 @@ minQtVersion(5, 0, 0):exists(src/shared/qbs/qbs.pro) { cache(QBS_RELATIVE_PLUGINS_PATH) QBS_RELATIVE_SEARCH_PATH = $$relative_path($$QBS_RESOURCES_BUILD_DIR, $$QBS_APPS_DESTDIR) cache(QBS_RELATIVE_SEARCH_PATH) - QBS_CONFIG_ADDITION = qbs_no_dev_install + QBS_CONFIG_ADDITION = qbs_no_dev_install qbs_enable_project_file_updates cache(CONFIG, add, QBS_CONFIG_ADDITION) } diff --git a/src/shared/qbs b/src/shared/qbs index 4d0a76fafe..c1767ae75e 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 4d0a76fafebf11af4ab948e60f9f8eae7097fca8 +Subproject commit c1767ae75e098ae224337cc2b8bd886be54c2e86 diff --git a/src/src.qbs b/src/src.qbs index 3680e8d006..08562c12fb 100644 --- a/src/src.qbs +++ b/src/src.qbs @@ -23,6 +23,7 @@ Project { condition: qbsSubModuleExists && !useExternalQbs property bool enableUnitTests: false + property bool enableProjectFileUpdates: true property bool installApiHeaders: false property string libInstallDir: project.ide_library_path property stringList libRPaths: qbs.targetOS.contains("osx") -- cgit v1.2.1 From 9f18349678303ae21c16f535e12b9fa0c0d3ffeb Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 22 Jul 2014 16:29:15 +0200 Subject: Debugger: Remove traces of mixed mode handling from debugger agent The agent is now fed with fully parsed content from the engine and has no notion of 'mixed mode' anymore. Change-Id: I15e3b16d5deb173564aa2e91737841366507358e Reviewed-by: Christian Stenger --- src/plugins/debugger/disassembleragent.cpp | 20 +------------------- src/plugins/debugger/disassembleragent.h | 1 - 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/src/plugins/debugger/disassembleragent.cpp b/src/plugins/debugger/disassembleragent.cpp index b0bbd4771f..54fb20cdd9 100644 --- a/src/plugins/debugger/disassembleragent.cpp +++ b/src/plugins/debugger/disassembleragent.cpp @@ -107,8 +107,6 @@ public: QList breakpointMarks; QList cache; QString mimeType; - bool tryMixedInitialized; - bool tryMixed; bool resetLocationScheduled; }; @@ -116,8 +114,6 @@ DisassemblerAgentPrivate::DisassemblerAgentPrivate() : document(0), locationMark(0), mimeType(_("text/x-qtcreator-generic-asm")), - tryMixedInitialized(false), - tryMixed(true), resetLocationScheduled(false) { locationMark.setIcon(debuggerCore()->locationMarkIcon()); @@ -201,20 +197,6 @@ const Location &DisassemblerAgent::location() const return d->location; } -bool DisassemblerAgent::isMixed() const -{ - if (!d->tryMixedInitialized) { - if (d->engine->startParameters().toolChainAbi.os() == ProjectExplorer::Abi::MacOS) - d->tryMixed = false; - d->tryMixedInitialized = true; - } - - return d->tryMixed - && d->location.lineNumber() > 0 - && !d->location.functionName().isEmpty() - && d->location.functionName() != _("??"); -} - void DisassemblerAgent::reload() { d->cache.clear(); @@ -228,7 +210,7 @@ void DisassemblerAgent::setLocation(const Location &loc) if (index != -1) { // Refresh when not displaying a function and there is not sufficient // context left past the address. - if (!isMixed() && d->cache.at(index).first.endAddress - loc.address() < 24) { + if (d->cache.at(index).first.endAddress - loc.address() < 24) { index = -1; d->cache.removeAt(index); } diff --git a/src/plugins/debugger/disassembleragent.h b/src/plugins/debugger/disassembleragent.h index 414de5941f..1a2f8e600c 100644 --- a/src/plugins/debugger/disassembleragent.h +++ b/src/plugins/debugger/disassembleragent.h @@ -65,7 +65,6 @@ public: quint64 address() const; bool contentsCoversAddress(const QString &contents) const; void cleanup(); - bool isMixed() const; // Force reload, e.g. after changing the output flavour. void reload(); -- cgit v1.2.1 From 52431d3df7f3acae72fb04e7a415f60b034afed1 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 23 Jul 2014 13:36:19 +0200 Subject: Doc: capitalize TS and QM That are abbreviations of "translation source" and "Qt message". Add the full forms, too. Change-Id: I983ec829adfa694781b2faba82c05ef18ef04cce Reviewed-by: Leena Miettinen --- doc/src/howto/creator-external-tools.qdoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/src/howto/creator-external-tools.qdoc b/doc/src/howto/creator-external-tools.qdoc index df8e4637f0..0369702c01 100644 --- a/doc/src/howto/creator-external-tools.qdoc +++ b/doc/src/howto/creator-external-tools.qdoc @@ -43,11 +43,12 @@ code and translations. The lrelease tool is used to create run-time translation files for use by the released application. - To synchronize ts files from a translator with the application code, + To synchronize translation source (TS) files from a translator with the + application code, select \gui {Tools > External > Text > Linguist > Update Translations (lupdate)}. - To generate from the ts files qm translation files that can be used by an + To generate from the TS files Qt message (QM) files that can be used by an application, select \gui {Tools > External > Text > Linguist > Release Translations (lrelease)}. -- cgit v1.2.1 From 20b11960b5a30eaa6c8bbe885bc8e2b75dca8c4c Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 11 Jul 2014 12:21:39 +0200 Subject: Debugger: fix Qt namespace detection for gdb 7.4.1-debian Change-Id: I379ff3dec051b22ffe313e6543020488550df97e Reviewed-by: Christian Stenger --- share/qtcreator/debugger/gdbbridge.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index 5f1781e84d..8fcb721ff6 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -1500,6 +1500,14 @@ class Dumper(DumperBase): except: pass + # Seemingly needed with Debian's GDB 7.4.1 + s = gdb.execute("ptype QByteArray", to_string=True) + ns = s[s.find("class")+6:s.find("QByteArray")] + if len(ns): + self.qtNamespaceToReport = ns + self.qtNamespace = lambda: ns + return ns + self.currentQtNamespaceGuess = "" return "" -- cgit v1.2.1 From 6e333f06079c160b1ecd5dfa682dadd909151d16 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 23 Jul 2014 15:06:06 +0200 Subject: Qbs: Avoid some warnings Change-Id: Id308bdcc916f7bdf931e45b0f02ea0b1ebe12320 Reviewed-by: hjk --- qbs/modules/pluginspec/pluginspec.qbs | 4 ++-- src/app/app_version_header.qbs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qbs/modules/pluginspec/pluginspec.qbs b/qbs/modules/pluginspec/pluginspec.qbs index 2b57b53d89..8c1045f3a3 100644 --- a/qbs/modules/pluginspec/pluginspec.qbs +++ b/qbs/modules/pluginspec/pluginspec.qbs @@ -12,7 +12,7 @@ Module { Artifact { fileTags: ["pluginSpec"] - fileName: input.fileName.replace(/\.[^\.]*$/,'') + filePath: input.fileName.replace(/\.[^\.]*$/,'') } prepare: { @@ -72,7 +72,7 @@ Module { Artifact { fileTags: ["qt_plugin_metadata"] - fileName: { + filePath: { var destdir = FileInfo.joinPaths(product.moduleProperty("Qt/core", "generatedFilesDir"), input.fileName); return destdir.replace(/\.[^\.]*$/, '.json'); diff --git a/src/app/app_version_header.qbs b/src/app/app_version_header.qbs index bd08249b47..891cf3974c 100644 --- a/src/app/app_version_header.qbs +++ b/src/app/app_version_header.qbs @@ -9,7 +9,7 @@ Product { Transformer { inputs: ["app_version.h.in"] Artifact { - fileName: "app/app_version.h" + filePath: "app/app_version.h" fileTags: "hpp" } prepare: { -- cgit v1.2.1 From cec2319e9a7ef2685102b56f891afc3f00cef79e Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 23 Jul 2014 11:23:09 +0200 Subject: Find: Fix that pressing escape when tool bar is disabled did nothing Change-Id: Ic8f3c897aa77bff2d1bb393186634418ff0d8d80 Task-number: QTCREATORBUG-12710 Reviewed-by: Nikolai Kosjar Reviewed-by: Eike Ziller --- src/plugins/coreplugin/find/findtoolbar.cpp | 8 ++++---- src/plugins/coreplugin/find/findtoolbar.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/coreplugin/find/findtoolbar.cpp b/src/plugins/coreplugin/find/findtoolbar.cpp index 78ee72d147..7aa9a73a36 100644 --- a/src/plugins/coreplugin/find/findtoolbar.cpp +++ b/src/plugins/coreplugin/find/findtoolbar.cpp @@ -348,8 +348,6 @@ void FindToolBar::updateToolBar() bool replaceEnabled = enabled && m_currentDocumentFind->supportsReplace(); bool showAllControls = canShowAllControls(replaceEnabled); - m_goToCurrentFindAction->setEnabled(enabled); - m_findNextAction->setEnabled(enabled); m_findPreviousAction->setEnabled(enabled); @@ -618,9 +616,11 @@ void FindToolBar::updateFlagMenus() m_preserveCaseAction->setEnabled((supportedFlags & FindPreserveCase) && !regexp && replaceEnabled); } -bool FindToolBar::setFocusToCurrentFindSupport() +void FindToolBar::setFocusToCurrentFindSupport() { - return m_currentDocumentFind->setFocusToCurrentFindSupport(); + if (!m_currentDocumentFind->setFocusToCurrentFindSupport()) + if (QWidget *w = focusWidget()) + w->clearFocus(); } void FindToolBar::hideAndResetFocus() diff --git a/src/plugins/coreplugin/find/findtoolbar.h b/src/plugins/coreplugin/find/findtoolbar.h index 1951c61e39..6990bc5c2b 100644 --- a/src/plugins/coreplugin/find/findtoolbar.h +++ b/src/plugins/coreplugin/find/findtoolbar.h @@ -119,7 +119,7 @@ private slots: void adaptToCandidate(); - bool setFocusToCurrentFindSupport(); + void setFocusToCurrentFindSupport(); protected: bool focusNextPrevChild(bool next); -- cgit v1.2.1 From 54eb6c42c737c8be19c87f69c8e7285c2172600e Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 16 Jul 2014 11:01:53 +0200 Subject: Documentation: Adjust after removal of the "Locked" view options Change-Id: I45c6030e3c7f6f79dedfd095110f0514691a2756 Reviewed-by: Leena Miettinen --- doc/src/analyze/creator-analyze.qdoc | 6 ++---- doc/src/debugger/creator-debugger.qdoc | 6 ++---- doc/src/widgets/qtdesigner-overview.qdoc | 13 +------------ 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/doc/src/analyze/creator-analyze.qdoc b/doc/src/analyze/creator-analyze.qdoc index a3663c87c4..d0a760c3b2 100644 --- a/doc/src/analyze/creator-analyze.qdoc +++ b/doc/src/analyze/creator-analyze.qdoc @@ -38,10 +38,8 @@ \image qtcreator-analyze-menu.png "Analyze mode menu" - By default, the views in the \gui Analyze mode are locked into place in the - workspace. Select \gui {Window > Views > Locked} to unlock the views. Drag - and drop the views into new positions on the screen. Drag view borders to - resize the views. The size and position of views are saved for future + You can drag and drop the views in the \gui Analyze mode to new positions + on the screen. The size and position of views are saved for future sessions. Select \gui {Window > Views > Reset to Default Layout} to reset the views to their original sizes and positions. diff --git a/doc/src/debugger/creator-debugger.qdoc b/doc/src/debugger/creator-debugger.qdoc index 9ffea0e51c..da09ceec30 100644 --- a/doc/src/debugger/creator-debugger.qdoc +++ b/doc/src/debugger/creator-debugger.qdoc @@ -412,10 +412,8 @@ \image qtcreator-debugger-views.png "Debug mode views" - By default, the views are locked into place in the workspace. Select - \gui {Window > Views > Locked} to unlock the views. Drag and drop the - views into new positions on the screen. Drag view borders to resize the - views. The size and position of views are saved for future sessions. Select + You can drag and drop the views in \QD to new positions on the screen. + The size and position of views are saved for future sessions. Select \gui {Window > Views > Reset to Default Layout} to reset the views to their original sizes and positions. diff --git a/doc/src/widgets/qtdesigner-overview.qdoc b/doc/src/widgets/qtdesigner-overview.qdoc index 989e65a1a3..ce7dfeb765 100644 --- a/doc/src/widgets/qtdesigner-overview.qdoc +++ b/doc/src/widgets/qtdesigner-overview.qdoc @@ -61,18 +61,7 @@ \section1 Specifying Settings for Qt Designer - To change the layout of \QD user interface elements: - - \list 1 - - \li Select \gui Tools > \gui{Form Editor} > \gui Views > \gui Locked. - - When this option is not checked, you can change the layout. - - \li Click the header of an element and drag the element to a new - position. - - \endlist + You can drag and drop the views in \QD to new positions on the screen. To specify settings for \QD: -- cgit v1.2.1 From b0de066759733a55cf0f363cbafea59837ccb0c9 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 23 Jul 2014 16:19:46 +0200 Subject: Doc: add missing CLI options Move -block up to keep general options together. Add example of running Qt Creator from the command line on OS X. Change-Id: Id9b6fcfa42d99dbb5a0df10d1d5dbfe0b73b5c48 Reviewed-by: Eike Ziller Reviewed-by: hjk --- doc/src/howto/creator-cli.qdoc | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/doc/src/howto/creator-cli.qdoc b/doc/src/howto/creator-cli.qdoc index d339e9da4d..69d596feee 100644 --- a/doc/src/howto/creator-cli.qdoc +++ b/doc/src/howto/creator-cli.qdoc @@ -42,7 +42,7 @@ between the filename and line number. You can also use a space between the separator and the line number. - For example: + For example, on Windows: \list @@ -54,6 +54,14 @@ \endlist + On OS X: + + \list + + \li \c {Qt Creator.app/Contents/MacOS/Qt Creator -help} + + \endlist + To open a project that is located in a particular folder, you can pass on the folder name as a command line argument. \QC looks for a session that matches the folder name and loads it. Or it looks for a project file in the folder and opens it. For example: @@ -88,6 +96,16 @@ \li -client \li Attempt to connect to an already running instance of \QC. + \row + \li -pid + \li Attempt to connect to an already running instance of \QC with + the specified process ID. + + \row + \li -block + \li Open files in editors in a running \QC instance and block the + command line until the first editor is closed. + \row \li -load \li Load the specified plugin. @@ -113,6 +131,11 @@ \li -color \li Core plugin: override the selected UI color. + \row + \li -presentationMode + \li Core plugin: display keyboard shortcuts as popups when you + press them. Mostly useful when presenting \QC to someone else. + \row \li -debug \li Debugger plugin: attach to the process with the given process ID. @@ -146,9 +169,9 @@ and sysroots. \row - \li -wincrashevent + \li -wincrashevent \li Debugger plugin: Attach to crashed processes by using the specified - event handle. + event handle and process ID. \row \li -customwizard-verbose @@ -162,10 +185,6 @@ Open the projects and files that were open when you last exited \QC. For more information about managing sessions, see \l{Managing Sessions}. - \row - \li -block - \li Open files in editors in a running \QC instance and block the - command line until the first editor is closed. \endtable \section1 Using Custom Styles -- cgit v1.2.1 From 99baab0429391eb787ed1ff04824fe382af7ebc4 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 23 Jul 2014 17:01:14 +0200 Subject: qbs build: Hide symbols by default. Like the qmake build does. Change-Id: I0791e5d09741718d356d869faa04c066ffe56f72 Reviewed-by: Joerg Bornemann --- qbs/imports/QtcProduct.qbs | 1 + 1 file changed, 1 insertion(+) diff --git a/qbs/imports/QtcProduct.qbs b/qbs/imports/QtcProduct.qbs index a0433de4ef..7372fa7698 100644 --- a/qbs/imports/QtcProduct.qbs +++ b/qbs/imports/QtcProduct.qbs @@ -15,6 +15,7 @@ Product { } cpp.minimumOsxVersion: "10.7" cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2" + cpp.visibility: "minimal" Depends { name: "Qt.core" } -- cgit v1.2.1 From 06bb01249b5c4e246df4bec61b0e0624dccfd774 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Wed, 23 Jul 2014 11:54:36 +0200 Subject: Android: Check for broken gdb on mac Task-number: QTCREATORBUG-12636 Change-Id: Ib41db2607fef6291c1464e5ce2ea626fd86b3025 Reviewed-by: hjk --- src/plugins/android/androidsettingswidget.cpp | 78 +++++ src/plugins/android/androidsettingswidget.h | 5 + src/plugins/android/androidsettingswidget.ui | 421 +++++++++++++++----------- 3 files changed, 332 insertions(+), 172 deletions(-) diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp index 4fc6d78ec7..6db4467442 100644 --- a/src/plugins/android/androidsettingswidget.cpp +++ b/src/plugins/android/androidsettingswidget.cpp @@ -49,6 +49,8 @@ #include #include #include +#include +#include #include #include @@ -170,11 +172,16 @@ AndroidSettingsWidget::AndroidSettingsWidget(QWidget *parent) m_ui->downloadAntToolButton->setVisible(!Utils::HostOsInfo::isLinuxHost()); m_ui->downloadOpenJDKToolButton->setVisible(!Utils::HostOsInfo::isLinuxHost()); + connect(m_ui->gdbWarningLabel, SIGNAL(linkActivated(QString)), + this, SLOT(showGdbWarningDialog())); + check(All); applyToUi(All); connect(&m_futureWatcher, SIGNAL(finished()), this, SLOT(avdAdded())); + connect(&m_checkGdbWatcher, SIGNAL(finished()), + this, SLOT(checkGdbFinished())); } AndroidSettingsWidget::~AndroidSettingsWidget() @@ -183,6 +190,41 @@ AndroidSettingsWidget::~AndroidSettingsWidget() m_futureWatcher.waitForFinished(); } +// NOTE: Will be run via QFuture +static QPair checkGdbForBrokenPython(const QString &path) +{ + QTime timer; + timer.start(); + QProcess proc; + proc.setProcessChannelMode(QProcess::MergedChannels); + proc.start(path); + proc.waitForStarted(); + + QByteArray output; + while (proc.waitForReadyRead(300)) { + output += proc.readAll(); + if (output.contains("(gdb)")) + break; + if (timer.elapsed() > 7 * 1000) + return qMakePair(path, false); // Took too long, abort + } + + output.clear(); + + proc.write("python import struct\n"); + proc.write("quit\n"); + while (proc.waitForFinished(300)) { + if (timer.elapsed() > 9 * 1000) + return qMakePair(path, false); // Took too long, abort + } + proc.waitForFinished(); + + output = proc.readAll(); + + bool error = output.contains("_PyObject_Free") || output.contains("_PyExc_IOError"); + return qMakePair(path, error); +} + void AndroidSettingsWidget::check(AndroidSettingsWidget::Mode mode) { if (mode & Sdk) { @@ -214,6 +256,23 @@ void AndroidSettingsWidget::check(AndroidSettingsWidget::Mode mode) = AndroidToolChainFactory::toolchainPathsForNdk(m_androidConfig.ndkLocation()); m_ndkCompilerCount = compilerPaths.count(); + // Check for a gdb with a broken python + if (Utils::HostOsInfo::isMacHost()) { + foreach (const AndroidToolChainFactory::AndroidToolChainInformation &ati, compilerPaths) { + // we only check the arm gdbs, that's indicative enough + if (ati.architecture != ProjectExplorer::Abi::ArmArchitecture) + continue; + Utils::FileName gdbPath = AndroidConfigurations::currentConfig().gdbPath(ati.architecture, ati.version); + if (gdbPath.toFileInfo().exists()) { + m_ui->gdbWarningIconLabel->setVisible(false); + m_ui->gdbWarningLabel->setVisible(false); + m_checkGdbWatcher.setFuture(QtConcurrent::run(&checkGdbForBrokenPython, gdbPath.toString())); + m_gdbCheckPath = gdbPath.toString(); + break; + } + } + } + // See if we have qt versions for those toolchains QSet toolchainsForArch; @@ -508,6 +567,25 @@ void AndroidSettingsWidget::createKitToggled() m_androidConfig.setAutomaticKitCreation(m_ui->CreateKitCheckBox->isChecked()); } +void AndroidSettingsWidget::checkGdbFinished() +{ + QPair result = m_checkGdbWatcher.future().result(); + if (result.first != m_gdbCheckPath) // no longer relevant + return; + m_ui->gdbWarningIconLabel->setVisible(result.second); + m_ui->gdbWarningLabel->setVisible(result.second); +} + +void AndroidSettingsWidget::showGdbWarningDialog() +{ + QMessageBox::warning(this, + tr("Unsupported GDB"), + tr("The GDB inside this NDK seems to not support Python. " + "The Qt Project offers fixed GDB builds at: " + "" + "http://download.qt-project.org/official_releases/gdb/osx/")); +} + void AndroidSettingsWidget::manageAVD() { QProcess *avdProcess = new QProcess(); diff --git a/src/plugins/android/androidsettingswidget.h b/src/plugins/android/androidsettingswidget.h index e657db3e6d..2be6b1b522 100644 --- a/src/plugins/android/androidsettingswidget.h +++ b/src/plugins/android/androidsettingswidget.h @@ -92,6 +92,9 @@ private slots: void manageAVD(); void createKitToggled(); + void checkGdbFinished(); + void showGdbWarningDialog(); + private: enum Mode { Sdk = 1, Ndk = 2, Java = 4, All = Sdk | Ndk | Java }; enum State { NotSet = 0, Okay = 1, Error = 2 }; @@ -111,6 +114,8 @@ private: AndroidConfig m_androidConfig; AvdModel m_AVDModel; QFutureWatcher m_futureWatcher; + QFutureWatcher> m_checkGdbWatcher; + QString m_gdbCheckPath; }; } // namespace Internal diff --git a/src/plugins/android/androidsettingswidget.ui b/src/plugins/android/androidsettingswidget.ui index 5b40861e16..4b4321f70a 100644 --- a/src/plugins/android/androidsettingswidget.ui +++ b/src/plugins/android/androidsettingswidget.ui @@ -6,45 +6,34 @@ 0 0 - 573 - 429 + 843 + 625 Android Configuration - - - + + + - + 0 0 - JDK location: + Android SDK location: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Download JDK - - - - :/android/images/download.png:/android/images/download.png - - + + - + @@ -58,7 +47,7 @@ - :/core/images/warning.png + :/core/images/warning.png @@ -80,37 +69,7 @@ - - - - - 0 - 0 - - - - Android SDK location: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - Download Android SDK - - - - :/android/images/download.png:/android/images/download.png - - - - + @@ -146,29 +105,13 @@ - - - - - 0 - 0 - - - - Android NDK location: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - + + - - + + - Download Android NDK + Download Ant @@ -176,98 +119,7 @@ - - - - 2 - - - - - - 0 - 0 - - - - - - - :/core/images/error.png - - - - - - - - 0 - 0 - - - - - - - - - - - - - - 0 - 0 - - - - Automatically create kits for Android tool chains - - - true - - - - - - - 2 - - - - - - 0 - 0 - - - - - - - :/core/images/warning.png - - - - - - - - 0 - 0 - - - - - - - true - - - - - - + @@ -283,13 +135,21 @@ - - + + + + Download Android SDK + + + + :/android/images/download.png:/android/images/download.png + + - - + + - Download Ant + Download Android NDK @@ -297,7 +157,7 @@ - + QFrame::StyledPanel @@ -416,6 +276,182 @@ + + + + + 0 + 0 + + + + JDK location: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 2 + + + + + + 0 + 0 + + + + + + + :/core/images/error.png + + + + + + + + 0 + 0 + + + + + + + + + + + + + + 0 + 0 + + + + Android NDK location: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + Download JDK + + + + :/android/images/download.png:/android/images/download.png + + + + + + + + 0 + 0 + + + + Automatically create kits for Android tool chains + + + true + + + + + + + 2 + + + + + + 0 + 0 + + + + + + + :/core/images/warning.png + + + + + + + + 0 + 0 + + + + + + + true + + + + + + + + + + + + 2 + + + + + + 0 + 0 + + + + + + + :/core/images/error.png + + + + + + + + 0 + 0 + + + + <a href="xx">The GDB in the NDK appears to have broken python support.</a> + + + + + @@ -428,6 +464,7 @@ + @@ -627,24 +664,64 @@ clicked() AndroidSettingsWidget openSDKDownloadUrl() + + + 20 + 20 + + + 20 + 20 + + downloadNDKToolButton clicked() AndroidSettingsWidget openNDKDownloadUrl() + + + 20 + 20 + + + 20 + 20 + + downloadAntToolButton clicked() AndroidSettingsWidget openAntDownloadUrl() + + + 20 + 20 + + + 20 + 20 + + downloadOpenJDKToolButton clicked() AndroidSettingsWidget openOpenJDKDownloadUrl() + + + 20 + 20 + + + 20 + 20 + + -- cgit v1.2.1 From efa62d54c756c9504eb36d0583c9ad8de5532a9d Mon Sep 17 00:00:00 2001 From: Tim Sander Date: Wed, 23 Jul 2014 17:25:41 +0200 Subject: RemoteLinux: Fix arguments for remote debugging. Was broken by 162d0e3d. Task-number: QTCREATORBUG-12718 Change-Id: I30cc8a8df89e4e0b0ffbd4c045a0b9d87abb8823 Reviewed-by: Christian Kandeler --- src/plugins/remotelinux/remotelinuxdebugsupport.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp index 11a5f0df52..58cd4e5c13 100644 --- a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp +++ b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp @@ -178,9 +178,10 @@ void LinuxDeviceDebugSupport::startExecution() command = device()->debugServerPath(); if (command.isEmpty()) command = QLatin1String("gdbserver"); - args.prepend(QString::fromLatin1(":%1").arg(d->gdbServerPort)); - args.prepend(QString::fromLatin1("--multi")); - args.prepend(QString::fromLatin1("--once")); + args.clear(); + args.append(QString::fromLatin1("--once")); + args.append(QString::fromLatin1("--multi")); + args.append(QString::fromLatin1(":%1").arg(d->gdbServerPort)); } connect(runner, SIGNAL(finished(bool)), SLOT(handleAppRunnerFinished(bool))); -- cgit v1.2.1 From 75ff5062d686d6a19ba4fcab35aabc8417dc1265 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 23 Jul 2014 10:48:29 +0200 Subject: Qbs: Read systemIncludePath and make them available to the code model Change-Id: Ie16501a78e95f9c50631e5af8e9e8857dfd65b2f Reviewed-by: Christian Kandeler Reviewed-by: Jake Petroules --- src/plugins/qbsprojectmanager/qbsproject.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index 45a26e3a5d..cc963c449a 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -86,7 +86,9 @@ static const char CONFIG_CXXFLAGS[] = "cxxFlags"; static const char CONFIG_CFLAGS[] = "cFlags"; static const char CONFIG_DEFINES[] = "defines"; static const char CONFIG_INCLUDEPATHS[] = "includePaths"; +static const char CONFIG_SYSTEM_INCLUDEPATHS[] = "systemIncludePaths"; static const char CONFIG_FRAMEWORKPATHS[] = "frameworkPaths"; +static const char CONFIG_SYSTEM_FRAMEWORKPATHS[] = "systemFrameworkPaths"; static const char CONFIG_PRECOMPILEDHEADER[] = "precompiledHeader"; static const char CONFIGURATION_PATH[] = ""; @@ -655,6 +657,8 @@ void QbsProject::updateCppCodeModel(const qbs::ProjectData &prj) list = props.getModulePropertiesAsStringList(QLatin1String(CONFIG_CPP_MODULE), QLatin1String(CONFIG_INCLUDEPATHS)); + list.append(props.getModulePropertiesAsStringList(QLatin1String(CONFIG_CPP_MODULE), + QLatin1String(CONFIG_SYSTEM_INCLUDEPATHS))); CppTools::ProjectPart::HeaderPaths grpHeaderPaths; foreach (const QString &p, list) grpHeaderPaths += CppTools::ProjectPart::HeaderPath( @@ -663,6 +667,8 @@ void QbsProject::updateCppCodeModel(const qbs::ProjectData &prj) list = props.getModulePropertiesAsStringList(QLatin1String(CONFIG_CPP_MODULE), QLatin1String(CONFIG_FRAMEWORKPATHS)); + list.append(props.getModulePropertiesAsStringList(QLatin1String(CONFIG_CPP_MODULE), + QLatin1String(CONFIG_SYSTEM_FRAMEWORKPATHS))); foreach (const QString &p, list) grpHeaderPaths += CppTools::ProjectPart::HeaderPath( FileName::fromUserInput(p).toString(), -- cgit v1.2.1 From 089e6901086fed09404b9b22be9a56eed7f7bbdf Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 22 Jul 2014 16:32:57 +0200 Subject: Abi: Remove endianness from ABI The functionality is not implemented properly, remove it before someone thinks it was. Change-Id: I6e9c423a6b84a4a5fcf4d817e14df97fbdc901c5 Reviewed-by: Jake Petroules Reviewed-by: Tim Sander Reviewed-by: Christian Kandeler Reviewed-by: Eike Ziller --- src/plugins/projectexplorer/abi.cpp | 8 -------- src/plugins/projectexplorer/abi.h | 7 ------- src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp | 5 ----- 3 files changed, 20 deletions(-) diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index 30a8a132f8..dcb846138f 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -817,14 +817,6 @@ QList Abi::abisOfBinary(const Utils::FileName &path) return result; } -ProjectExplorer::Abi::Endianness Abi::endianness() const -{ - if (m_architecture == X86Architecture) - return LittleEndian; - // All other architectures are bi-endian:/ - return UnknownEndian; // Todo: Add a field for endianness to the Abi struct! -} - } // namespace ProjectExplorer // Unit tests: diff --git a/src/plugins/projectexplorer/abi.h b/src/plugins/projectexplorer/abi.h index 6b4c090b0e..8b674c759c 100644 --- a/src/plugins/projectexplorer/abi.h +++ b/src/plugins/projectexplorer/abi.h @@ -101,12 +101,6 @@ public: UnknownFormat }; - enum Endianness { - LittleEndian, - BigEndian, - UnknownEndian - }; - Abi() : m_architecture(UnknownArchitecture), m_os(UnknownOS), m_osFlavor(UnknownFlavor), m_binaryFormat(UnknownFormat), m_wordWidth(0) @@ -126,7 +120,6 @@ public: bool isNull() const; Architecture architecture() const { return m_architecture; } - Endianness endianness() const; OS os() const { return m_os; } OSFlavor osFlavor() const { return m_osFlavor; } BinaryFormat binaryFormat() const { return m_binaryFormat; } diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index 159e364959..1e92dd3e8d 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -91,11 +91,6 @@ QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, c qbs::Internal::HostOsInfo::canonicalArchitecture(architecture)); } - if (targetAbi.endianness() == ProjectExplorer::Abi::BigEndian) - data.insert(QLatin1String(QBS_ENDIANNESS), QLatin1String("big")); - else if (targetAbi.endianness() == ProjectExplorer::Abi::LittleEndian) - data.insert(QLatin1String(QBS_ENDIANNESS), QLatin1String("little")); - if (targetAbi.os() == ProjectExplorer::Abi::WindowsOS) { data.insert(QLatin1String(QBS_TARGETOS), QLatin1String("windows")); data.insert(QLatin1String(QBS_TOOLCHAIN), -- cgit v1.2.1 From 7bb3f728ef583c7ae9a6717a3816f785a914c9c2 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 23 Jul 2014 16:07:39 +0200 Subject: Analyzer: Set dockwidget title on inner widget first Will be promoted to dockwidget title by the fancy mainwindow. Change-Id: Idbb4d2869c254140a241cd5a8f5b75b3ef739692 Reviewed-by: Eike Ziller --- src/plugins/analyzerbase/analyzermanager.cpp | 3 +-- src/plugins/analyzerbase/analyzermanager.h | 2 +- src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp | 11 +++++++---- src/plugins/valgrind/callgrindtool.cpp | 12 ++++++++---- src/plugins/valgrind/memchecktool.cpp | 3 ++- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/plugins/analyzerbase/analyzermanager.cpp b/src/plugins/analyzerbase/analyzermanager.cpp index afb06ab464..0de28c728d 100644 --- a/src/plugins/analyzerbase/analyzermanager.cpp +++ b/src/plugins/analyzerbase/analyzermanager.cpp @@ -624,14 +624,13 @@ void AnalyzerManager::addAction(AnalyzerAction *action) d->addAction(action); } -QDockWidget *AnalyzerManager::createDockWidget(IAnalyzerTool *tool, const QString &title, +QDockWidget *AnalyzerManager::createDockWidget(IAnalyzerTool *tool, QWidget *widget, Qt::DockWidgetArea area) { QTC_ASSERT(!widget->objectName().isEmpty(), return 0); QDockWidget *dockWidget = d->m_mainWindow->addDockForWidget(widget); dockWidget->setProperty(INITIAL_DOCK_AREA, int(area)); d->m_dockWidgets.append(AnalyzerManagerPrivate::DockPtr(dockWidget)); - dockWidget->setWindowTitle(title); d->m_toolWidgets[tool].push_back(dockWidget); return dockWidget; } diff --git a/src/plugins/analyzerbase/analyzermanager.h b/src/plugins/analyzerbase/analyzermanager.h index 2ba0764e65..6b5c61b636 100644 --- a/src/plugins/analyzerbase/analyzermanager.h +++ b/src/plugins/analyzerbase/analyzermanager.h @@ -69,7 +69,7 @@ public: static void addAction(AnalyzerAction *action); // Dockwidgets are registered to the main window. - static QDockWidget *createDockWidget(IAnalyzerTool *tool, const QString &title, + static QDockWidget *createDockWidget(IAnalyzerTool *tool, QWidget *widget, Qt::DockWidgetArea area = Qt::TopDockWidgetArea); static Utils::FancyMainWindow *mainWindow(); diff --git a/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp b/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp index b4c59360b2..58e1e1b448 100644 --- a/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp @@ -96,6 +96,7 @@ void QmlProfilerViewManager::createViews() this, d->profilerModelManager, d->profilerState); + d->traceView->setWindowTitle(tr("Timeline")); connect(d->traceView, SIGNAL(gotoSourceLocation(QString,int,int)), this, SIGNAL(gotoSourceLocation(QString,int,int))); d->traceView->reset(); @@ -103,6 +104,7 @@ void QmlProfilerViewManager::createViews() d->eventsView = new QmlProfilerEventsWidget(mw, d->profilerTool, this, d->profilerModelManager); + d->eventsView->setWindowTitle(tr("Events")); connect(d->eventsView, SIGNAL(gotoSourceLocation(QString,int,int)), this, SIGNAL(gotoSourceLocation(QString,int,int))); connect(d->eventsView, SIGNAL(eventSelectedByTypeIndex(int)), @@ -112,6 +114,7 @@ void QmlProfilerViewManager::createViews() d->v8profilerView = new QV8ProfilerEventsWidget(mw, d->profilerTool, this, d->profilerModelManager); + d->v8profilerView->setWindowTitle(tr("JavaScript")); connect(d->v8profilerView, SIGNAL(gotoSourceLocation(QString,int,int)), this, SIGNAL(gotoSourceLocation(QString,int,int))); connect(d->traceView, SIGNAL(gotoSourceLocation(QString,int,int)), @@ -124,11 +127,11 @@ void QmlProfilerViewManager::createViews() d->v8profilerView, SLOT(selectBySourceLocation(QString,int,int))); QDockWidget *eventsDock = AnalyzerManager::createDockWidget - (d->profilerTool, tr("Events"), d->eventsView, Qt::BottomDockWidgetArea); + (d->profilerTool, d->eventsView, Qt::BottomDockWidgetArea); QDockWidget *timelineDock = AnalyzerManager::createDockWidget - (d->profilerTool, tr("Timeline"), d->traceView, Qt::BottomDockWidgetArea); - QDockWidget *v8profilerDock = AnalyzerManager::createDockWidget( - d->profilerTool, tr("JavaScript"), d->v8profilerView, Qt::BottomDockWidgetArea); + (d->profilerTool, d->traceView, Qt::BottomDockWidgetArea); + QDockWidget *v8profilerDock = AnalyzerManager::createDockWidget + (d->profilerTool, d->v8profilerView, Qt::BottomDockWidgetArea); eventsDock->show(); timelineDock->show(); diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index 6aec7c9709..5d034becff 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -596,12 +596,14 @@ QWidget *CallgrindToolPrivate::createWidgets() m_visualisation = new Visualisation(mw); m_visualisation->setFrameStyle(QFrame::NoFrame); m_visualisation->setObjectName(QLatin1String("Valgrind.CallgrindTool.Visualisation")); + m_visualisation->setWindowTitle(tr("Visualization")); m_visualisation->setModel(m_dataModel); connect(m_visualisation, SIGNAL(functionActivated(const Valgrind::Callgrind::Function*)), this, SLOT(visualisationFunctionSelected(const Valgrind::Callgrind::Function*))); m_callersView = new CostView(mw); m_callersView->setObjectName(QLatin1String("Valgrind.CallgrindTool.CallersView")); + m_callersView->setWindowTitle(tr("Callers")); m_callersView->setSettings(coreSettings, "Valgrind.CallgrindTool.CallersView"); m_callersView->sortByColumn(CallModel::CostColumn); m_callersView->setFrameStyle(QFrame::NoFrame); @@ -615,6 +617,7 @@ QWidget *CallgrindToolPrivate::createWidgets() m_calleesView = new CostView(mw); m_calleesView->setObjectName(QLatin1String("Valgrind.CallgrindTool.CalleesView")); + m_calleesView->setWindowTitle(tr("Callees")); m_calleesView->setSettings(coreSettings, "Valgrind.CallgrindTool.CalleesView"); m_calleesView->sortByColumn(CallModel::CostColumn); m_calleesView->setFrameStyle(QFrame::NoFrame); @@ -628,6 +631,7 @@ QWidget *CallgrindToolPrivate::createWidgets() m_flatView = new CostView(mw); m_flatView->setObjectName(QLatin1String("Valgrind.CallgrindTool.FlatView")); + m_flatView->setWindowTitle(tr("Functions")); m_flatView->setSettings(coreSettings, "Valgrind.CallgrindTool.FlatView"); m_flatView->sortByColumn(DataModel::SelfCostColumn); m_flatView->setFrameStyle(QFrame::NoFrame); @@ -639,16 +643,16 @@ QWidget *CallgrindToolPrivate::createWidgets() updateCostFormat(); QDockWidget *callersDock = AnalyzerManager::createDockWidget - (q, tr("Callers"), m_callersView, Qt::BottomDockWidgetArea); + (q, m_callersView, Qt::BottomDockWidgetArea); QDockWidget *flatDock = AnalyzerManager::createDockWidget - (q, tr("Functions"), m_flatView, Qt::BottomDockWidgetArea); + (q, m_flatView, Qt::BottomDockWidgetArea); QDockWidget *calleesDock = AnalyzerManager::createDockWidget - (q, tr("Callees"), m_calleesView, Qt::BottomDockWidgetArea); + (q, m_calleesView, Qt::BottomDockWidgetArea); QDockWidget *visualizationDock = AnalyzerManager::createDockWidget - (q, tr("Visualization"), m_visualisation, Qt::RightDockWidgetArea); + (q, m_visualisation, Qt::RightDockWidgetArea); callersDock->show(); calleesDock->show(); diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 41741a2235..74f787a396 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -364,9 +364,10 @@ QWidget *MemcheckTool::createWidgets() m_errorView->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); m_errorView->setAutoScroll(false); m_errorView->setObjectName(QLatin1String("Valgrind.MemcheckTool.ErrorView")); + m_errorView->setWindowTitle(tr("Memory Issues")); QDockWidget *errorDock = AnalyzerManager::createDockWidget - (this, tr("Memory Issues"), m_errorView, Qt::BottomDockWidgetArea); + (this, m_errorView, Qt::BottomDockWidgetArea); errorDock->show(); mw->splitDockWidget(mw->toolBarDockWidget(), errorDock, Qt::Vertical); -- cgit v1.2.1 From b8adc786157b81b0400cf701d02694a380d3e780 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 23 Jul 2014 16:57:16 +0200 Subject: Analyzer: Use a more common default value for the initial dock area Change-Id: I8449d7e540d715ffc1fbcc46b21a1a4ea7d740ab Reviewed-by: Eike Ziller --- src/plugins/analyzerbase/analyzermanager.h | 2 +- src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp | 6 +++--- src/plugins/valgrind/callgrindtool.cpp | 12 +++--------- src/plugins/valgrind/memchecktool.cpp | 3 +-- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/plugins/analyzerbase/analyzermanager.h b/src/plugins/analyzerbase/analyzermanager.h index 6b5c61b636..a7ebee19fc 100644 --- a/src/plugins/analyzerbase/analyzermanager.h +++ b/src/plugins/analyzerbase/analyzermanager.h @@ -70,7 +70,7 @@ public: // Dockwidgets are registered to the main window. static QDockWidget *createDockWidget(IAnalyzerTool *tool, - QWidget *widget, Qt::DockWidgetArea area = Qt::TopDockWidgetArea); + QWidget *widget, Qt::DockWidgetArea area = Qt::BottomDockWidgetArea); static Utils::FancyMainWindow *mainWindow(); diff --git a/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp b/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp index 58e1e1b448..ec2a9819d5 100644 --- a/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp @@ -127,11 +127,11 @@ void QmlProfilerViewManager::createViews() d->v8profilerView, SLOT(selectBySourceLocation(QString,int,int))); QDockWidget *eventsDock = AnalyzerManager::createDockWidget - (d->profilerTool, d->eventsView, Qt::BottomDockWidgetArea); + (d->profilerTool, d->eventsView); QDockWidget *timelineDock = AnalyzerManager::createDockWidget - (d->profilerTool, d->traceView, Qt::BottomDockWidgetArea); + (d->profilerTool, d->traceView); QDockWidget *v8profilerDock = AnalyzerManager::createDockWidget - (d->profilerTool, d->v8profilerView, Qt::BottomDockWidgetArea); + (d->profilerTool, d->v8profilerView); eventsDock->show(); timelineDock->show(); diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index 5d034becff..6c04735e93 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -642,15 +642,9 @@ QWidget *CallgrindToolPrivate::createWidgets() updateCostFormat(); - QDockWidget *callersDock = AnalyzerManager::createDockWidget - (q, m_callersView, Qt::BottomDockWidgetArea); - - QDockWidget *flatDock = AnalyzerManager::createDockWidget - (q, m_flatView, Qt::BottomDockWidgetArea); - - QDockWidget *calleesDock = AnalyzerManager::createDockWidget - (q, m_calleesView, Qt::BottomDockWidgetArea); - + QDockWidget *callersDock = AnalyzerManager::createDockWidget(q, m_callersView); + QDockWidget *flatDock = AnalyzerManager::createDockWidget(q, m_flatView); + QDockWidget *calleesDock = AnalyzerManager::createDockWidget(q, m_calleesView); QDockWidget *visualizationDock = AnalyzerManager::createDockWidget (q, m_visualisation, Qt::RightDockWidgetArea); diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 74f787a396..d83b1cb826 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -366,8 +366,7 @@ QWidget *MemcheckTool::createWidgets() m_errorView->setObjectName(QLatin1String("Valgrind.MemcheckTool.ErrorView")); m_errorView->setWindowTitle(tr("Memory Issues")); - QDockWidget *errorDock = AnalyzerManager::createDockWidget - (this, m_errorView, Qt::BottomDockWidgetArea); + QDockWidget *errorDock = AnalyzerManager::createDockWidget(this, m_errorView); errorDock->show(); mw->splitDockWidget(mw->toolBarDockWidget(), errorDock, Qt::Vertical); -- cgit v1.2.1 From 3a242495fe28811c535fab909db5aa42dc68873b Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Wed, 16 Jul 2014 16:35:03 +0200 Subject: ObjC++: also index ObjC symbols. @classes, @protocols, @properties and -methods (and +methods) will now show up in the locator. Change-Id: I33f904c456c321fc80b8aba7ff52d5f1207c58be Reviewed-by: Nikolai Kosjar --- src/libs/3rdparty/cplusplus/Bind.cpp | 2 + src/plugins/cpptools/cpplocatorfilter_test.cpp | 23 +++++++++ src/plugins/cpptools/searchsymbols.cpp | 70 +++++++++++++++++--------- src/plugins/cpptools/searchsymbols.h | 12 +++-- tests/cpplocators/testdata_basic/file1.mm | 23 +++++++++ 5 files changed, 101 insertions(+), 29 deletions(-) create mode 100644 tests/cpplocators/testdata_basic/file1.mm diff --git a/src/libs/3rdparty/cplusplus/Bind.cpp b/src/libs/3rdparty/cplusplus/Bind.cpp index ed39f95c1c..604bafe26b 100644 --- a/src/libs/3rdparty/cplusplus/Bind.cpp +++ b/src/libs/3rdparty/cplusplus/Bind.cpp @@ -2567,6 +2567,8 @@ bool Bind::visit(ObjCMethodDeclarationAST *ast) this->statement(ast->function_body); (void) switchScope(previousScope); _scope->addMember(method); + } else if (method) { + _scope->addMember(method); } return false; diff --git a/src/plugins/cpptools/cpplocatorfilter_test.cpp b/src/plugins/cpptools/cpplocatorfilter_test.cpp index 1a6b2472f2..ad4da2fc5c 100644 --- a/src/plugins/cpptools/cpplocatorfilter_test.cpp +++ b/src/plugins/cpptools/cpplocatorfilter_test.cpp @@ -168,7 +168,9 @@ void CppToolsPlugin::test_cpplocatorfilters_CppLocatorFilter_data() MyTestDataDir testDirectory(QLatin1String("testdata_basic")); const QString testFile = testDirectory.file(QLatin1String("file1.cpp")); + const QString objTestFile = testDirectory.file(QLatin1String("file1.mm")); const QString testFileShort = FileUtils::shortNativePath(FileName::fromString(testFile)); + const QString objTestFileShort = FileUtils::shortNativePath(FileName::fromString(objTestFile)); QTest::newRow("CppFunctionsFilter") << testFile @@ -247,6 +249,27 @@ void CppToolsPlugin::test_cpplocatorfilters_CppLocatorFilter_data() << ResultData(_("MyNamespace::myFunction"), _("(bool, int)")) << ResultData(_("myFunction"), _("(bool, int)")) ); + + QTest::newRow("CppClassesFilter-ObjC") + << objTestFile + << cppClassesFilter + << _("M") + << (QList() + << ResultData(_("MyClass"), objTestFileShort) + << ResultData(_("MyClass"), objTestFileShort) + << ResultData(_("MyClass"), objTestFileShort) + << ResultData(_("MyProtocol"), objTestFileShort) + ); + + QTest::newRow("CppFunctionsFilter-ObjC") + << objTestFile + << cppFunctionsFilter + << _("M") + << (QList() + << ResultData(_("anotherMethod"), _("MyClass")) + << ResultData(_("anotherMethod:"), _("MyClass")) + << ResultData(_("someMethod"), _("MyClass")) + ); } void CppToolsPlugin::test_cpplocatorfilters_CppCurrentDocumentFilter() diff --git a/src/plugins/cpptools/searchsymbols.cpp b/src/plugins/cpptools/searchsymbols.cpp index 0fe83a1a41..e142d057aa 100644 --- a/src/plugins/cpptools/searchsymbols.cpp +++ b/src/plugins/cpptools/searchsymbols.cpp @@ -105,11 +105,7 @@ bool SearchSymbols::visit(Enum *symbol) bool SearchSymbols::visit(Function *symbol) { - if (!(symbolsToSearchFor & SymbolSearcher::Functions) || !symbol->name()) - return false; - QString name = overview.prettyName(symbol->name()); - QString type = overview.prettyType(symbol->type()); - addChildItem(name, type, _scope, IndexItem::Function, symbol); + processFunction(symbol); return false; } @@ -130,10 +126,12 @@ bool SearchSymbols::visit(Declaration *symbol) // if we're searching for functions, still allow signal declarations to show up. if (symbolsToSearchFor & SymbolSearcher::Functions) { Function *funTy = symbol->type()->asFunctionType(); - if (!funTy) - return false; - if (!funTy->isSignal()) + if (!funTy) { + if (!symbol->type()->asObjCMethodType()) + return false; + } else if (!funTy->isSignal()) { return false; + } } else { return false; } @@ -153,19 +151,7 @@ bool SearchSymbols::visit(Declaration *symbol) bool SearchSymbols::visit(Class *symbol) { - QString name = overview.prettyName(symbol->name()); - - IndexItem::Ptr newParent; - if (symbolsToSearchFor & SymbolSearcher::Classes) - newParent = addChildItem(name, QString(), _scope, IndexItem::Class, symbol); - if (!newParent) - newParent = _parent; - ScopedIndexItemPtr parentRaii(_parent, newParent); - - QString newScope = scopedSymbolName(name, symbol); - ScopedScope scopeRaii(_scope, newScope); - for (unsigned i = 0, ei = symbol->memberCount(); i != ei; ++i) - accept(symbol->memberAt(i)); + processClass(symbol); return false; } @@ -225,8 +211,10 @@ bool SearchSymbols::visit(CPlusPlus::ObjCBaseProtocol *) return false; } -bool SearchSymbols::visit(CPlusPlus::ObjCClass *) +bool SearchSymbols::visit(CPlusPlus::ObjCClass *symbol) { + processClass(symbol); + return false; } @@ -235,8 +223,10 @@ bool SearchSymbols::visit(CPlusPlus::ObjCForwardClassDeclaration *) return false; } -bool SearchSymbols::visit(CPlusPlus::ObjCProtocol *) +bool SearchSymbols::visit(CPlusPlus::ObjCProtocol *symbol) { + processClass(symbol); + return false; } @@ -245,13 +235,15 @@ bool SearchSymbols::visit(CPlusPlus::ObjCForwardProtocolDeclaration *) return false; } -bool SearchSymbols::visit(CPlusPlus::ObjCMethod *) +bool SearchSymbols::visit(CPlusPlus::ObjCMethod *symbol) { + processFunction(symbol); return false; } -bool SearchSymbols::visit(CPlusPlus::ObjCPropertyDeclaration *) +bool SearchSymbols::visit(CPlusPlus::ObjCPropertyDeclaration *symbol) { + processFunction(symbol); return false; } @@ -315,3 +307,31 @@ IndexItem::Ptr SearchSymbols::addChildItem(const QString &symbolName, const QStr _parent->addChild(newItem); return newItem; } + +template +void SearchSymbols::processClass(T *clazz) +{ + QString name = overview.prettyName(clazz->name()); + + IndexItem::Ptr newParent; + if (symbolsToSearchFor & SymbolSearcher::Classes) + newParent = addChildItem(name, QString(), _scope, IndexItem::Class, clazz); + if (!newParent) + newParent = _parent; + ScopedIndexItemPtr parentRaii(_parent, newParent); + + QString newScope = scopedSymbolName(name, clazz); + ScopedScope scopeRaii(_scope, newScope); + for (unsigned i = 0, ei = clazz->memberCount(); i != ei; ++i) + accept(clazz->memberAt(i)); +} + +template +void SearchSymbols::processFunction(T *func) +{ + if (!(symbolsToSearchFor & SymbolSearcher::Functions) || !func->name()) + return; + QString name = overview.prettyName(func->name()); + QString type = overview.prettyType(func->type()); + addChildItem(name, type, _scope, IndexItem::Function, func); +} diff --git a/src/plugins/cpptools/searchsymbols.h b/src/plugins/cpptools/searchsymbols.h index c4306bfb96..8aad1d701a 100644 --- a/src/plugins/cpptools/searchsymbols.h +++ b/src/plugins/cpptools/searchsymbols.h @@ -85,12 +85,12 @@ protected: // Objective-C virtual bool visit(CPlusPlus::ObjCBaseClass *); virtual bool visit(CPlusPlus::ObjCBaseProtocol *); - virtual bool visit(CPlusPlus::ObjCClass *); + virtual bool visit(CPlusPlus::ObjCClass *symbol); virtual bool visit(CPlusPlus::ObjCForwardClassDeclaration *); - virtual bool visit(CPlusPlus::ObjCProtocol *); + virtual bool visit(CPlusPlus::ObjCProtocol *symbol); virtual bool visit(CPlusPlus::ObjCForwardProtocolDeclaration *); - virtual bool visit(CPlusPlus::ObjCMethod *); - virtual bool visit(CPlusPlus::ObjCPropertyDeclaration *); + virtual bool visit(CPlusPlus::ObjCMethod *symbol); + virtual bool visit(CPlusPlus::ObjCPropertyDeclaration *symbol); QString scopedSymbolName(const QString &symbolName, const CPlusPlus::Symbol *symbol) const; QString scopedSymbolName(const CPlusPlus::Symbol *symbol) const; @@ -99,6 +99,10 @@ protected: const QString &symbolScope, IndexItem::ItemType type, CPlusPlus::Symbol *symbol); +private: + template void processClass(T *clazz); + template void processFunction(T *func); + private: QString findOrInsert(const QString &s) { return strings.insert(s); } diff --git a/tests/cpplocators/testdata_basic/file1.mm b/tests/cpplocators/testdata_basic/file1.mm new file mode 100644 index 0000000000..841a31051c --- /dev/null +++ b/tests/cpplocators/testdata_basic/file1.mm @@ -0,0 +1,23 @@ +// Copyright header to keep the Qt Insanity Bot happy. + +@protocol NSObject +@end + +@interface NSObject +@end + +@protocol MyProtocol +- (void) someMethod; +@end + +@interface MyClass: NSObject +@end + +@implementation MyClass +- (void) someMethod {} +@end + +@implementation MyClass(MyCategory) +- (void) anotherMethod;{} +- (void) anotherMethod:(NSObject*)withAnObject{} +@end -- cgit v1.2.1 From 20108a3d8868d4b3c2fa2f337ac8984b9b967a4b Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Thu, 17 Jul 2014 18:25:26 +0200 Subject: C++: Remove superfluous declarations in Parser Change-Id: I6bf729a999494a84eb235a891ea14bbccd44aeb8 Reviewed-by: Erik Verbruggen --- src/libs/3rdparty/cplusplus/Parser.cpp | 1 - src/libs/3rdparty/cplusplus/Parser.h | 4 ---- 2 files changed, 5 deletions(-) diff --git a/src/libs/3rdparty/cplusplus/Parser.cpp b/src/libs/3rdparty/cplusplus/Parser.cpp index 75580a2efa..7ccc85c940 100644 --- a/src/libs/3rdparty/cplusplus/Parser.cpp +++ b/src/libs/3rdparty/cplusplus/Parser.cpp @@ -175,7 +175,6 @@ Parser::Parser(TranslationUnit *unit) _tokenIndex(1), _templateArguments(0), _inFunctionBody(false), - _inObjCImplementationContext(false), _inExpressionStatement(false), _expressionDepth(0), _statementDepth(0) diff --git a/src/libs/3rdparty/cplusplus/Parser.h b/src/libs/3rdparty/cplusplus/Parser.h index 05a600e04f..87007c8f75 100644 --- a/src/libs/3rdparty/cplusplus/Parser.h +++ b/src/libs/3rdparty/cplusplus/Parser.h @@ -318,7 +318,6 @@ private: unsigned _tokenIndex; bool _templateArguments: 1; bool _inFunctionBody: 1; - bool _inObjCImplementationContext: 1; bool _inExpressionStatement: 1; int _expressionDepth; int _statementDepth; @@ -326,9 +325,6 @@ private: MemoryPool _expressionStatementTempPool; std::map _templateArgumentList; - class Rewind; - friend class Rewind; - private: Parser(const Parser& source); void operator =(const Parser& source); -- cgit v1.2.1 From 1926493fe9b8e621cf28736ec1486884d2edb334 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Thu, 24 Jul 2014 12:02:02 +0200 Subject: C++: Tests: Run ASTVisitor on parsed document ...as a sanity check. Change-Id: I391276e41c5180d0df72fa6267f58801bf2d5da3 Reviewed-by: Erik Verbruggen --- tests/auto/cplusplus/ast/tst_ast.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/auto/cplusplus/ast/tst_ast.cpp b/tests/auto/cplusplus/ast/tst_ast.cpp index 1cd04ce471..56371e477b 100644 --- a/tests/auto/cplusplus/ast/tst_ast.cpp +++ b/tests/auto/cplusplus/ast/tst_ast.cpp @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -61,6 +62,13 @@ public: unit->setSource(source.constData(), source.length()); unit->blockErrors(blockErrors); unit->parse(mode); + + // Sanity check: Visit all AST nodes + if (AST *ast = unit->ast()) { + ASTVisitor visitor(unit); + visitor.accept(ast); + } + return unit; } -- cgit v1.2.1 From d3c5fff66de034e46e825b63943909d36067405f Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Thu, 17 Jul 2014 12:56:28 +0200 Subject: C++: Fix expensive parsing of expressions For expression statements like "(g(g(g(...(g(0))...))))" we reparsed quite much again and again for nothing. The high-level trace for this expression looks like this: parseCastExpression parseTypeId parseAbstractDeclarator parseAbstractCoreDeclarator parseParameterDeclarationClause (--> DEEP) ... parseUnaryExpression ... parseCorePostfixExpression parseTypeId (--> DEEP) parsePrimaryExpression (--> DEEP) Especially parseTypeId is expensive in this case and it's called two times, both from the same token (index). With this patch, we remember for certain ASTs the parse results and re-use them when needed. Change-Id: I013d1c064c655636bc94db408097863b5e183fc2 Task-number: QTCREATORBUG-12252 Reviewed-by: Erik Verbruggen --- src/libs/3rdparty/cplusplus/Parser.cpp | 130 +++++++++++++++++++++++++++++++-- src/libs/3rdparty/cplusplus/Parser.h | 4 + tests/auto/cplusplus/ast/tst_ast.cpp | 41 +++++++++++ 3 files changed, 167 insertions(+), 8 deletions(-) diff --git a/src/libs/3rdparty/cplusplus/Parser.cpp b/src/libs/3rdparty/cplusplus/Parser.cpp index 7ccc85c940..a8ee2d9fbd 100644 --- a/src/libs/3rdparty/cplusplus/Parser.cpp +++ b/src/libs/3rdparty/cplusplus/Parser.cpp @@ -26,8 +26,13 @@ #include "Literals.h" #include "ObjectiveCTypeQualifiers.h" #include "QtContextKeywords.h" + +#include +#include + #include #include // for putchar + #if defined(_MSC_VER) && (_MSC_VER < 1800) # define va_copy(dst, src) ((dst) = (src)) #elif defined(__INTEL_COMPILER) && !defined(va_copy) @@ -43,9 +48,9 @@ using namespace CPlusPlus; namespace { class DebugRule { +public: static int depth; -public: DebugRule(const char *name, const char *spell, unsigned idx, bool blocked) { for (int i = 0; i <= depth; ++i) @@ -150,12 +155,93 @@ inline bool isRightAssociative(int tokenKind) } // end of anonymous namespace +class Parser::ASTCache +{ + ASTCache(const ASTCache &other); + void operator =(const ASTCache &other); + +public: + enum ASTKind { + Expression, + ExpressionList, + ParameterDeclarationClause, + TypeId + }; + +public: + ASTCache() {} + + void insert(ASTKind astKind, unsigned tokenIndexBeforeParsing, + AST *resultingAST, unsigned resultingTokenIndex) + { + const auto key = std::make_pair(astKind, tokenIndexBeforeParsing); + const auto value = std::make_pair(resultingAST, resultingTokenIndex); + const auto keyValue = std::make_pair(key, value); + _cache.insert(keyValue); + } + + AST *find(ASTKind astKind, unsigned tokenIndex, + unsigned *resultingTokenIndex, bool *foundInCache) const + { + const auto key = std::make_pair(astKind, tokenIndex); + const auto it = _cache.find(key); + if (it == _cache.end()) { + *foundInCache = false; + return 0; + } else { + *foundInCache = true; + *resultingTokenIndex = it->second.second; + return it->second.first; + } + } + + void clear() + { + _cache.clear(); + } + +private: + struct KeyHasher { + size_t operator()(const std::pair &key) const + { return std::hash()(key.first) ^ std::hash()(key.second); } + }; + + typedef std::pair ASTKindAndTokenIndex; + typedef std::pair ASTAndTokenIndex; + std::unordered_map _cache; +}; + #ifndef CPLUSPLUS_NO_DEBUG_RULE # define DEBUG_THIS_RULE() DebugRule __debug_rule__(__func__, tok().spell(), cursor(), _translationUnit->blockErrors()) +inline void debugPrintCheckCache(bool goodCase) +{ + for (int i = 0; i <= DebugRule::depth - 1; ++i) + fputc('-', stderr); + if (goodCase) + fprintf(stderr, " CACHE: Re-using AST from Cache.\n"); + else + fprintf(stderr, " CACHE: Already tried to parse this, skipping.\n"); +} #else # define DEBUG_THIS_RULE() do {} while (0) +inline void debugPrintCheckCache(bool) {} #endif +#define CHECK_CACHE(ASTKind, ASTType, returnValueInBadCase) \ + do { \ + bool foundInCache; \ + unsigned newTokenIndex; \ + if (AST *ast = _astCache->find(ASTKind, cursor(), &newTokenIndex, &foundInCache)) { \ + debugPrintCheckCache(true); \ + node = (ASTType *) ast; \ + _tokenIndex = newTokenIndex; \ + return true; \ + } else if (foundInCache) { \ + debugPrintCheckCache(false); \ + return returnValueInBadCase; \ + } \ + } while (0) + #define PARSE_EXPRESSION_WITH_OPERATOR_PRECEDENCE(node, minPrecedence) { \ if (LA() == T_THROW) { \ if (!parseThrowExpression(node)) \ @@ -177,11 +263,16 @@ Parser::Parser(TranslationUnit *unit) _inFunctionBody(false), _inExpressionStatement(false), _expressionDepth(0), - _statementDepth(0) + _statementDepth(0), + _astCache(new ASTCache), + _expressionStatementAstCache(new ASTCache) { } Parser::~Parser() -{ } +{ + delete _expressionStatementAstCache; + delete _astCache; +} bool Parser::switchTemplateArguments(bool templateArguments) { @@ -1841,6 +1932,8 @@ bool Parser::parseTypeParameter(DeclarationAST *&node) bool Parser::parseTypeId(ExpressionAST *&node) { DEBUG_THIS_RULE(); + CHECK_CACHE(ASTCache::TypeId, ExpressionAST, false); + SpecifierListAST *type_specifier = 0; if (parseTypeSpecifier(type_specifier)) { TypeIdAST *ast = new (_pool) TypeIdAST; @@ -1857,6 +1950,8 @@ bool Parser::parseParameterDeclarationClause(ParameterDeclarationClauseAST *&nod DEBUG_THIS_RULE(); if (LA() == T_RPAREN) return true; // nothing to do + CHECK_CACHE(ASTCache::ParameterDeclarationClause, ParameterDeclarationClauseAST, true); + const unsigned initialCursor = cursor(); ParameterDeclarationListAST *parameter_declarations = 0; @@ -1881,6 +1976,7 @@ bool Parser::parseParameterDeclarationClause(ParameterDeclarationClauseAST *&nod node = ast; } + _astCache->insert(ASTCache::ParameterDeclarationClause, initialCursor, node, cursor()); return true; } @@ -2797,9 +2893,14 @@ bool Parser::parseTypeIdList(ExpressionListAST *&node) bool Parser::parseExpressionList(ExpressionListAST *&node) { DEBUG_THIS_RULE(); + CHECK_CACHE(ASTCache::ExpressionList, ExpressionListAST, false); + unsigned initialCursor = cursor(); - if (_languageFeatures.cxx11Enabled) - return parseInitializerList0x(node); + if (_languageFeatures.cxx11Enabled) { + bool result = parseInitializerList0x(node); + _astCache->insert(ASTCache::ExpressionList, initialCursor, (AST *) node, cursor()); + return result; + } ExpressionListAST **expression_list_ptr = &node; ExpressionAST *expression = 0; @@ -2816,9 +2917,11 @@ bool Parser::parseExpressionList(ExpressionListAST *&node) expression_list_ptr = &(*expression_list_ptr)->next; } } + _astCache->insert(ASTCache::ExpressionList, initialCursor, (AST *) node, cursor()); return true; } + _astCache->insert(ASTCache::ExpressionList, initialCursor, 0, cursor()); return false; } @@ -2981,9 +3084,11 @@ bool Parser::parseExpressionStatement(StatementAST *&node) const bool wasInExpressionStatement = _inExpressionStatement; _inExpressionStatement = true; - // switch to the temp pool + // switch to the temp pool and cache MemoryPool *previousPool = _pool; _pool = &_expressionStatementTempPool; + ASTCache *previousASTCache = _astCache; + _astCache = _expressionStatementAstCache; bool parsed = false; @@ -3000,12 +3105,15 @@ bool Parser::parseExpressionStatement(StatementAST *&node) _inExpressionStatement = wasInExpressionStatement; if (! _inExpressionStatement) { - // rewind the memory pool after parsing a toplevel expression statement. + // rewind the memory pool and cache after parsing a toplevel expression statement. _expressionStatementTempPool.reset(); + _astCache->clear(); } - // restore the pool + // restore the pool and cache _pool = previousPool; + _astCache = previousASTCache; + return parsed; } @@ -5246,6 +5354,7 @@ bool Parser::parseCastExpression(ExpressionAST *&node) DEBUG_THIS_RULE(); if (LA() == T_LPAREN) { unsigned lparen_token = consumeToken(); + unsigned initialCursor = cursor(); ExpressionAST *type_id = 0; if (parseTypeId(type_id) && LA() == T_RPAREN) { @@ -5300,6 +5409,7 @@ bool Parser::parseCastExpression(ExpressionAST *&node) } parse_as_unary_expression: + _astCache->insert(ASTCache::TypeId, initialCursor, 0, cursor()); rewind(lparen_token); } @@ -5400,6 +5510,8 @@ bool Parser::parseConstantExpression(ExpressionAST *&node) bool Parser::parseExpression(ExpressionAST *&node) { DEBUG_THIS_RULE(); + CHECK_CACHE(ASTCache::Expression, ExpressionAST, false); + unsigned initialCursor = cursor(); if (_expressionDepth > MAX_EXPRESSION_DEPTH) return false; @@ -5407,6 +5519,8 @@ bool Parser::parseExpression(ExpressionAST *&node) ++_expressionDepth; bool success = parseCommaExpression(node); --_expressionDepth; + + _astCache->insert(ASTCache::Expression, initialCursor, node, cursor()); return success; } diff --git a/src/libs/3rdparty/cplusplus/Parser.h b/src/libs/3rdparty/cplusplus/Parser.h index 87007c8f75..4a2a6dfb7e 100644 --- a/src/libs/3rdparty/cplusplus/Parser.h +++ b/src/libs/3rdparty/cplusplus/Parser.h @@ -325,6 +325,10 @@ private: MemoryPool _expressionStatementTempPool; std::map _templateArgumentList; + class ASTCache; + ASTCache *_astCache; + ASTCache *_expressionStatementAstCache; + private: Parser(const Parser& source); void operator =(const Parser& source); diff --git a/tests/auto/cplusplus/ast/tst_ast.cpp b/tests/auto/cplusplus/ast/tst_ast.cpp index 56371e477b..ebd9e468e1 100644 --- a/tests/auto/cplusplus/ast/tst_ast.cpp +++ b/tests/auto/cplusplus/ast/tst_ast.cpp @@ -193,6 +193,7 @@ private slots: void incomplete_ast(); void unnamed_class(); void unnamed_class_data(); + void expensiveExpression(); }; void tst_AST::gcc_attributes_1() @@ -1790,6 +1791,46 @@ void tst_AST::unnamed_class_data() QTest::newRow("unnamed-__attribute__") << _("class __attribute__((aligned(8))){};"); } +void tst_AST::expensiveExpression() +{ + QSharedPointer unit(parseStatement( + "void f()\n" + "{\n" + "(g1\n" + "(g2\n" + "(g3\n" + "(g4\n" + "(g5\n" + "(g6\n" + "(g7\n" + "(g8\n" + "(g9\n" + "(g10\n" + "(g11\n" + "(g12\n" + "(g13\n" + "(g14\n" + "(g15\n" + "(g16\n" + "(g17\n" + "(g18\n" + "(g19\n" + "(g20\n" + "(g21\n" + "(g22\n" + "(g23\n" + "(g24\n" + "(g25\n" + "(g26\n" + "(g27\n" + "(g28\n" + "(g29\n" + "(g30\n" + "(g31(0))))))))))))))))))))))))))))))));\n" + "}\n")); + QVERIFY(unit->ast()); +} + void tst_AST::initTestCase() { control.setDiagnosticClient(&diag); -- cgit v1.2.1 From 359bc13ea0f45ba0362238720b35ad38c373baa7 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Wed, 23 Jul 2014 14:21:44 +0200 Subject: CppEditor: Fix "Complete Switch Statement" ...if enum type is defined inside a class or namespace. Task-number: QTCREATORBUG-12311 Change-Id: I71b64bbe9d419707b66caacd10550041efc1520c Reviewed-by: Erik Verbruggen --- src/plugins/cppeditor/cppquickfix_test.cpp | 44 ++++++++++++++++++++++++++++++ src/plugins/cppeditor/cppquickfixes.cpp | 2 ++ 2 files changed, 46 insertions(+) diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index a1f08a02f1..3e28a2025a 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -325,6 +325,50 @@ void CppEditorPlugin::test_quickfix_data() "}\n" ); + // Checks: Enum type in class is found. + QTest::newRow("CompleteSwitchCaseStatement_enumTypeInClass") + << CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _( + "struct C { enum EnumType { V1, V2 }; };\n" + "\n" + "void f(C::EnumType t) {\n" + " @switch (t) {\n" + " }\n" + "}\n" + ) << _( + "struct C { enum EnumType { V1, V2 }; };\n" + "\n" + "void f(C::EnumType t) {\n" + " switch (t) {\n" + " case C::V1:\n" + " break;\n" + " case C::V2:\n" + " break;\n" + " }\n" + "}\n" + ); + + // Checks: Enum type in namespace is found. + QTest::newRow("CompleteSwitchCaseStatement_enumTypeInNamespace") + << CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _( + "namespace N { enum EnumType { V1, V2 }; };\n" + "\n" + "void f(N::EnumType t) {\n" + " @switch (t) {\n" + " }\n" + "}\n" + ) << _( + "namespace N { enum EnumType { V1, V2 }; };\n" + "\n" + "void f(N::EnumType t) {\n" + " switch (t) {\n" + " case N::V1:\n" + " break;\n" + " case N::V2:\n" + " break;\n" + " }\n" + "}\n" + ); + // Checks: The missing enum value is added. QTest::newRow("CompleteSwitchCaseStatement_oneValueMissing") << CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _( diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index be1b348340..dfdcfbc18f 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -2293,6 +2293,8 @@ Enum *findEnum(const QList &results, const LookupContext &ctxt) if (ClassOrNamespace *con = ctxt.lookupType(namedType->name(), result.scope())) { const QList enums = con->unscopedEnums(); const Name *referenceName = namedType->name(); + if (const QualifiedNameId *qualifiedName = referenceName->asQualifiedNameId()) + referenceName = qualifiedName->name(); foreach (Enum *e, enums) { if (const Name *candidateName = e->name()) { if (candidateName->match(referenceName)) -- cgit v1.2.1 From 4e9d3b044e996f45909797ba3a3a88b22967d62e Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Tue, 15 Jul 2014 10:48:36 +0200 Subject: CppTools: Fix Switch Header/Source going to wrong file Check only other projects if the current file is not part of any project. Task-number: QTCREATORBUG-12328 Change-Id: I7db65b26313a26773bbbf17e966abd668ea9a1a5 Reviewed-by: Erik Verbruggen --- src/plugins/cpptools/cpptoolsplugin.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp index 44179a1fb4..d3cb9514eb 100644 --- a/src/plugins/cpptools/cpptoolsplugin.cpp +++ b/src/plugins/cpptools/cpptoolsplugin.cpp @@ -411,19 +411,20 @@ QString correspondingHeaderOrSource(const QString &fileName, bool *wasHeader) currentProject); if (!path.isEmpty()) return path; - } // Find files in other projects - CppModelManager *modelManager = CppModelManager::instance(); - QList projectInfos = modelManager->projectInfos(); - foreach (const CppModelManagerInterface::ProjectInfo &projectInfo, projectInfos) { - const ProjectExplorer::Project *project = projectInfo.project().data(); - if (project == currentProject) - continue; // We have already checked the current project. - - const QString path = correspondingHeaderOrSourceInProject(fi, candidateFileNames, project); - if (!path.isEmpty()) - return path; + } else { + CppModelManager *modelManager = CppModelManager::instance(); + QList projectInfos = modelManager->projectInfos(); + foreach (const CppModelManagerInterface::ProjectInfo &projectInfo, projectInfos) { + const ProjectExplorer::Project *project = projectInfo.project().data(); + if (project == currentProject) + continue; // We have already checked the current project. + + const QString path = correspondingHeaderOrSourceInProject(fi, candidateFileNames, project); + if (!path.isEmpty()) + return path; + } } return QString(); -- cgit v1.2.1 From 6a9ae7e25f6841cfd56be5560ecde9de52378526 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Wed, 16 Jul 2014 11:25:15 +0200 Subject: CppTools: Auto-include pre-compiled headers So far the pre-compiled headers were processed (thus defines from those headers were visible), but the actual includes for the documents were not added, which is necessary for lookup/completion. Note that this will be only done if pre-compiled headers are not ignored (Options > C++ > Code Model > [] Ignore pre-compiled headers). Change-Id: I54a8e6b00597af164d958e3e9f2a1075ea187788 Reviewed-by: Erik Verbruggen --- src/libs/cplusplus/FastPreprocessor.cpp | 5 ++-- src/libs/cplusplus/FastPreprocessor.h | 3 ++- src/libs/cplusplus/PreprocessorClient.h | 5 ++-- src/plugins/cpptools/cppmodelmanager_test.cpp | 31 ++++++++++++++++------ src/plugins/cpptools/cppsnapshotupdater.cpp | 3 ++- src/plugins/cpptools/cppsourceprocessor.cpp | 13 ++++++--- src/plugins/cpptools/cppsourceprocessor.h | 5 ++-- src/plugins/cpptools/cpptoolsplugin.h | 2 +- .../cplusplus/preprocessor/tst_preprocessor.cpp | 4 ++- tests/cppmodelmanager/testdata_defines/pch1.h | 1 + tests/cppmodelmanager/testdata_defines/pch2.h | 1 + 11 files changed, 52 insertions(+), 21 deletions(-) diff --git a/src/libs/cplusplus/FastPreprocessor.cpp b/src/libs/cplusplus/FastPreprocessor.cpp index c49695fc8c..3c5b4312ce 100644 --- a/src/libs/cplusplus/FastPreprocessor.cpp +++ b/src/libs/cplusplus/FastPreprocessor.cpp @@ -66,9 +66,10 @@ QByteArray FastPreprocessor::run(Document::Ptr newDoc, const QByteArray &source) return preprocessed; } -void FastPreprocessor::sourceNeeded(unsigned line, const QString &fileName, - IncludeType mode) +void FastPreprocessor::sourceNeeded(unsigned line, const QString &fileName, IncludeType mode, + const QStringList &initialIncludes) { + Q_UNUSED(initialIncludes) Q_ASSERT(_currentDoc); // CHECKME: Is that cleanName needed? QString cleanName = QDir::cleanPath(fileName); diff --git a/src/libs/cplusplus/FastPreprocessor.h b/src/libs/cplusplus/FastPreprocessor.h index df19c4dcdf..b4a14cfdb4 100644 --- a/src/libs/cplusplus/FastPreprocessor.h +++ b/src/libs/cplusplus/FastPreprocessor.h @@ -57,7 +57,8 @@ public: QByteArray run(Document::Ptr newDoc, const QByteArray &source); // CPlusPlus::Client - virtual void sourceNeeded(unsigned line, const QString &fileName, IncludeType mode); + virtual void sourceNeeded(unsigned line, const QString &fileName, IncludeType mode, + const QStringList &initialIncludes = QStringList()); virtual void macroAdded(const Macro &); diff --git a/src/libs/cplusplus/PreprocessorClient.h b/src/libs/cplusplus/PreprocessorClient.h index a990a39357..3680770dc2 100644 --- a/src/libs/cplusplus/PreprocessorClient.h +++ b/src/libs/cplusplus/PreprocessorClient.h @@ -32,7 +32,7 @@ #include -#include +#include #include QT_BEGIN_NAMESPACE @@ -100,7 +100,8 @@ public: virtual void startSkippingBlocks(unsigned utf16charsOffset) = 0; virtual void stopSkippingBlocks(unsigned utf16charsOffset) = 0; - virtual void sourceNeeded(unsigned line, const QString &fileName, IncludeType mode) = 0; + virtual void sourceNeeded(unsigned line, const QString &fileName, IncludeType mode, + const QStringList &initialIncludes = QStringList()) = 0; static inline bool isInjectedFile(const QString &fileName) { diff --git a/src/plugins/cpptools/cppmodelmanager_test.cpp b/src/plugins/cpptools/cppmodelmanager_test.cpp index 3ca3e3d49d..6f7a6f1fa0 100644 --- a/src/plugins/cpptools/cppmodelmanager_test.cpp +++ b/src/plugins/cpptools/cppmodelmanager_test.cpp @@ -37,6 +37,8 @@ #include #include #include + +#include #include #include @@ -873,7 +875,7 @@ void CppToolsPlugin::test_modelmanager_defines_per_project() } } -void CppToolsPlugin::test_modelmanager_defines_per_project_pch() +void CppToolsPlugin::test_modelmanager_precompiled_headers() { ModelManagerTestHelper helper; @@ -922,14 +924,16 @@ void CppToolsPlugin::test_modelmanager_defines_per_project_pch() struct Data { QString firstDeclarationName; + QString firstClassInPchFile; QString fileName; } d[] = { - { _("one"), main1File }, - { _("two"), main2File } + { _("one"), _("ClassInPch1"), main1File }, + { _("two"), _("ClassInPch2"), main2File } }; const int size = sizeof(d) / sizeof(d[0]); for (int i = 0; i < size; ++i) { const QString firstDeclarationName = d[i].firstDeclarationName; + const QByteArray firstClassInPchFile = d[i].firstClassInPchFile.toUtf8(); const QString fileName = d[i].fileName; Core::IEditor *editor = Core::EditorManager::openEditor(fileName); @@ -943,11 +947,22 @@ void CppToolsPlugin::test_modelmanager_defines_per_project_pch() while (sup->lastSemanticInfoDocument().isNull()) QCoreApplication::processEvents(); - sup->snapshotUpdater()->setUsePrecompiledHeaders(true); - sup->snapshotUpdater()->update(mm->workingCopy()); - - Document::Ptr doc = mm->document(fileName); - QCOMPARE(nameOfFirstDeclaration(doc), firstDeclarationName); + const QSharedPointer updater = sup->snapshotUpdater(); + updater->setUsePrecompiledHeaders(true); + updater->update(mm->workingCopy()); + + // Check if defines from pch are considered + Document::Ptr document = mm->document(fileName); + QCOMPARE(nameOfFirstDeclaration(document), firstDeclarationName); + + // Check if declarations from pch are considered + CPlusPlus::LookupContext context(document, updater->snapshot()); + const CPlusPlus::Identifier *identifier + = document->control()->identifier(firstClassInPchFile.data()); + const QList results = context.lookup(identifier, + document->globalNamespace()); + QVERIFY(!results.isEmpty()); + QVERIFY(results.first().declaration()->type()->asClassType()); } } diff --git a/src/plugins/cpptools/cppsnapshotupdater.cpp b/src/plugins/cpptools/cppsnapshotupdater.cpp index 60c8d3e414..a6900d3d2c 100644 --- a/src/plugins/cpptools/cppsnapshotupdater.cpp +++ b/src/plugins/cpptools/cppsnapshotupdater.cpp @@ -177,7 +177,8 @@ void SnapshotUpdater::update(CppModelManager::WorkingCopy workingCopy) } if (!m_editorDefines.isEmpty()) sourceProcessor.run(editorDefinesFileName); - sourceProcessor.run(m_fileInEditor); + sourceProcessor.run(m_fileInEditor, m_usePrecompiledHeaders ? m_precompiledHeaders + : QStringList()); m_snapshot = sourceProcessor.snapshot(); Snapshot newSnapshot = m_snapshot.simplified(document()); diff --git a/src/plugins/cpptools/cppsourceprocessor.cpp b/src/plugins/cpptools/cppsourceprocessor.cpp index 47986331b3..33b2a0896e 100644 --- a/src/plugins/cpptools/cppsourceprocessor.cpp +++ b/src/plugins/cpptools/cppsourceprocessor.cpp @@ -148,9 +148,10 @@ void CppSourceProcessor::addFrameworkPath(const ProjectPart::HeaderPath &framewo void CppSourceProcessor::setTodo(const QStringList &files) { m_todo = QSet::fromList(files); } -void CppSourceProcessor::run(const QString &fileName) +void CppSourceProcessor::run(const QString &fileName, + const QStringList &initialIncludes) { - sourceNeeded(0, fileName, IncludeGlobal); + sourceNeeded(0, fileName, IncludeGlobal, initialIncludes); } void CppSourceProcessor::removeFromCache(const QString &fileName) @@ -377,7 +378,8 @@ void CppSourceProcessor::stopSkippingBlocks(unsigned utf16charsOffset) m_currentDoc->stopSkippingBlocks(utf16charsOffset); } -void CppSourceProcessor::sourceNeeded(unsigned line, const QString &fileName, IncludeType type) +void CppSourceProcessor::sourceNeeded(unsigned line, const QString &fileName, IncludeType type, + const QStringList &initialIncludes) { if (fileName.isEmpty()) return; @@ -417,6 +419,11 @@ void CppSourceProcessor::sourceNeeded(unsigned line, const QString &fileName, In Document::Ptr document = Document::create(absoluteFileName); document->setRevision(m_revision); document->setEditorRevision(editorRevision); + foreach (const QString &include, initialIncludes) { + m_included.insert(include); + Document::Include inc(include, include, 0, IncludeLocal); + document->addIncludeFile(inc); + } const QFileInfo info(absoluteFileName); if (info.exists()) document->setLastModified(info.lastModified()); diff --git a/src/plugins/cpptools/cppsourceprocessor.h b/src/plugins/cpptools/cppsourceprocessor.h index e10d143816..e51315c32c 100644 --- a/src/plugins/cpptools/cppsourceprocessor.h +++ b/src/plugins/cpptools/cppsourceprocessor.h @@ -43,7 +43,7 @@ public: void setHeaderPaths(const ProjectPart::HeaderPaths &headerPaths); void setTodo(const QStringList &files); - void run(const QString &fileName); + void run(const QString &fileName, const QStringList &initialIncludes = QStringList()); void removeFromCache(const QString &fileName); void resetEnvironment(); @@ -80,7 +80,8 @@ private: void markAsIncludeGuard(const QByteArray ¯oName) QTC_OVERRIDE; void startSkippingBlocks(unsigned utf16charsOffset) QTC_OVERRIDE; void stopSkippingBlocks(unsigned utf16charsOffset) QTC_OVERRIDE; - void sourceNeeded(unsigned line, const QString &fileName, IncludeType type) QTC_OVERRIDE; + void sourceNeeded(unsigned line, const QString &fileName, IncludeType type, + const QStringList &initialIncludes) QTC_OVERRIDE; private: CPlusPlus::Snapshot m_snapshot; diff --git a/src/plugins/cpptools/cpptoolsplugin.h b/src/plugins/cpptools/cpptoolsplugin.h index 3d54eb0cde..771bc542c6 100644 --- a/src/plugins/cpptools/cpptoolsplugin.h +++ b/src/plugins/cpptools/cpptoolsplugin.h @@ -146,8 +146,8 @@ private slots: void test_modelmanager_gc_if_last_cppeditor_closed(); void test_modelmanager_dont_gc_opened_files(); void test_modelmanager_defines_per_project(); - void test_modelmanager_defines_per_project_pch(); void test_modelmanager_defines_per_editor(); + void test_modelmanager_precompiled_headers(); void test_cpplocatorfilters_CppLocatorFilter(); void test_cpplocatorfilters_CppLocatorFilter_data(); diff --git a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp index a7d4287dac..6b8dad6488 100644 --- a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp +++ b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp @@ -159,8 +159,10 @@ public: virtual void stopSkippingBlocks(unsigned utf16charsOffset) { m_skippedBlocks.last().end = utf16charsOffset; } - virtual void sourceNeeded(unsigned line, const QString &includedFileName, IncludeType mode) + virtual void sourceNeeded(unsigned line, const QString &includedFileName, IncludeType mode, + const QStringList &initialIncludes = QStringList()) { + Q_UNUSED(initialIncludes) #if 1 m_recordedIncludes.append(Include(includedFileName, mode, line)); Q_UNUSED(m_env); diff --git a/tests/cppmodelmanager/testdata_defines/pch1.h b/tests/cppmodelmanager/testdata_defines/pch1.h index a5a8cae412..b76608a772 100644 --- a/tests/cppmodelmanager/testdata_defines/pch1.h +++ b/tests/cppmodelmanager/testdata_defines/pch1.h @@ -1 +1,2 @@ #define SUB1 +class ClassInPch1{}; diff --git a/tests/cppmodelmanager/testdata_defines/pch2.h b/tests/cppmodelmanager/testdata_defines/pch2.h index 2b715eaec1..289da5b927 100644 --- a/tests/cppmodelmanager/testdata_defines/pch2.h +++ b/tests/cppmodelmanager/testdata_defines/pch2.h @@ -1 +1,2 @@ #define SUB2 +class ClassInPch2{}; -- cgit v1.2.1 From d7d4d7190f7e6bd1e02b543ecfed888332703081 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 24 Jul 2014 12:14:30 +0200 Subject: ProjectExplorer: Do not offer "Remove Project" unconditionally. Instead, check whether Node::supportedActions() contains RemoveSubProject, like it is done for the other actions. Change-Id: I84f9936cfda7300963e1dadb8425100f0ffd31a4 Reviewed-by: Daniel Teske --- src/plugins/projectexplorer/projectexplorer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 8f6a7fe800..e57a9643f4 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -2739,6 +2739,7 @@ void ProjectExplorerPlugin::updateContextMenuActions() d->m_addExistingDirectoryAction->setEnabled(false); d->m_addNewFileAction->setEnabled(false); d->m_addNewSubprojectAction->setEnabled(false); + d->m_removeProjectAction->setEnabled(false); d->m_removeFileAction->setEnabled(false); d->m_deleteFileAction->setEnabled(false); d->m_renameFileAction->setEnabled(false); @@ -2747,6 +2748,7 @@ void ProjectExplorerPlugin::updateContextMenuActions() d->m_addExistingDirectoryAction->setVisible(true); d->m_addNewFileAction->setVisible(true); d->m_addNewSubprojectAction->setVisible(true); + d->m_removeProjectAction->setVisible(true); d->m_removeFileAction->setVisible(true); d->m_deleteFileAction->setVisible(true); d->m_runActionContextMenu->setVisible(false); @@ -2789,6 +2791,8 @@ void ProjectExplorerPlugin::updateContextMenuActions() d->m_addNewSubprojectAction->setEnabled(d->m_currentNode->nodeType() == ProjectNodeType && actions.contains(ProjectExplorer::AddSubProject) && !ICore::isNewItemDialogRunning()); + d->m_removeProjectAction->setEnabled(d->m_currentNode->nodeType() == ProjectNodeType + && actions.contains(ProjectExplorer::RemoveSubProject)); d->m_addExistingFilesAction->setEnabled(actions.contains(ProjectExplorer::AddExistingFile)); d->m_addExistingDirectoryAction->setEnabled(actions.contains(ProjectExplorer::AddExistingDirectory)); d->m_renameFileAction->setEnabled(actions.contains(ProjectExplorer::Rename)); @@ -2822,6 +2826,7 @@ void ProjectExplorerPlugin::updateContextMenuActions() if (actions.contains(ProjectExplorer::HideFolderActions)) { d->m_addNewFileAction->setVisible(false); d->m_addNewSubprojectAction->setVisible(false); + d->m_removeProjectAction->setVisible(false); d->m_addExistingFilesAction->setVisible(false); d->m_addExistingDirectoryAction->setVisible(false); } -- cgit v1.2.1 From fc24fe726eeea147cee164472f6bc3e2c192bae5 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 24 Jul 2014 13:19:26 +0200 Subject: Add more change log Change-Id: I639ca89aece386d1609966d0309c717baaf16f17 Reviewed-by: Leena Miettinen --- dist/changes-3.2.0 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dist/changes-3.2.0 b/dist/changes-3.2.0 index 95cb455196..7c48a75c98 100644 --- a/dist/changes-3.2.0 +++ b/dist/changes-3.2.0 @@ -21,8 +21,11 @@ General * Made keyboard and mouse activation of navigation panes and other trees more consistent * Removed unhelpful Generic Highlighter loading progress bar * Fixed case-sensitivity of file system locator filter (QTCREATORBUG-10843) + * Fixed that Window > Minimize, Zoom and Full Screen were always affecting the main window + instead of the active window Editing + * Added support for manually editing bookmark line number (QTCREATORBUG-9721) * Made Ctrl+Up and Ctrl+Down shortcuts configurable (QTCREATORBUG-4994) * Made editor popup (Ctrl+Tab) adapt its size to contents (QTCREATORBUG-10618) * Improved block editing (QTCREATORBUG-7773) @@ -39,6 +42,8 @@ Editing * Fixed Open With when file is open in multiple splits * Fixed that search highlights were removed when switching editors (QTCREATORBUG-9949) + * Fixed dropping files in the presence of splits or external windows + (QTCREATORBUG-9023) Help * Added page up and page down shortcuts to topic chooser @@ -70,6 +75,9 @@ QMake Projects with Qt 5.2 and later where this is supported (QTCREATORBUG-10024) * Fixed that adding files to .pri file was missing $$PWD +CMake Projects + * Fixed that .cmake files were opened as projects (QTCREATORBUG-12461) + Qbs Projects * Added support for adding and removing files from projects * Fixed that run configurations were created for products that are not runnable @@ -124,6 +132,7 @@ QML Profiler * Fixed drawing issues (QTBUG-38222) * Fixed that clicking visible event was sometimes moving timeline (QTCREATORBUG-11945) + * Fixed navigation through events (QTCREATORBUG-12634) Analyzer * Added support for Run in Terminal (QTCREATORBUG-7311) @@ -197,6 +206,7 @@ Beautifier * Added support for formatting a file asynchronously * Added support for redirecting text to a formatter tool instead of using temporary files + * Fixed that running formatting tool was blocking UI Platform Specific @@ -209,6 +219,7 @@ OS X * Fixed activation of items with Enter in Bookmarks pane Android + * Removed upper limit of version code in manifest editor (QTCREATORBUG-12668) * Fixed that UI was unresponsive while creating AVD (QTCREATORBUG-10601) Remote Linux -- cgit v1.2.1 From cf9d12ed41763485665067123763cdc24fb39d52 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 24 Jul 2014 12:18:29 +0200 Subject: QbsProjectManager: Do not offer to add and remove files during a build. The build graph is locked then. Disabling the action in the first place is nicer than letting the respective qbs API call fail. Change-Id: Icfb89b454a240253c9ddc7681b452d06ff0393dd Reviewed-by: Joerg Bornemann --- src/plugins/qbsprojectmanager/qbsnodes.cpp | 19 +++++++++++++------ src/plugins/qbsprojectmanager/qbsproject.cpp | 5 +++++ src/plugins/qbsprojectmanager/qbsproject.h | 1 + 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsnodes.cpp b/src/plugins/qbsprojectmanager/qbsnodes.cpp index 4046f90cac..833f23135f 100644 --- a/src/plugins/qbsprojectmanager/qbsnodes.cpp +++ b/src/plugins/qbsprojectmanager/qbsnodes.cpp @@ -324,6 +324,17 @@ bool QbsBaseProjectNode::renameFile(const QString &filePath, const QString &newF return false; } + +static QList supportedNodeActions(ProjectExplorer::Node *node) +{ + QList actions; + if (parentQbsProjectNode(node)->project()->isProjectEditable()) { + actions << ProjectExplorer::AddNewFile << ProjectExplorer::AddExistingFile + << ProjectExplorer::RemoveFile; + } + return actions; +} + // -------------------------------------------------------------------- // QbsGroupNode: // -------------------------------------------------------------------- @@ -355,9 +366,7 @@ bool QbsGroupNode::isEnabled() const QList QbsGroupNode::supportedActions(ProjectExplorer::Node *node) const { - Q_UNUSED(node); - return QList() << ProjectExplorer::AddNewFile << ProjectExplorer::AddExistingFile - << ProjectExplorer::RemoveFile; + return supportedNodeActions(node); } bool QbsGroupNode::addFiles(const QStringList &filePaths, QStringList *notAdded) @@ -563,9 +572,7 @@ bool QbsProductNode::showInSimpleTree() const QList QbsProductNode::supportedActions(ProjectExplorer::Node *node) const { - Q_UNUSED(node); - return QList() << ProjectExplorer::AddNewFile << ProjectExplorer::AddExistingFile - << ProjectExplorer::RemoveFile; + return supportedNodeActions(node); } bool QbsProductNode::addFiles(const QStringList &filePaths, QStringList *notAdded) diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index cc963c449a..8896e3db58 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -189,6 +189,11 @@ QStringList QbsProject::files(Project::FilesMode fileMode) const return result.toList(); } +bool QbsProject::isProjectEditable() const +{ + return m_qbsProject.isValid() && !isParsing() && !ProjectExplorer::BuildManager::isBuilding(); +} + class ChangeExpector { public: diff --git a/src/plugins/qbsprojectmanager/qbsproject.h b/src/plugins/qbsprojectmanager/qbsproject.h index 3106d819fb..75d9f42881 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.h +++ b/src/plugins/qbsprojectmanager/qbsproject.h @@ -70,6 +70,7 @@ public: QStringList files(FilesMode fileMode) const; + bool isProjectEditable() const; bool addFilesToProduct(QbsBaseProjectNode *node, const QStringList &filePaths, const qbs::ProductData &productData, const qbs::GroupData &groupData, QStringList *notAdded); -- cgit v1.2.1 From 880333980685fae4168d4c75bcb0f6279ac8c28c Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 24 Jul 2014 14:48:36 +0200 Subject: Help: Fix crash when closing external help window We need to explicitly remove the context that we registered for the viewer in it. Otherwise it might happen that the deleted context object is temporarily made "active" when the context for the whole window is removed. Change-Id: I903ae0a774751651cc2ec1661c0af8b8f7b3df2d Task-number: QTCREATORBUG-12722 Reviewed-by: Christian Stenger --- src/plugins/help/helpwidget.cpp | 9 +++++---- src/plugins/help/helpwidget.h | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/help/helpwidget.cpp b/src/plugins/help/helpwidget.cpp index a126c5e30f..46d9a2ceef 100644 --- a/src/plugins/help/helpwidget.cpp +++ b/src/plugins/help/helpwidget.cpp @@ -102,10 +102,10 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget setFocusProxy(m_viewer); - Core::IContext *icontext = new Core::IContext(this); - icontext->setContext(context); - icontext->setWidget(m_viewer); - Core::ICore::addContextObject(icontext); + m_context = new Core::IContext(this); + m_context->setContext(context); + m_context->setWidget(m_viewer); + Core::ICore::addContextObject(m_context); back->setEnabled(m_viewer->isBackwardAvailable()); connect(back, SIGNAL(triggered()), m_viewer, SLOT(backward())); @@ -171,6 +171,7 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget HelpWidget::~HelpWidget() { + Core::ICore::removeContextObject(m_context); Core::ActionManager::unregisterAction(m_copy, Core::Constants::COPY); Core::ActionManager::unregisterAction(m_openHelpMode, Help::Constants::CONTEXT_HELP); if (m_scaleUp) diff --git a/src/plugins/help/helpwidget.h b/src/plugins/help/helpwidget.h index 3796be59dc..73701e3348 100644 --- a/src/plugins/help/helpwidget.h +++ b/src/plugins/help/helpwidget.h @@ -75,6 +75,7 @@ private slots: void updateHelpModeButtonToolTip(); private: + Core::IContext *m_context; QAction *m_switchToHelp; QMenu *m_backMenu; QMenu *m_forwardMenu; -- cgit v1.2.1 From b1f183d06a5e26f72571c70d93545460d90cd6ab Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Thu, 24 Jul 2014 13:22:39 +0200 Subject: Android: Fix modified flag for changes to the application name Task-number: QTCREATORBUG-12065 Change-Id: I2e86274b5b1155a952438e7ea9223f6260e7ea53 Reviewed-by: BogDan Vatra --- src/plugins/android/androidmanifesteditorwidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp index 04be02cae2..061f2a94a9 100644 --- a/src/plugins/android/androidmanifesteditorwidget.cpp +++ b/src/plugins/android/androidmanifesteditorwidget.cpp @@ -1005,6 +1005,7 @@ void AndroidManifestEditorWidget::parseApplication(QXmlStreamReader &reader, QXm if (!m_appNameInStringsXml) { keys << QLatin1String("android:label"); values << m_appNameLineEdit->text(); + m_setAppName = false; } bool ensureIconAttribute = !m_lIconPath.isEmpty() || !m_mIconPath.isEmpty() -- cgit v1.2.1 From a2c18fc6ec71df75a144519fa1615e1c2446217b Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 24 Jul 2014 16:35:13 +0200 Subject: Version bump Change-Id: I9be7fde5b69b65e759100efb0595e7ca2ac5bfb9 Reviewed-by: Eike Ziller --- qtcreator.pri | 4 ++-- qtcreator.qbs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qtcreator.pri b/qtcreator.pri index ec48dbed5a..4b4d0bc241 100644 --- a/qtcreator.pri +++ b/qtcreator.pri @@ -1,8 +1,8 @@ !isEmpty(QTCREATOR_PRI_INCLUDED):error("qtcreator.pri already included") QTCREATOR_PRI_INCLUDED = 1 -QTCREATOR_VERSION = 3.1.83 -QTCREATOR_COMPAT_VERSION = 3.1.83 +QTCREATOR_VERSION = 3.1.84 +QTCREATOR_COMPAT_VERSION = 3.1.84 BINARY_ARTIFACTS_BRANCH = 3.2 # enable c++11 diff --git a/qtcreator.qbs b/qtcreator.qbs index 34be1f66c3..25bbb3e128 100644 --- a/qtcreator.qbs +++ b/qtcreator.qbs @@ -4,11 +4,11 @@ Project { property bool withAutotests: qbs.buildVariant === "debug" property string ide_version_major: '3' property string ide_version_minor: '1' - property string ide_version_release: '83' + property string ide_version_release: '84' property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release property string ide_compat_version_major: '3' property string ide_compat_version_minor: '1' - property string ide_compat_version_release: '83' + property string ide_compat_version_release: '84' property string qtcreator_compat_version: ide_compat_version_major + '.' + ide_compat_version_minor + '.' + ide_compat_version_release property path ide_source_tree: path property string ide_app_path: qbs.targetOS.contains("osx") ? "" : "bin" -- cgit v1.2.1 From 895421897eff04157d4a83f7482eacbb23896f5b Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 24 Jul 2014 13:22:19 +0200 Subject: Dumper: Fix typo and exception handling Change-Id: I4008d5427da7cedc0f57183a25519a1aef1fcb7a Reviewed-by: hjk --- share/qtcreator/debugger/gdbbridge.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index 8fcb721ff6..4a99983e4a 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -510,7 +510,7 @@ class Dumper(DumperBase): self.typesToReport = {} if "forcens" in self.options: - self.qtNamepaceToRport = self.qtNamespace() + self.qtNamepaceToReport = self.qtNamespace() if self.qtNamespaceToReport: self.output.append(',qtnamespace="%s"' % self.qtNamespaceToReport) @@ -1500,14 +1500,16 @@ class Dumper(DumperBase): except: pass - # Seemingly needed with Debian's GDB 7.4.1 - s = gdb.execute("ptype QByteArray", to_string=True) - ns = s[s.find("class")+6:s.find("QByteArray")] - if len(ns): - self.qtNamespaceToReport = ns - self.qtNamespace = lambda: ns - return ns - + try: + # Seemingly needed with Debian's GDB 7.4.1 + s = gdb.execute("ptype QByteArray", to_string=True) + ns = s[s.find("class")+6:s.find("QByteArray")] + if len(ns): + self.qtNamespaceToReport = ns + self.qtNamespace = lambda: ns + return ns + except: + pass self.currentQtNamespaceGuess = "" return "" -- cgit v1.2.1 From 4d24a1605938b847bf564ad87aea011cbc11f92d Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Mon, 21 Jul 2014 02:55:43 -0400 Subject: Qbs: Set cpp.xcodeSdkName and cpp.xcodeSdkVersion. Change-Id: I17ef8c60589208810e9427187249b7a56c46b623 Reviewed-by: Tobias Hunger --- src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp | 13 ++++++++++++- src/plugins/qbsprojectmanager/qbsconstants.h | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index 1e92dd3e8d..878f1676c8 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -39,6 +39,7 @@ #include +#include #include namespace QbsProjectManager { @@ -60,8 +61,10 @@ QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, c { QTC_ASSERT(k, return defaultData); QVariantMap data = defaultData; + + const QString sysroot = ProjectExplorer::SysRootKitInformation::sysRoot(k).toUserOutput(); if (ProjectExplorer::SysRootKitInformation::hasSysRoot(k)) - data.insert(QLatin1String(QBS_SYSROOT), ProjectExplorer::SysRootKitInformation::sysRoot(k).toUserOutput()); + data.insert(QLatin1String(QBS_SYSROOT), sysroot); ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k); if (tc) { @@ -122,6 +125,14 @@ QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, c << QLatin1String("llvm") << QLatin1String("gcc")); } + + // Set Xcode SDK name and version - required by Qbs if a sysroot is present + // Ideally this would be done in a better way... + QRegExp re(QLatin1String("(MacOSX|iPhoneOS|iPhoneSimulator)([0-9]+\\.[0-9]+)\\.sdk")); + if (re.exactMatch(QDir(sysroot).dirName())) { + data.insert(QLatin1String(CPP_XCODESDKNAME), re.cap(1).toLower() + re.cap(2)); + data.insert(QLatin1String(CPP_XCODESDKVERSION), re.cap(2)); + } } else if (targetAbi.os() == ProjectExplorer::Abi::LinuxOS) { data.insert(QLatin1String(QBS_TARGETOS), QStringList() << QLatin1String("linux") << QLatin1String("unix")); diff --git a/src/plugins/qbsprojectmanager/qbsconstants.h b/src/plugins/qbsprojectmanager/qbsconstants.h index 82d070abd5..c0af1997b0 100644 --- a/src/plugins/qbsprojectmanager/qbsconstants.h +++ b/src/plugins/qbsprojectmanager/qbsconstants.h @@ -44,6 +44,8 @@ const char CPP_TOOLCHAINPREFIX[] = "cpp.toolchainPrefix"; const char CPP_COMPILERNAME[] = "cpp.compilerName"; const char CPP_PLATFORMCFLAGS[] = "cpp.platformCFlags"; const char CPP_PLATFORMCXXFLAGS[] = "cpp.platformCxxFlags"; +const char CPP_XCODESDKNAME[] = "cpp.xcodeSdkName"; +const char CPP_XCODESDKVERSION[] = "cpp.xcodeSdkVersion"; } // namespace Constants } // namespace QbsProjectManager -- cgit v1.2.1 From ebd8cc314b447b02fdbe8e63193eabe81b201ed2 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 25 Jul 2014 08:15:35 +0200 Subject: QbsProjectManager: Fix compile Change-Id: I532412928e0c58da63783d79038939564342cea7 Reviewed-by: Jake Petroules Reviewed-by: Oliver Wolff --- src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index 878f1676c8..e5b0ac5a4d 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -130,7 +130,7 @@ QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, c // Ideally this would be done in a better way... QRegExp re(QLatin1String("(MacOSX|iPhoneOS|iPhoneSimulator)([0-9]+\\.[0-9]+)\\.sdk")); if (re.exactMatch(QDir(sysroot).dirName())) { - data.insert(QLatin1String(CPP_XCODESDKNAME), re.cap(1).toLower() + re.cap(2)); + data.insert(QLatin1String(CPP_XCODESDKNAME), QString(re.cap(1).toLower() + re.cap(2))); data.insert(QLatin1String(CPP_XCODESDKVERSION), re.cap(2)); } } else if (targetAbi.os() == ProjectExplorer::Abi::LinuxOS) { -- cgit v1.2.1 From 86fc0157dc32672a5c79782e1c553c7c29917004 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Thu, 24 Jul 2014 16:57:45 +0200 Subject: Doc: add Qbs build options With screenshots. Change-Id: Iec3b44c668fb99761664abcb9a0f9d22afb64ed9 Reviewed-by: Christian Kandeler --- doc/images/creator-qbs-build-app.png | Bin 0 -> 65026 bytes doc/images/creator-qbs-build-clean.png | Bin 0 -> 30178 bytes doc/src/projects/creator-projects-qbs.qdoc | 86 ++++++++++++++++++++- .../projects/creator-projects-settings-build.qdoc | 6 ++ 4 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 doc/images/creator-qbs-build-app.png create mode 100644 doc/images/creator-qbs-build-clean.png diff --git a/doc/images/creator-qbs-build-app.png b/doc/images/creator-qbs-build-app.png new file mode 100644 index 0000000000..17e4684960 Binary files /dev/null and b/doc/images/creator-qbs-build-app.png differ diff --git a/doc/images/creator-qbs-build-clean.png b/doc/images/creator-qbs-build-clean.png new file mode 100644 index 0000000000..892a42dd57 Binary files /dev/null and b/doc/images/creator-qbs-build-clean.png differ diff --git a/doc/src/projects/creator-projects-qbs.qdoc b/doc/src/projects/creator-projects-qbs.qdoc index a04763e50d..9c8b246e94 100644 --- a/doc/src/projects/creator-projects-qbs.qdoc +++ b/doc/src/projects/creator-projects-qbs.qdoc @@ -39,6 +39,8 @@ selecting \gui Help > \gui {About Plugins} > \gui {Build Systems} > \gui {QbsProjectManager} and restarting \QC. + \section1 Building Qbs + To build the Qbs plugin yourself from the \QC git repository: \list 1 @@ -46,7 +48,7 @@ \li Fetch the Qbs submodule in your \QC git checkout with \c {git submodule update --init}. - \li Run qmake on \QC and build \QC again. + \li Use Qbs or qmake and make to build \QC again. \li Enable the Qbs plugin as described above. @@ -69,10 +71,88 @@ \c Depends item for a Qt application. For examples, see the \c {examples} directory in the qbs repository. + \li Select \gui Projects to specify \gui {Build Settings} for the + project. + + \li Select \gui {Build Steps} > \gui Details to specify build steps: + + \image creator-qbs-build-app.png + + \list 1 + + \li In the \gui {Build variant} field, select \gui Debug to + include debug symbols in the build for debugging the + application and \gui Release to create the final + installation file. + + \li In the \gui {Parallel jobs} field, specify the number of + parallel jobs to use for building. + + \li Select the \gui {Enable QML debugging} check box to debug + Qt Quick application projects. + + \note Debugging requires opening a socket at a well-known + port, which presents a security risk. Anyone on the Internet + could connect to the application that you are debugging and + execute any JavaScript functions. Therefore, you must make + sure that the port is properly protected by a firewall. + + \li In the \gui Properties field, specify the properties to pass + to the project. Use colons (:) to separate keys from values. + For more information, see + \l{http://qt-project.org/doc/qbs/language-introduction.html} + {Modules} in the Qbs Manual. + + \li In the \gui Flags field: + + \list + + \li Select \gui {Dry run} to test building without + executing commands or making permanent + changes to the build graph. + + \li Select \gui {Keep going} to continue building when + errors occur, if possible. + + \li Select \gui {Check timestamps} to retrieve the + timestamps from the file system instead of using the + ones stored in the build graph. You only need this + option if you made changes to the build directory + manually, which is not recommended. + + \endlist + + \endlist + + The \gui {Equivalent command line} field displays the build command + that is constructed based on the selected options. + + \li Select \gui {Clean Steps} > \gui Details to specify flags for the + cleaning step. + + \image creator-qbs-build-clean.png + + \list + + \li Select \gui {Clean all artifacts} to remove all build + artifacts. + + \li Select \gui {Dry run} to test cleaning without executing + commands or making permanent changes to the build graph. + + \li Select \gui {Keep going} to continue cleaning when errors + occur, if possible. + + \endlist + + The \gui {Equivalent command line} field displays the clean command + that is constructed based on the selected options. + + \li Select \gui Build > \gui {Build Project} to build the application. + \li Click the \inlineimage qtcreator-run.png - (\gui Run) button to build, deploy, and run the application. - + (\gui Run) button to deploy and run the application. \endlist */ diff --git a/doc/src/projects/creator-projects-settings-build.qdoc b/doc/src/projects/creator-projects-settings-build.qdoc index 67fc627391..029ea38fed 100644 --- a/doc/src/projects/creator-projects-settings-build.qdoc +++ b/doc/src/projects/creator-projects-settings-build.qdoc @@ -120,6 +120,9 @@ the build step and add a custom build step that specifies another shell command. + \note For more information about the build steps when using Qbs, see + \l{Building Applications with Qbs}. + \section2 Adding Custom Build Steps To add custom steps to the build settings, select \gui {Add Build Step > @@ -156,6 +159,9 @@ (\gui {Move Up} and \gui {Move Down}). \endlist + \note For more information about the cleaning steps when using Qbs, see + \l{Building Applications with Qbs}. + \section1 Build Environment You can specify the environment you want to use for building in the -- cgit v1.2.1 From 57e6dfc35acd72c80e8c95b7f98989c15decea33 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Fri, 25 Jul 2014 14:31:25 +0200 Subject: Doc: fix changed Valgrind function names Change-Id: I15c96c976c2e921588ddf420180b3318866dff9a Reviewed-by: hjk --- doc/src/analyze/creator-valgrind.qdoc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/doc/src/analyze/creator-valgrind.qdoc b/doc/src/analyze/creator-valgrind.qdoc index 6df6499b60..6b475066b3 100644 --- a/doc/src/analyze/creator-valgrind.qdoc +++ b/doc/src/analyze/creator-valgrind.qdoc @@ -46,9 +46,7 @@ \li In the \gui Projects mode, select a debug build configuration. - \li Select \gui Analyze to open the \gui Analyze mode. - - \li Select \gui {Analyze Memory} on the toolbar. + \li Select \gui Analyze > \gui {Valgrind Memory Analyzer}. \li Select the \inlineimage qtcreator-analyze-start-button.png "Start button" @@ -156,9 +154,7 @@ \li In the \gui Projects mode, select a release build configuration. - \li Select \gui Analyze to open the \gui Analyze mode. - - \li Select \gui Profile on the toolbar. + \li Select \gui Analyze > \gui {Valgrind Function Profiler}. \li Select the \inlineimage qtcreator-analyze-start-button.png "Start button" -- cgit v1.2.1 From 537b45008b012a13ff5d179917564385a9af62ac Mon Sep 17 00:00:00 2001 From: Thomas Otto Date: Wed, 16 Jul 2014 14:28:00 +0200 Subject: KitChooser: added focus proxy - focus proxy set to the combo box if it is populated with > 1 element, otherwise to the manage button Change-Id: I4e27b7bb3300d43bc146660221ab9f48386210b1 Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/kitchooser.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/projectexplorer/kitchooser.cpp b/src/plugins/projectexplorer/kitchooser.cpp index 25f082b608..96fa0e0e46 100644 --- a/src/plugins/projectexplorer/kitchooser.cpp +++ b/src/plugins/projectexplorer/kitchooser.cpp @@ -56,6 +56,7 @@ KitChooser::KitChooser(QWidget *parent) : layout->setContentsMargins(0, 0, 0, 0); layout->addWidget(m_chooser); layout->addWidget(m_manageButton); + setFocusProxy(m_manageButton); connect(m_chooser, SIGNAL(currentIndexChanged(int)), SLOT(onCurrentIndexChanged(int))); connect(m_chooser, SIGNAL(activated(int)), SIGNAL(activated(int))); @@ -107,6 +108,12 @@ void KitChooser::populate() const int index = Core::ICore::settings()->value(QLatin1String(lastKitKey)).toInt(); m_chooser->setCurrentIndex(0 <= index && index < n ? index : -1); m_chooser->setEnabled(n > 1); + + if (n > 1) + setFocusProxy(m_chooser); + else + setFocusProxy(m_manageButton); + } Kit *KitChooser::currentKit() const -- cgit v1.2.1 From bfcc7065d300db8c66c3bd0136aede54e3cbf152 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Fri, 25 Jul 2014 15:25:32 +0200 Subject: Doc: fix typo in "Window" menu name Change-Id: Ic2175f72e9dee9a63c8eda86cf431c7479b4c08e Reviewed-by: Leena Miettinen --- doc/src/debugger/creator-debugger.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/debugger/creator-debugger.qdoc b/doc/src/debugger/creator-debugger.qdoc index da09ceec30..fc15d00d03 100644 --- a/doc/src/debugger/creator-debugger.qdoc +++ b/doc/src/debugger/creator-debugger.qdoc @@ -1216,7 +1216,7 @@ \li Make sure the debugger is set up properly. For more information, see \l{Setting Up Debugger}. - \li In the \gui Debug mode, select \gui {Windows > Views > Debugger + \li In the \gui Debug mode, select \gui {Window > Views > Debugger Log} to open the \gui {Debugger Log} view. Browse the contents of the pane on the right hand side to find out what went wrong. Always attach the contents of the pane to debugger-related -- cgit v1.2.1 From 0cb887e6aed6fb55e1f205d2614dc9eb03a82719 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 25 Jul 2014 09:23:19 +0200 Subject: ProjectExplorer: Fix the download Url for jom Change-Id: Id0405609f319472fc0eac9064ed9d14781217906 Reviewed-by: Robert Loehning --- src/plugins/projectexplorer/projectexplorersettingspage.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/projectexplorersettingspage.ui b/src/plugins/projectexplorer/projectexplorersettingspage.ui index 55bb9fad10..2b1b040750 100644 --- a/src/plugins/projectexplorer/projectexplorersettingspage.ui +++ b/src/plugins/projectexplorer/projectexplorersettingspage.ui @@ -200,7 +200,7 @@ - <i>jom</i> is a drop-in replacement for <i>nmake</i> which distributes the compilation process to multiple CPU cores. The latest binary is available at <a href="http://releases.qt-project.org/jom/">http://releases.qt-project.org/jom/</a>. Disable it if you experience problems with your builds. + <i>jom</i> is a drop-in replacement for <i>nmake</i> which distributes the compilation process to multiple CPU cores. The latest binary is available at <a href="http://download.qt-project.org/official_releases/jom/">http://download.qt-project.org/official_releases/jom/</a>. Disable it if you experience problems with your builds. true -- cgit v1.2.1 From de5f0a761318cdc99d6d248e25d5c228582f2a04 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Fri, 25 Jul 2014 16:16:53 +0200 Subject: Doc: change doc to reflect the UI The doc was changed in bc3865b7, but the corresponding UI change has been lost (maybe during merges), so changing this back for 3.2. *DO NOT MERGE THIS CHANGE TO MASTER* Change-Id: I7512971b0b5e2e5d5ef909c601d72aa504fd71bf Reviewed-by: hjk --- doc/src/debugger/creator-debugger.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/debugger/creator-debugger.qdoc b/doc/src/debugger/creator-debugger.qdoc index fc15d00d03..3f049c335f 100644 --- a/doc/src/debugger/creator-debugger.qdoc +++ b/doc/src/debugger/creator-debugger.qdoc @@ -892,8 +892,8 @@ Debugging helpers are always automatically used. To force a plain C-like display of structures, select \gui Tools > \gui Options > - \gui Debugger > \gui {Locals & Expressions}, and then select the - \gui{Force Raw Structure Display} check box. For GDB + \gui Debugger > \gui {Locals & Expressions}, and then deselect the + \gui{Use Debugging Helper} check box. For GDB and LLDB this will still use the Python scripts, but generate more basic output. To force plain display for a single object or for all objects of a given type, select the corresponding -- cgit v1.2.1 From 590ccce734d59393597ef33366538f483186e7f6 Mon Sep 17 00:00:00 2001 From: Thomas Otto Date: Wed, 23 Jul 2014 11:59:49 +0200 Subject: LoadCoreDialog: only try reading from existing corefile - currently gdb is called on every change of the core file, i.e. on every keypress when typing a path. Changed to only do that when the file exists Change-Id: I27f1c21b2561420d72f273244dc6a1bb5fb8bfe7 Reviewed-by: hjk --- src/plugins/debugger/loadcoredialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/debugger/loadcoredialog.cpp b/src/plugins/debugger/loadcoredialog.cpp index 37ff6bc113..e637a40dbe 100644 --- a/src/plugins/debugger/loadcoredialog.cpp +++ b/src/plugins/debugger/loadcoredialog.cpp @@ -363,7 +363,7 @@ bool AttachCoreDialog::useLocalCoreFile() const void AttachCoreDialog::coreFileChanged(const QString &core) { - if (!Utils::HostOsInfo::isWindowsHost()) { + if (!Utils::HostOsInfo::isWindowsHost() && QFileInfo::exists(core)) { Kit *k = d->kitChooser->currentKit(); QTC_ASSERT(k, return); FileName cmd = DebuggerKitInformation::debuggerCommand(k); -- cgit v1.2.1 From c6d285544f98f65c80866a767f601d44f231fe91 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sun, 27 Jul 2014 10:24:27 +0300 Subject: Fix Qt4 compilation Change-Id: I1789ec51aba4a832a67bba1c549473d413c77543 Reviewed-by: Christian Stenger --- src/plugins/debugger/loadcoredialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/debugger/loadcoredialog.cpp b/src/plugins/debugger/loadcoredialog.cpp index e637a40dbe..edfdb6b77b 100644 --- a/src/plugins/debugger/loadcoredialog.cpp +++ b/src/plugins/debugger/loadcoredialog.cpp @@ -363,7 +363,7 @@ bool AttachCoreDialog::useLocalCoreFile() const void AttachCoreDialog::coreFileChanged(const QString &core) { - if (!Utils::HostOsInfo::isWindowsHost() && QFileInfo::exists(core)) { + if (!Utils::HostOsInfo::isWindowsHost() && QFile::exists(core)) { Kit *k = d->kitChooser->currentKit(); QTC_ASSERT(k, return); FileName cmd = DebuggerKitInformation::debuggerCommand(k); -- cgit v1.2.1 From c8495bedaff168ec3cfcbff72b13e1d84132e804 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sun, 27 Jul 2014 10:48:23 +0300 Subject: BareMetal: Do not execute if executable not found Change-Id: Iea9bd22117133ab55ee6743d0f359808bfaef2aa Reviewed-by: Tim Sander Reviewed-by: hjk --- src/plugins/baremetal/baremetalruncontrolfactory.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/baremetal/baremetalruncontrolfactory.cpp b/src/plugins/baremetal/baremetalruncontrolfactory.cpp index b79cfb91f7..47261b2fd0 100644 --- a/src/plugins/baremetal/baremetalruncontrolfactory.cpp +++ b/src/plugins/baremetal/baremetalruncontrolfactory.cpp @@ -134,6 +134,10 @@ RunControl *BareMetalRunControlFactory::create(RunConfiguration *runConfiguratio return 0; } DebuggerStartParameters sp = startParameters(rc); + if (!QFile::exists(sp.executable)) { + *errorMessage = tr("Could not find executable"); + return 0; + } return DebuggerPlugin::createDebugger(sp,runConfiguration,errorMessage); } -- cgit v1.2.1 From b117efc5948a31b195fa651792a35592fc87346c Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sat, 26 Jul 2014 22:57:42 +0300 Subject: DiffEditor: Tests cleanup Change-Id: Iddabf11692a192874096bb5f030d8575fc5cefd6 Reviewed-by: Jarek Kobus --- src/plugins/diffeditor/diffeditorplugin.cpp | 441 +++++++++++++--------------- 1 file changed, 209 insertions(+), 232 deletions(-) diff --git a/src/plugins/diffeditor/diffeditorplugin.cpp b/src/plugins/diffeditor/diffeditorplugin.cpp index 699b4716c1..3879297661 100644 --- a/src/plugins/diffeditor/diffeditorplugin.cpp +++ b/src/plugins/diffeditor/diffeditorplugin.cpp @@ -224,6 +224,8 @@ void DiffEditorPlugin::diff() Q_DECLARE_METATYPE(DiffEditor::ChunkData) Q_DECLARE_METATYPE(QList) +static inline QString _(const char *string) { return QString::fromLatin1(string); } + void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data() { QTest::addColumn("sourceChunk"); @@ -232,19 +234,17 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data() QTest::addColumn("lastChunk"); QTest::addColumn("patchText"); - const QString fileName = QLatin1String("a.txt"); - const QString header = QLatin1String("--- ") + fileName - + QLatin1String("\n+++ ") + fileName + QLatin1String("\n"); + const QString fileName = _("a.txt"); + const QString header = _("--- ") + fileName + _("\n+++ ") + fileName + _("\n"); QList rows; - rows << RowData(TextLineData(QLatin1String("ABCD")), - TextLineData(TextLineData::Separator)); - rows << RowData(TextLineData(QLatin1String("EFGH"))); + rows << RowData(_("ABCD"), TextLineData::Separator); + rows << RowData(_("EFGH")); ChunkData chunk; chunk.rows = rows; - QString patchText = header + QLatin1String("@@ -1,2 +1,1 @@\n" - "-ABCD\n" - " EFGH\n"); + QString patchText = header + _("@@ -1,2 +1,1 @@\n" + "-ABCD\n" + " EFGH\n"); QTest::newRow("Simple not a last chunk") << chunk << fileName << fileName @@ -254,10 +254,10 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data() /////////// // chunk the same here - patchText = header + QLatin1String("@@ -1,2 +1,1 @@\n" - "-ABCD\n" - " EFGH\n" - "\\ No newline at end of file\n"); + patchText = header + _("@@ -1,2 +1,1 @@\n" + "-ABCD\n" + " EFGH\n" + "\\ No newline at end of file\n"); QTest::newRow("Simple last chunk") << chunk << fileName @@ -268,14 +268,13 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data() /////////// rows.clear(); - rows << RowData(TextLineData(QLatin1String("ABCD"))); - rows << RowData(TextLineData(QLatin1String("")), - TextLineData(TextLineData::Separator)); + rows << RowData(_("ABCD")); + rows << RowData(_(""), TextLineData::Separator); chunk.rows = rows; - patchText = header + QLatin1String("@@ -1,1 +1,1 @@\n" - "-ABCD\n" - "+ABCD\n" - "\\ No newline at end of file\n"); + patchText = header + _("@@ -1,1 +1,1 @@\n" + "-ABCD\n" + "+ABCD\n" + "\\ No newline at end of file\n"); QTest::newRow("EOL in last line removed") << chunk << fileName @@ -286,9 +285,9 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data() /////////// // chunk the same here - patchText = header + QLatin1String("@@ -1,2 +1,1 @@\n" - " ABCD\n" - "-\n"); + patchText = header + _("@@ -1,2 +1,1 @@\n" + " ABCD\n" + "-\n"); QTest::newRow("Last empty line removed") << chunk << fileName @@ -299,14 +298,13 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data() /////////// rows.clear(); - rows << RowData(TextLineData(QLatin1String("ABCD"))); - rows << RowData(TextLineData(TextLineData::Separator), - TextLineData(QLatin1String(""))); + rows << RowData(_("ABCD")); + rows << RowData(TextLineData::Separator, _("")); chunk.rows = rows; - patchText = header + QLatin1String("@@ -1,1 +1,1 @@\n" - "-ABCD\n" - "\\ No newline at end of file\n" - "+ABCD\n"); + patchText = header + _("@@ -1,1 +1,1 @@\n" + "-ABCD\n" + "\\ No newline at end of file\n" + "+ABCD\n"); QTest::newRow("EOL to last line added") << chunk << fileName @@ -317,9 +315,9 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data() /////////// // chunk the same here - patchText = header + QLatin1String("@@ -1,1 +1,2 @@\n" - " ABCD\n" - "+\n"); + patchText = header + _("@@ -1,1 +1,2 @@\n" + " ABCD\n" + "+\n"); QTest::newRow("Last empty line added") << chunk << fileName @@ -330,12 +328,11 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data() /////////// rows.clear(); - rows << RowData(TextLineData(QLatin1String("ABCD")), - TextLineData(QLatin1String("EFGH"))); + rows << RowData(_("ABCD"), _("EFGH")); chunk.rows = rows; - patchText = header + QLatin1String("@@ -1,1 +1,1 @@\n" - "-ABCD\n" - "+EFGH\n"); + patchText = header + _("@@ -1,1 +1,1 @@\n" + "-ABCD\n" + "+EFGH\n"); QTest::newRow("Last line with a newline modified") << chunk << fileName @@ -346,14 +343,13 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data() /////////// rows.clear(); - rows << RowData(TextLineData(QLatin1String("ABCD")), - TextLineData(QLatin1String("EFGH"))); - rows << RowData(TextLineData(QLatin1String(""))); + rows << RowData(_("ABCD"), _("EFGH")); + rows << RowData(_("")); chunk.rows = rows; - patchText = header + QLatin1String("@@ -1,2 +1,2 @@\n" - "-ABCD\n" - "+EFGH\n" - " \n"); + patchText = header + _("@@ -1,2 +1,2 @@\n" + "-ABCD\n" + "+EFGH\n" + " \n"); QTest::newRow("Not a last line with a newline modified") << chunk << fileName << fileName @@ -363,14 +359,13 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data() /////////// rows.clear(); - rows << RowData(TextLineData(QLatin1String("ABCD")), - TextLineData(QLatin1String("EFGH"))); + rows << RowData(_("ABCD"), _("EFGH")); chunk.rows = rows; - patchText = header + QLatin1String("@@ -1,1 +1,1 @@\n" - "-ABCD\n" - "\\ No newline at end of file\n" - "+EFGH\n" - "\\ No newline at end of file\n"); + patchText = header + _("@@ -1,1 +1,1 @@\n" + "-ABCD\n" + "\\ No newline at end of file\n" + "+EFGH\n" + "\\ No newline at end of file\n"); QTest::newRow("Last line without a newline modified") << chunk << fileName @@ -381,9 +376,9 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data() /////////// // chunk the same here - patchText = header + QLatin1String("@@ -1,1 +1,1 @@\n" - "-ABCD\n" - "+EFGH\n"); + patchText = header + _("@@ -1,1 +1,1 @@\n" + "-ABCD\n" + "+EFGH\n"); QTest::newRow("Not a last line without a newline modified") << chunk << fileName << fileName @@ -393,15 +388,14 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data() /////////// rows.clear(); - rows << RowData(TextLineData(QLatin1String("ABCD")), - TextLineData(QLatin1String("EFGH"))); - rows << RowData(TextLineData(QLatin1String("IJKL"))); + rows << RowData(_("ABCD"), _("EFGH")); + rows << RowData(_("IJKL")); chunk.rows = rows; - patchText = header + QLatin1String("@@ -1,2 +1,2 @@\n" - "-ABCD\n" - "+EFGH\n" - " IJKL\n" - "\\ No newline at end of file\n"); + patchText = header + _("@@ -1,2 +1,2 @@\n" + "-ABCD\n" + "+EFGH\n" + " IJKL\n" + "\\ No newline at end of file\n"); QTest::newRow("Last but one line modified, last line without a newline") << chunk @@ -413,10 +407,10 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data() /////////// // chunk the same here - patchText = header + QLatin1String("@@ -1,2 +1,2 @@\n" - "-ABCD\n" - "+EFGH\n" - " IJKL\n"); + patchText = header + _("@@ -1,2 +1,2 @@\n" + "-ABCD\n" + "+EFGH\n" + " IJKL\n"); QTest::newRow("Last but one line modified, last line with a newline") << chunk @@ -472,186 +466,171 @@ void DiffEditor::Internal::DiffEditorPlugin::testReadPatch_data() QTest::addColumn("sourcePatch"); QTest::addColumn >("fileDataList"); - QString patch = QLatin1String("diff --git a/src/plugins/diffeditor/diffeditor.cpp b/src/plugins/diffeditor/diffeditor.cpp\n" - "index eab9e9b..082c135 100644\n" - "--- a/src/plugins/diffeditor/diffeditor.cpp\n" - "+++ b/src/plugins/diffeditor/diffeditor.cpp\n" - "@@ -187,9 +187,6 @@ void DiffEditor::ctor()\n" - " m_controller = m_document->controller();\n" - " m_guiController = new DiffEditorGuiController(m_controller, this);\n" - " \n" - "-// m_sideBySideEditor->setDiffEditorGuiController(m_guiController);\n" - "-// m_unifiedEditor->setDiffEditorGuiController(m_guiController);\n" - "-\n" - " connect(m_controller, SIGNAL(cleared(QString)),\n" - " this, SLOT(slotCleared(QString)));\n" - " connect(m_controller, SIGNAL(diffContentsChanged(QList,QString)),\n" - "diff --git a/src/plugins/diffeditor/diffutils.cpp b/src/plugins/diffeditor/diffutils.cpp\n" - "index 2f641c9..f8ff795 100644\n" - "--- a/src/plugins/diffeditor/diffutils.cpp\n" - "+++ b/src/plugins/diffeditor/diffutils.cpp\n" - "@@ -464,5 +464,12 @@ QString DiffUtils::makePatch(const ChunkData &chunkData,\n" - " return diffText;\n" - " }\n" - " \n" - "+FileData DiffUtils::makeFileData(const QString &patch)\n" - "+{\n" - "+ FileData fileData;\n" - "+\n" - "+ return fileData;\n" - "+}\n" - "+\n" - " } // namespace Internal\n" - " } // namespace DiffEditor\n" - "diff --git a/new b/new\n" - "new file mode 100644\n" - "index 0000000..257cc56\n" - "--- /dev/null\n" - "+++ b/new\n" - "@@ -0,0 +1 @@\n" - "+foo\n" - "diff --git a/deleted b/deleted\n" - "deleted file mode 100644\n" - "index 257cc56..0000000\n" - "--- a/deleted\n" - "+++ /dev/null\n" - "@@ -1 +0,0 @@\n" - "-foo\n" - "diff --git a/empty b/empty\n" - "new file mode 100644\n" - "index 0000000..e69de29\n" - "diff --git a/empty b/empty\n" - "deleted file mode 100644\n" - "index e69de29..0000000\n" - "diff --git a/file a.txt b/file b.txt\n" - "similarity index 99%\n" - "copy from file a.txt\n" - "copy to file b.txt\n" - "index 1234567..9876543\n" - "--- a/file a.txt\n" - "+++ b/file b.txt\n" - "@@ -20,3 +20,3 @@\n" - " A\n" - "-B\n" - "+C\n" - " D\n" - "diff --git a/file a.txt b/file b.txt\n" - "similarity index 99%\n" - "rename from file a.txt\n" - "rename to file b.txt\n" - ); + QString patch = _("diff --git a/src/plugins/diffeditor/diffeditor.cpp b/src/plugins/diffeditor/diffeditor.cpp\n" + "index eab9e9b..082c135 100644\n" + "--- a/src/plugins/diffeditor/diffeditor.cpp\n" + "+++ b/src/plugins/diffeditor/diffeditor.cpp\n" + "@@ -187,9 +187,6 @@ void DiffEditor::ctor()\n" + " m_controller = m_document->controller();\n" + " m_guiController = new DiffEditorGuiController(m_controller, this);\n" + " \n" + "-// m_sideBySideEditor->setDiffEditorGuiController(m_guiController);\n" + "-// m_unifiedEditor->setDiffEditorGuiController(m_guiController);\n" + "-\n" + " connect(m_controller, SIGNAL(cleared(QString)),\n" + " this, SLOT(slotCleared(QString)));\n" + " connect(m_controller, SIGNAL(diffContentsChanged(QList,QString)),\n" + "diff --git a/src/plugins/diffeditor/diffutils.cpp b/src/plugins/diffeditor/diffutils.cpp\n" + "index 2f641c9..f8ff795 100644\n" + "--- a/src/plugins/diffeditor/diffutils.cpp\n" + "+++ b/src/plugins/diffeditor/diffutils.cpp\n" + "@@ -464,5 +464,12 @@ QString DiffUtils::makePatch(const ChunkData &chunkData,\n" + " return diffText;\n" + " }\n" + " \n" + "+FileData DiffUtils::makeFileData(const QString &patch)\n" + "+{\n" + "+ FileData fileData;\n" + "+\n" + "+ return fileData;\n" + "+}\n" + "+\n" + " } // namespace Internal\n" + " } // namespace DiffEditor\n" + "diff --git a/new b/new\n" + "new file mode 100644\n" + "index 0000000..257cc56\n" + "--- /dev/null\n" + "+++ b/new\n" + "@@ -0,0 +1 @@\n" + "+foo\n" + "diff --git a/deleted b/deleted\n" + "deleted file mode 100644\n" + "index 257cc56..0000000\n" + "--- a/deleted\n" + "+++ /dev/null\n" + "@@ -1 +0,0 @@\n" + "-foo\n" + "diff --git a/empty b/empty\n" + "new file mode 100644\n" + "index 0000000..e69de29\n" + "diff --git a/empty b/empty\n" + "deleted file mode 100644\n" + "index e69de29..0000000\n" + "diff --git a/file a.txt b/file b.txt\n" + "similarity index 99%\n" + "copy from file a.txt\n" + "copy to file b.txt\n" + "index 1234567..9876543\n" + "--- a/file a.txt\n" + "+++ b/file b.txt\n" + "@@ -20,3 +20,3 @@\n" + " A\n" + "-B\n" + "+C\n" + " D\n" + "diff --git a/file a.txt b/file b.txt\n" + "similarity index 99%\n" + "rename from file a.txt\n" + "rename to file b.txt\n" + ); FileData fileData1; - fileData1.leftFileInfo = DiffFileInfo(QLatin1String("src/plugins/diffeditor/diffeditor.cpp"), - QLatin1String("eab9e9b")); - fileData1.rightFileInfo = DiffFileInfo(QLatin1String("src/plugins/diffeditor/diffeditor.cpp"), - QLatin1String("082c135")); + fileData1.leftFileInfo = DiffFileInfo(_("src/plugins/diffeditor/diffeditor.cpp"), _("eab9e9b")); + fileData1.rightFileInfo = DiffFileInfo(_("src/plugins/diffeditor/diffeditor.cpp"), _("082c135")); ChunkData chunkData1; chunkData1.leftStartingLineNumber = 186; chunkData1.rightStartingLineNumber = 186; QList rows1; - rows1.append(RowData(TextLineData(QLatin1String(" m_controller = m_document->controller();")))); - rows1.append(RowData(TextLineData(QLatin1String(" m_guiController = new DiffEditorGuiController(m_controller, this);")))); - rows1.append(RowData(TextLineData(QLatin1String("")))); - rows1.append(RowData(TextLineData(QLatin1String("// m_sideBySideEditor->setDiffEditorGuiController(m_guiController);")), - TextLineData(TextLineData::Separator))); - rows1.append(RowData(TextLineData(QLatin1String("// m_unifiedEditor->setDiffEditorGuiController(m_guiController);")), - TextLineData(TextLineData::Separator))); - rows1.append(RowData(TextLineData(QLatin1String("")), - TextLineData(TextLineData::Separator))); - rows1.append(RowData(TextLineData(QLatin1String(" connect(m_controller, SIGNAL(cleared(QString)),")))); - rows1.append(RowData(TextLineData(QLatin1String(" this, SLOT(slotCleared(QString)));")))); - rows1.append(RowData(TextLineData(QLatin1String(" connect(m_controller, SIGNAL(diffContentsChanged(QList,QString)),")))); + rows1 << RowData(_(" m_controller = m_document->controller();")); + rows1 << RowData(_(" m_guiController = new DiffEditorGuiController(m_controller, this);")); + rows1 << RowData(_("")); + rows1 << RowData(_("// m_sideBySideEditor->setDiffEditorGuiController(m_guiController);"), TextLineData::Separator); + rows1 << RowData(_("// m_unifiedEditor->setDiffEditorGuiController(m_guiController);"), TextLineData::Separator); + rows1 << RowData(_(""), TextLineData::Separator); + rows1 << RowData(_(" connect(m_controller, SIGNAL(cleared(QString)),")); + rows1 << RowData(_(" this, SLOT(slotCleared(QString)));")); + rows1 << RowData(_(" connect(m_controller, SIGNAL(diffContentsChanged(QList,QString)),")); chunkData1.rows = rows1; - fileData1.chunks.append(chunkData1); + fileData1.chunks << chunkData1; FileData fileData2; - fileData2.leftFileInfo = DiffFileInfo(QLatin1String("src/plugins/diffeditor/diffutils.cpp"), - QLatin1String("2f641c9")); - fileData2.rightFileInfo = DiffFileInfo(QLatin1String("src/plugins/diffeditor/diffutils.cpp"), - QLatin1String("f8ff795")); + fileData2.leftFileInfo = DiffFileInfo(_("src/plugins/diffeditor/diffutils.cpp"), _("2f641c9")); + fileData2.rightFileInfo = DiffFileInfo(_("src/plugins/diffeditor/diffutils.cpp"), _("f8ff795")); ChunkData chunkData2; chunkData2.leftStartingLineNumber = 463; chunkData2.rightStartingLineNumber = 463; QList rows2; - rows2.append(RowData(TextLineData(QLatin1String(" return diffText;")))); - rows2.append(RowData(TextLineData(QLatin1String("}")))); - rows2.append(RowData(TextLineData(QLatin1String("")))); - rows2.append(RowData(TextLineData(TextLineData::Separator), - TextLineData(QLatin1String("FileData DiffUtils::makeFileData(const QString &patch)")))); - rows2.append(RowData(TextLineData(TextLineData::Separator), - TextLineData(QLatin1String("{")))); - rows2.append(RowData(TextLineData(TextLineData::Separator), - TextLineData(QLatin1String(" FileData fileData;")))); - rows2.append(RowData(TextLineData(TextLineData::Separator), - TextLineData(QLatin1String("")))); - rows2.append(RowData(TextLineData(TextLineData::Separator), - TextLineData(QLatin1String(" return fileData;")))); - rows2.append(RowData(TextLineData(TextLineData::Separator), - TextLineData(QLatin1String("}")))); - rows2.append(RowData(TextLineData(TextLineData::Separator), - TextLineData(QLatin1String("")))); - rows2.append(RowData(TextLineData(QLatin1String("} // namespace Internal")))); - rows2.append(RowData(TextLineData(QLatin1String("} // namespace DiffEditor")))); + rows2 << RowData(_(" return diffText;")); + rows2 << RowData(_("}")); + rows2 << RowData(_("")); + rows2 << RowData(TextLineData::Separator, _("FileData DiffUtils::makeFileData(const QString &patch)")); + rows2 << RowData(TextLineData::Separator, _("{")); + rows2 << RowData(TextLineData::Separator, _(" FileData fileData;")); + rows2 << RowData(TextLineData::Separator, _("")); + rows2 << RowData(TextLineData::Separator, _(" return fileData;")); + rows2 << RowData(TextLineData::Separator, _("}")); + rows2 << RowData(TextLineData::Separator, _("")); + rows2 << RowData(_("} // namespace Internal")); + rows2 << RowData(_("} // namespace DiffEditor")); chunkData2.rows = rows2; - fileData2.chunks.append(chunkData2); + fileData2.chunks << chunkData2; FileData fileData3; - fileData3.leftFileInfo = DiffFileInfo(QLatin1String("new"), QLatin1String("0000000")); - fileData3.rightFileInfo = DiffFileInfo(QLatin1String("new"), QLatin1String("257cc56")); + fileData3.leftFileInfo = DiffFileInfo(_("new"), _("0000000")); + fileData3.rightFileInfo = DiffFileInfo(_("new"), _("257cc56")); fileData3.fileOperation = FileData::NewFile; ChunkData chunkData3; chunkData3.leftStartingLineNumber = -1; chunkData3.rightStartingLineNumber = 0; QList rows3; - rows3.append(RowData(TextLineData::Separator, TextLineData(QLatin1String("foo")))); + rows3 << RowData(TextLineData::Separator, _("foo")); TextLineData textLineData3(TextLineData::TextLine); - rows3.append(RowData(TextLineData::Separator, textLineData3)); + rows3 << RowData(TextLineData::Separator, textLineData3); chunkData3.rows = rows3; - fileData3.chunks.append(chunkData3); + fileData3.chunks << chunkData3; FileData fileData4; - fileData4.leftFileInfo = DiffFileInfo(QLatin1String("deleted"), QLatin1String("257cc56")); - fileData4.rightFileInfo = DiffFileInfo(QLatin1String("deleted"), QLatin1String("0000000")); + fileData4.leftFileInfo = DiffFileInfo(_("deleted"), _("257cc56")); + fileData4.rightFileInfo = DiffFileInfo(_("deleted"), _("0000000")); fileData4.fileOperation = FileData::DeleteFile; ChunkData chunkData4; chunkData4.leftStartingLineNumber = 0; chunkData4.rightStartingLineNumber = -1; QList rows4; - rows4.append(RowData(TextLineData(QLatin1String("foo")), TextLineData::Separator)); + rows4 << RowData(_("foo"), TextLineData::Separator); TextLineData textLineData4(TextLineData::TextLine); - rows4.append(RowData(textLineData4, TextLineData::Separator)); + rows4 << RowData(textLineData4, TextLineData::Separator); chunkData4.rows = rows4; - fileData4.chunks.append(chunkData4); + fileData4.chunks << chunkData4; FileData fileData5; - fileData5.leftFileInfo = DiffFileInfo(QLatin1String("empty"), QLatin1String("0000000")); - fileData5.rightFileInfo = DiffFileInfo(QLatin1String("empty"), QLatin1String("e69de29")); + fileData5.leftFileInfo = DiffFileInfo(_("empty"), _("0000000")); + fileData5.rightFileInfo = DiffFileInfo(_("empty"), _("e69de29")); fileData5.fileOperation = FileData::NewFile; FileData fileData6; - fileData6.leftFileInfo = DiffFileInfo(QLatin1String("empty"), QLatin1String("e69de29")); - fileData6.rightFileInfo = DiffFileInfo(QLatin1String("empty"), QLatin1String("0000000")); + fileData6.leftFileInfo = DiffFileInfo(_("empty"), _("e69de29")); + fileData6.rightFileInfo = DiffFileInfo(_("empty"), _("0000000")); fileData6.fileOperation = FileData::DeleteFile; FileData fileData7; - fileData7.leftFileInfo = DiffFileInfo(QLatin1String("file a.txt"), QLatin1String("1234567")); - fileData7.rightFileInfo = DiffFileInfo(QLatin1String("file b.txt"), QLatin1String("9876543")); + fileData7.leftFileInfo = DiffFileInfo(_("file a.txt"), _("1234567")); + fileData7.rightFileInfo = DiffFileInfo(_("file b.txt"), _("9876543")); fileData7.fileOperation = FileData::CopyFile; ChunkData chunkData7; chunkData7.leftStartingLineNumber = 19; chunkData7.rightStartingLineNumber = 19; QList rows7; - rows7.append(RowData(TextLineData(QLatin1String("A")))); - rows7.append(RowData(TextLineData(QLatin1String("B")), - TextLineData(QLatin1String("C")))); - rows7.append(RowData(TextLineData(QLatin1String("D")))); + rows7 << RowData(_("A")); + rows7 << RowData(_("B"), _("C")); + rows7 << RowData(_("D")); chunkData7.rows = rows7; - fileData7.chunks.append(chunkData7); + fileData7.chunks << chunkData7; FileData fileData8; - fileData8.leftFileInfo = DiffFileInfo(QLatin1String("file a.txt")); - fileData8.rightFileInfo = DiffFileInfo(QLatin1String("file b.txt")); + fileData8.leftFileInfo = DiffFileInfo(_("file a.txt")); + fileData8.rightFileInfo = DiffFileInfo(_("file b.txt")); fileData8.fileOperation = FileData::RenameFile; QList fileDataList1; @@ -662,30 +641,29 @@ void DiffEditor::Internal::DiffEditorPlugin::testReadPatch_data() ////////////// - patch = QLatin1String("diff --git a/file foo.txt b/file foo.txt\n" - "index 1234567..9876543 100644\n" - "--- a/file foo.txt\n" - "+++ b/file foo.txt\n" - "@@ -50,4 +50,5 @@ void DiffEditor::ctor()\n" - " A\n" - " B\n" - " C\n" - "+\n"); - - fileData1.leftFileInfo = DiffFileInfo(QLatin1String("file foo.txt"), QLatin1String("1234567")); - fileData1.rightFileInfo = DiffFileInfo(QLatin1String("file foo.txt"), QLatin1String("9876543")); + patch = _("diff --git a/file foo.txt b/file foo.txt\n" + "index 1234567..9876543 100644\n" + "--- a/file foo.txt\n" + "+++ b/file foo.txt\n" + "@@ -50,4 +50,5 @@ void DiffEditor::ctor()\n" + " A\n" + " B\n" + " C\n" + "+\n"); + + fileData1.leftFileInfo = DiffFileInfo(_("file foo.txt"), _("1234567")); + fileData1.rightFileInfo = DiffFileInfo(_("file foo.txt"), _("9876543")); fileData1.fileOperation = FileData::ChangeFile; chunkData1.leftStartingLineNumber = 49; chunkData1.rightStartingLineNumber = 49; rows1.clear(); - rows1.append(RowData(TextLineData(QLatin1String("A")))); - rows1.append(RowData(TextLineData(QLatin1String("B")))); - rows1.append(RowData(TextLineData(QLatin1String("C")))); - rows1.append(RowData(TextLineData(TextLineData::Separator), - TextLineData(QLatin1String("")))); + rows1 << RowData(_("A")); + rows1 << RowData(_("B")); + rows1 << RowData(_("C")); + rows1 << RowData(TextLineData::Separator, _("")); chunkData1.rows = rows1; fileData1.chunks.clear(); - fileData1.chunks.append(chunkData1); + fileData1.chunks << chunkData1; QList fileDataList2; fileDataList2 << fileData1; @@ -695,27 +673,26 @@ void DiffEditor::Internal::DiffEditorPlugin::testReadPatch_data() ////////////// - patch = QLatin1String("diff --git a/file foo.txt b/file foo.txt\n" - "index 1234567..9876543 100644\n" - "--- a/file foo.txt\n" - "+++ b/file foo.txt\n" - "@@ -1,1 +1,1 @@\n" - "-ABCD\n" - "\\ No newline at end of file\n" - "+ABCD\n"); - - fileData1.leftFileInfo = DiffFileInfo(QLatin1String("file foo.txt"), QLatin1String("1234567")); - fileData1.rightFileInfo = DiffFileInfo(QLatin1String("file foo.txt"), QLatin1String("9876543")); + patch = _("diff --git a/file foo.txt b/file foo.txt\n" + "index 1234567..9876543 100644\n" + "--- a/file foo.txt\n" + "+++ b/file foo.txt\n" + "@@ -1,1 +1,1 @@\n" + "-ABCD\n" + "\\ No newline at end of file\n" + "+ABCD\n"); + + fileData1.leftFileInfo = DiffFileInfo(_("file foo.txt"), _("1234567")); + fileData1.rightFileInfo = DiffFileInfo(_("file foo.txt"), _("9876543")); fileData1.fileOperation = FileData::ChangeFile; chunkData1.leftStartingLineNumber = 0; chunkData1.rightStartingLineNumber = 0; rows1.clear(); - rows1.append(RowData(TextLineData(QLatin1String("ABCD")))); - rows1.append(RowData(TextLineData(TextLineData::Separator), - TextLineData(QLatin1String("")))); + rows1 << RowData(_("ABCD")); + rows1 << RowData(TextLineData::Separator, _("")); chunkData1.rows = rows1; fileData1.chunks.clear(); - fileData1.chunks.append(chunkData1); + fileData1.chunks << chunkData1; QList fileDataList3; fileDataList3 << fileData1; -- cgit v1.2.1 From 7d3d80a6d5c054a449ac4105c8bd1b1e2d8c66b9 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 28 Jul 2014 12:15:01 +0300 Subject: DiffEditor: Add a failing test for regression Task-number: QTCREATORBUG-12665 Change-Id: I02f4a9d3444e775049e1712a1dd985b95dc874f3 Reviewed-by: Jarek Kobus --- src/plugins/diffeditor/diffeditorplugin.cpp | 50 +++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/plugins/diffeditor/diffeditorplugin.cpp b/src/plugins/diffeditor/diffeditorplugin.cpp index 3879297661..4b99681e88 100644 --- a/src/plugins/diffeditor/diffeditorplugin.cpp +++ b/src/plugins/diffeditor/diffeditorplugin.cpp @@ -699,6 +699,55 @@ void DiffEditor::Internal::DiffEditorPlugin::testReadPatch_data() QTest::newRow("Last newline added to a line without newline") << patch << fileDataList3; + + patch = _("diff --git a/difftest.txt b/difftest.txt\n" + "index 1234567..9876543 100644\n" + "--- a/difftest.txt\n" + "+++ b/difftest.txt\n" + "@@ -2,5 +2,5 @@ void func()\n" + " A\n" + " B\n" + "-C\n" + "+Z\n" + " D\n" + " \n" + "@@ -9,2 +9,4 @@ void OtherFunc()\n" + " \n" + " D\n" + "+E\n" + "+F\n" + ); + + fileData1.leftFileInfo = DiffFileInfo(_("difftest.txt"), _("1234567")); + fileData1.rightFileInfo = DiffFileInfo(_("difftest.txt"), _("9876543")); + fileData1.fileOperation = FileData::ChangeFile; + chunkData1.leftStartingLineNumber = 1; + chunkData1.rightStartingLineNumber = 1; + rows1.clear(); + rows1 << RowData(_("A")); + rows1 << RowData(_("B")); + rows1 << RowData(_("C"), _("Z")); + rows1 << RowData(_("D")); + rows1 << RowData(_("")); + chunkData1.rows = rows1; + + chunkData2.leftStartingLineNumber = 8; + chunkData2.rightStartingLineNumber = 8; + rows2.clear(); + rows2 << RowData(_("")); + rows2 << RowData(_("D")); + rows2 << RowData(TextLineData::Separator, _("E")); + rows2 << RowData(TextLineData::Separator, _("F")); + chunkData2.rows = rows2; + fileData1.chunks.clear(); + fileData1.chunks << chunkData1; + fileData1.chunks << chunkData2; + + QList fileDataList4; + fileDataList4 << fileData1; + + QTest::newRow("2 chunks - first ends with blank line") << patch + << fileDataList4; } void DiffEditor::Internal::DiffEditorPlugin::testReadPatch() @@ -726,6 +775,7 @@ void DiffEditor::Internal::DiffEditorPlugin::testReadPatch() QCOMPARE(resultChunkData.leftStartingLineNumber, origChunkData.leftStartingLineNumber); QCOMPARE(resultChunkData.rightStartingLineNumber, origChunkData.rightStartingLineNumber); QCOMPARE(resultChunkData.contextChunk, origChunkData.contextChunk); + QEXPECT_FAIL("2 chunks - first ends with blank line", "QTCREATORBUG-12665", Abort); QCOMPARE(resultChunkData.rows.count(), origChunkData.rows.count()); for (int k = 0; k < origChunkData.rows.count(); k++) { const RowData &origRowData = origChunkData.rows.at(k); -- cgit v1.2.1 From 4c7f1c5ea98fead57034826d8fe7064c55ce992f Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 28 Jul 2014 12:17:31 +0300 Subject: DiffEditor: Fix newline handling for not the last chunk Task-number: QTCREATORBUG-12665 Change-Id: I7a54fa5502d3e06c6e1ccd99dec800f80e217333 Reviewed-by: Orgad Shaneh --- src/plugins/diffeditor/diffeditorplugin.cpp | 1 - src/plugins/diffeditor/diffutils.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/diffeditor/diffeditorplugin.cpp b/src/plugins/diffeditor/diffeditorplugin.cpp index 4b99681e88..6c6346998a 100644 --- a/src/plugins/diffeditor/diffeditorplugin.cpp +++ b/src/plugins/diffeditor/diffeditorplugin.cpp @@ -775,7 +775,6 @@ void DiffEditor::Internal::DiffEditorPlugin::testReadPatch() QCOMPARE(resultChunkData.leftStartingLineNumber, origChunkData.leftStartingLineNumber); QCOMPARE(resultChunkData.rightStartingLineNumber, origChunkData.rightStartingLineNumber); QCOMPARE(resultChunkData.contextChunk, origChunkData.contextChunk); - QEXPECT_FAIL("2 chunks - first ends with blank line", "QTCREATORBUG-12665", Abort); QCOMPARE(resultChunkData.rows.count(), origChunkData.rows.count()); for (int k = 0; k < origChunkData.rows.count(); k++) { const RowData &origRowData = origChunkData.rows.at(k); diff --git a/src/plugins/diffeditor/diffutils.cpp b/src/plugins/diffeditor/diffutils.cpp index f975462c47..af787f72ff 100644 --- a/src/plugins/diffeditor/diffutils.cpp +++ b/src/plugins/diffeditor/diffutils.cpp @@ -604,7 +604,7 @@ static QList readLines(const QString &patch, } else { if (noNewLineInEqual >= 0) { removeNewLineFromLastEqual = true; - } else if (lastChunk) { + } else { if (lastEqual > lastDelete && lastEqual > lastInsert) { removeNewLineFromLastEqual = true; } else if (lastDelete > lastEqual && lastDelete > lastInsert) { -- cgit v1.2.1 From fb09f5cc01bb1d8d34abcff6a767991575376357 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 28 Jul 2014 09:53:06 +0200 Subject: QbsProjectManager: Re-retrieve project data after build. This fixes the bug that the "run" action fails if the project has not been built before (because the path to the executable is still unknown after the build due to the missing project data update). Change-Id: I953cbb85051a1de78fcb0490abf58ebc9fcec6e7 Reviewed-by: Joerg Bornemann --- src/plugins/qbsprojectmanager/qbsproject.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index 8896e3db58..4a449d6766 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -502,6 +502,8 @@ void QbsProject::cancelParsing() void QbsProject::updateAfterBuild() { + QTC_ASSERT(m_qbsProject.isValid(), return); + m_projectData = m_qbsProject.projectData(); updateBuildTargetData(); } @@ -763,7 +765,7 @@ void QbsProject::updateDeploymentInfo(const qbs::Project &project) qbs::InstallOptions installOptions; installOptions.setInstallRoot(QLatin1String("/")); foreach (const qbs::InstallableFile &f, - project.installableFilesForProject(project.projectData(), installOptions)) { + project.installableFilesForProject(m_projectData, installOptions)) { deploymentData.addFile(f.sourceFilePath(), f.targetDirectory(), f.isExecutable() ? ProjectExplorer::DeployableFile::TypeExecutable : ProjectExplorer::DeployableFile::TypeNormal); @@ -774,7 +776,7 @@ void QbsProject::updateDeploymentInfo(const qbs::Project &project) void QbsProject::updateBuildTargetData() { - updateApplicationTargets(m_qbsProject.projectData()); + updateApplicationTargets(m_projectData); updateDeploymentInfo(m_qbsProject); foreach (Target *t, targets()) t->updateDefaultRunConfigurations(); -- cgit v1.2.1 From 1fe1c6d0b409e03b0015bba7efaa0607c0cdc0cc Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Mon, 28 Jul 2014 10:07:19 +0200 Subject: C++: Tests: Remove plain-cplusplus Change-Id: Ifdf4cd5ea478c87d585c9404caf8f4be6873f692 Reviewed-by: Christian Stenger Reviewed-by: Orgad Shaneh --- .gitignore | 1 - tests/manual/manual.pro | 1 - tests/manual/plain-cplusplus/Preprocessor.cpp | 339 ----------------------- tests/manual/plain-cplusplus/Preprocessor.h | 135 --------- tests/manual/plain-cplusplus/main.cpp | 160 ----------- tests/manual/plain-cplusplus/plain-cplusplus.pro | 28 -- 6 files changed, 664 deletions(-) delete mode 100644 tests/manual/plain-cplusplus/Preprocessor.cpp delete mode 100644 tests/manual/plain-cplusplus/Preprocessor.h delete mode 100644 tests/manual/plain-cplusplus/main.cpp delete mode 100644 tests/manual/plain-cplusplus/plain-cplusplus.pro diff --git a/.gitignore b/.gitignore index 75cc619019..1faf39d51c 100644 --- a/.gitignore +++ b/.gitignore @@ -136,7 +136,6 @@ tmp/ /tests/manual/qml-ast2dot/qml-ast2dot /tests/manual/debugger/simple/libsimple_test_plugin.*dylib /tests/manual/debugger/simple/simple_test_app -/tests/manual/plain-cplusplus/plain-c++ /tests/manual/preprocessor/pp /tests/tools/cplusplus-ast2png/cplusplus-ast2png /tests/auto/aggregation/tst_aggregation diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro index 3069364b82..a495851359 100644 --- a/tests/manual/manual.pro +++ b/tests/manual/manual.pro @@ -10,7 +10,6 @@ utils unix { # Uses popen SUBDIRS += \ - plain-cplusplus \ # Profile library paths issues process \ ssh diff --git a/tests/manual/plain-cplusplus/Preprocessor.cpp b/tests/manual/plain-cplusplus/Preprocessor.cpp deleted file mode 100644 index 876f18ae9b..0000000000 --- a/tests/manual/plain-cplusplus/Preprocessor.cpp +++ /dev/null @@ -1,339 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "Preprocessor.h" -#include "Lexer.h" -#include -#include -#include - -using namespace CPlusPlus; - -std::ostream &operator << (std::ostream &out, const StringRef &s) -{ - out.write(s.text(), s.size()); - return out; -} - -struct Preprocessor::TokenBuffer -{ - std::list tokens; - const Macro *macro; - TokenBuffer *next; - - template - TokenBuffer(_Iterator firstToken, _Iterator lastToken, const Macro *macro, TokenBuffer *next) - : tokens(firstToken, lastToken), macro(macro), next(next) {} -}; - -Lexer *Preprocessor::switchLexer(Lexer *lex) -{ - Lexer *previousLexer = _lexer; - _lexer = lex; - return previousLexer; -} - -StringRef Preprocessor::switchSource(const StringRef &source) -{ - StringRef previousSource = _source; - _source = source; - return previousSource; -} - -const Preprocessor::Macro *Preprocessor::resolveMacro(const StringRef &name) const -{ - std::map::const_iterator it = macros.find(name); - if (it != macros.end()) { - const Macro *m = &it->second; - for (TokenBuffer *r = _tokenBuffer; r; r = r->next) { - if (r->macro == m) - return 0; - } - return m; - } - - return 0; -} - -void Preprocessor::collectActualArguments(Token *tk, std::vector > *actuals) -{ - lex(tk); - - assert(tk->is(T_LPAREN)); - - lex(tk); - - std::vector tokens; - scanActualArgument(tk, &tokens); - - actuals->push_back(tokens); - - while (tk->is(T_COMMA)) { - lex(tk); - - std::vector tokens; - scanActualArgument(tk, &tokens); - actuals->push_back(tokens); - } - - assert(tk->is(T_RPAREN)); - lex(tk); -} - -void Preprocessor::scanActualArgument(Token *tk, std::vector *tokens) -{ - int count = 0; - - while (tk->isNot(T_EOF_SYMBOL)) { - if (tk->is(T_LPAREN)) { - ++count; - } else if (tk->is(T_RPAREN)) { - if (! count) - break; - - --count; - } else if (! count && tk->is(T_COMMA)) { - break; - } - - tokens->push_back(*tk); - lex(tk); - } -} - -void Preprocessor::lex(Token *tk) -{ -_Lagain: - if (_tokenBuffer) { - if (_tokenBuffer->tokens.empty()) { - TokenBuffer *r = _tokenBuffer; - _tokenBuffer = _tokenBuffer->next; - delete r; - goto _Lagain; - } - *tk = _tokenBuffer->tokens.front(); - _tokenBuffer->tokens.pop_front(); - } else { - _lexer->scan(tk); - } - -_Lclassify: - if (! inPreprocessorDirective) { - if (tk->newline() && tk->is(T_POUND)) { - handlePreprocessorDirective(tk); - goto _Lclassify; - - } else if (tk->is(T_IDENTIFIER)) { - const StringRef id = asStringRef(*tk); - - if (const Macro *macro = resolveMacro(id)) { - std::vector body = macro->body; - - if (macro->isFunctionLike) { - std::vector > actuals; - collectActualArguments(tk, &actuals); - - std::vector expanded; - for (size_t i = 0; i < body.size(); ++i) { - const Token &token = body[i]; - - if (token.isNot(T_IDENTIFIER)) { - expanded.push_back(token); - } else { - const StringRef id = asStringRef(token); - size_t j = 0; - for (; j < macro->formals.size(); ++j) { - if (macro->formals[j] == id) { - expanded.insert(expanded.end(), actuals[j].begin(), actuals[j].end()); - break; - } - } - - if (j == macro->formals.size()) - expanded.push_back(token); - } - } - - const Token currentTokenBuffer[] = { *tk }; - _tokenBuffer = new TokenBuffer(currentTokenBuffer, currentTokenBuffer + 1, - /*macro */ 0, _tokenBuffer); - - body = expanded; - } - - _tokenBuffer = new TokenBuffer(body.begin(), body.end(), - macro, _tokenBuffer); - goto _Lagain; - } - } - } -} - -void Preprocessor::handlePreprocessorDirective(Token *tk) -{ - inPreprocessorDirective = true; - - lex(tk); // scan the directive - - if (tk->newline() && ! tk->joined()) - return; // nothing to do. - - const StringRef ppDefine("define", 6); - - if (tk->is(T_IDENTIFIER)) { - const StringRef directive = asStringRef(*tk); - - if (directive == ppDefine) - handleDefineDirective(tk); - else - skipPreprocesorDirective(tk); - } - - inPreprocessorDirective = false; -} - -bool Preprocessor::isValidToken(const Token &tk) const -{ - if (tk.isNot(T_EOF_SYMBOL) && (! tk.newline() || tk.joined())) - return true; - - return false; -} - -void Preprocessor::handleDefineDirective(Token *tk) -{ - lex(tk); - - if (tk->is(T_IDENTIFIER)) { - const StringRef macroName = asStringRef(*tk); - Macro macro; - - lex(tk); - - if (isValidToken(*tk) && tk->is(T_LPAREN) && ! tk->whitespace()) { - macro.isFunctionLike = true; - - lex(tk); // skip `(' - - if (isValidToken(*tk) && tk->is(T_IDENTIFIER)) { - macro.formals.push_back(asStringRef(*tk)); - - lex(tk); - - while (isValidToken(*tk) && tk->is(T_COMMA)) { - lex(tk); - - if (isValidToken(*tk) && tk->is(T_IDENTIFIER)) { - macro.formals.push_back(asStringRef(*tk)); - lex(tk); - } - } - } - - if (isValidToken(*tk) && tk->is(T_RPAREN)) - lex(tk); // skip `)' - } - - while (isValidToken(*tk)) { - macro.body.push_back(*tk); - lex(tk); - } - - macros.insert(std::make_pair(macroName, macro)); - } else { - skipPreprocesorDirective(tk); - } -} - -void Preprocessor::skipPreprocesorDirective(Token *tk) -{ - do { - lex(tk); - } while (isValidToken(*tk)); -} - -StringRef Preprocessor::asStringRef(const Token &tk) const -{ return StringRef(_source.begin() + tk.bytesBegin(), tk.bytes()); } - -Preprocessor::Preprocessor(std::ostream &out) - : out(out), _lexer(0), inPreprocessorDirective(false) -{ } - -void Preprocessor::operator()(const char *source, unsigned size, const StringRef ¤tFileName) -{ - _currentFileName = currentFileName; - run(source, size); -} - -void Preprocessor::run(const char *source, unsigned size) -{ - _tokenBuffer = 0; - - const StringRef previousSource = switchSource(StringRef(source, size)); - Lexer thisLexer(source, source + size); - thisLexer.setScanKeywords(false); - Lexer *previousLexer = switchLexer(&thisLexer); - inPreprocessorDirective = false; - - Token tk; - unsigned lineno = 0; - do { - lex(&tk); - - if (lineno != tk.lineno) { - if (lineno > tk.lineno || tk.lineno - lineno > 3) { - out << std::endl << "#line " << tk.lineno << " \"" << _currentFileName << "\"" << std::endl; - } else { - for (unsigned i = lineno; i < tk.lineno; ++i) - out << std::endl; - } - - lineno = tk.lineno; - - } else { - if (tk.newline()) - out << std::endl; - - if (tk.whitespace()) - out << ' '; - } - - out << asStringRef(tk); - lineno = tk.lineno; - } while (tk.isNot(T_EOF_SYMBOL)); - - out << std::endl; - - switchLexer(previousLexer); - switchSource(previousSource); -} - - - - diff --git a/tests/manual/plain-cplusplus/Preprocessor.h b/tests/manual/plain-cplusplus/Preprocessor.h deleted file mode 100644 index a30bd7751d..0000000000 --- a/tests/manual/plain-cplusplus/Preprocessor.h +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#ifndef CPLUSPLUS_PREPROCESSOR_H -#define CPLUSPLUS_PREPROCESSOR_H - -#include -#include -#include -#include -#include - -namespace CPlusPlus { - -class Lexer; -class Token; - -class StringRef -{ - const char *_text; - unsigned _size; - -public: - typedef const char *iterator; - typedef const char *const_iterator; - - StringRef() - : _text(0), _size(0) {} - - StringRef(const char *text, unsigned size) - : _text(text), _size(size) {} - - StringRef(const char *text) - : _text(text), _size(std::strlen(text)) {} - - inline const char *text() const { return _text; } - inline unsigned size() const { return _size; } - - inline const_iterator begin() const { return _text; } - inline const_iterator end() const { return _text + _size; } - - bool operator == (const StringRef &other) const - { - if (_size == other._size) - return _text == other._text || ! std::strncmp(_text, other._text, _size); - - return false; - } - - bool operator != (const StringRef &other) const - { return ! operator == (other); } - - bool operator < (const StringRef &other) const - { return std::lexicographical_compare(begin(), end(), other.begin(), other.end()); } -}; - -class CPLUSPLUS_EXPORT Preprocessor -{ -public: - Preprocessor(std::ostream &out); - - void operator()(const char *source, unsigned size, const StringRef ¤tFileName); - -private: - struct Macro - { - Macro(): isFunctionLike(false), isVariadic(false) {} - - std::vector formals; - std::vector body; - bool isFunctionLike: 1; - bool isVariadic: 1; - }; - - void run(const char *source, unsigned size); - - Lexer *switchLexer(Lexer *lex); - StringRef switchSource(const StringRef &source); - - const Macro *resolveMacro(const StringRef &name) const; - - StringRef asStringRef(const Token &tk) const; - void lex(Token *tk); - bool isValidToken(const Token &tk) const; - - void handlePreprocessorDirective(Token *tk); - void handleDefineDirective(Token *tk); - void skipPreprocesorDirective(Token *tk); - - void collectActualArguments(Token *tk, std::vector > *actuals); - void scanActualArgument(Token *tk, std::vector *tokens); - -private: - struct TokenBuffer; - - std::ostream &out; - StringRef _currentFileName; - Lexer *_lexer; - StringRef _source; - TokenBuffer *_tokenBuffer; - bool inPreprocessorDirective: 1; - std::map macros; -}; - -} // end of namespace CPlusPlus - -CPLUSPLUS_EXPORT std::ostream &operator << (std::ostream &out, const CPlusPlus::StringRef &s); - -#endif // CPLUSPLUS_PREPROCESSOR_H - diff --git a/tests/manual/plain-cplusplus/main.cpp b/tests/manual/plain-cplusplus/main.cpp deleted file mode 100644 index 3fb94be60b..0000000000 --- a/tests/manual/plain-cplusplus/main.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "Preprocessor.h" -#include - -#include -#include -#include - -using namespace CPlusPlus; - -enum { BLOCK_SIZE = 4 * 1024}; - -void parse(const char *fileName, const char *source, unsigned size); -int runWithSystemPreprocessor(int argc, char *argv[]); -int runWithNewPreprocessor(int argc, char *argv[]); - -struct V: public ASTVisitor -{ - V(TranslationUnit *unit) - : ASTVisitor(unit) {} - - virtual bool visit(FunctionDeclaratorAST *ast) - { - if (ast->as_cpp_initializer) { - if (! (ast->symbol && ast->symbol->enclosingScope())) - ; //translationUnit()->warning(ast->firstToken(), "resolved as function declaration"); - else if (ast->symbol->enclosingScope()->isNamespace() || ast->symbol->enclosingScope()->isTemplate()) - ; //translationUnit()->warning(ast->firstToken(), "resolved as function declaration"); - else if (ast->symbol->enclosingScope()->isBlock()) - ; //translationUnit()->warning(ast->firstToken(), "resolved as C++ initializer"); - else - translationUnit()->warning(ast->firstToken(), "ambiguous function declarator or C++ intializer"); - } - return true; - } - - virtual bool visit(ExpressionOrDeclarationStatementAST *ast) - { - translationUnit()->warning(ast->firstToken(), "ambiguous expression or declaration statement"); - return true; - } -}; - -int main(int argc, char *argv[]) -{ - if (getenv("CPLUSPLUS_WITH_NEW_PREPROCESSOR")) - return runWithNewPreprocessor(argc, argv); - - return runWithSystemPreprocessor(argc, argv); -} - -int runWithSystemPreprocessor(int argc, char *argv[]) -{ - std::string cmdline; - cmdline += "gcc -E -xc++ -U__BLOCKS__ -D__restrict= -D__restrict__= -D__extension__= -D__imag__= -D__real__= -D__complex__= -D_Complex= -D__signed=signed"; - - for (int i = 1; i < argc; ++i) { - cmdline += ' '; - cmdline += argv[i]; - } - - char block[BLOCK_SIZE]; - - std::string preprocessedCode; - - if (FILE *fp = popen(cmdline.c_str(), "r")) { - while (size_t sz = fread(block, 1, BLOCK_SIZE, fp)) - preprocessedCode.append(block, sz); - - pclose(fp); - - } else { - fprintf(stderr, "c++: No such file or directory\n"); - return EXIT_FAILURE; - } - - parse("", preprocessedCode.c_str(), preprocessedCode.size()); - return EXIT_SUCCESS; -} - -int runWithNewPreprocessor(int argc, char *argv[]) -{ - if (argc == 1) { - fprintf(stderr, "c++: No such file or directory\n"); - return EXIT_FAILURE; - } - - char block[BLOCK_SIZE]; - - std::string source; - - if (FILE *fp = fopen(argv[1], "r")) { - while (size_t sz = fread(block, 1, BLOCK_SIZE, fp)) - source.append(block, sz); - - fclose(fp); - - } else { - fprintf(stderr, "c++: No such file or directory\n"); - return EXIT_FAILURE; - } - - std::ostringstream out; - Preprocessor pp(out); - pp(source.c_str(), source.size(), StringRef(argv[1])); - - const std::string preprocessedCode = out.str(); - parse(argv[1], preprocessedCode.c_str(), preprocessedCode.size()); - return EXIT_SUCCESS; -} - -void parse(const char *fileName, const char *source, unsigned size) -{ - Control control; - - LanguageFeatures features; - features.cxx11Enabled = true; - - TranslationUnit unit(&control, control.stringLiteral(fileName)); - unit.setSource(source, size); - unit.setLanguageFeatures(features); - unit.parse(); - -#if 1 - Namespace *globalNamespace = control.newNamespace(0); - Bind bind(&unit); - bind(unit.ast()->asTranslationUnit(), globalNamespace); - - V v(&unit); - v.accept(unit.ast()); -#endif -} diff --git a/tests/manual/plain-cplusplus/plain-cplusplus.pro b/tests/manual/plain-cplusplus/plain-cplusplus.pro deleted file mode 100644 index 3272942d25..0000000000 --- a/tests/manual/plain-cplusplus/plain-cplusplus.pro +++ /dev/null @@ -1,28 +0,0 @@ -QT -= core gui -greaterThan(QT_MAJOR_VERSION, 4):QT += widgets -TARGET = plain-c++ -DEFINES += CPLUSPLUS_WITHOUT_QT - -macx { - CONFIG -= app_bundle - release:LIBS += -Wl,-exported_symbol -Wl,_main -} - -include(../../../src/libs/3rdparty/cplusplus/cplusplus.pri) -INCLUDEPATH += ../../../src/libs/3rdparty/cplusplus - -# Input -HEADERS += Preprocessor.h -SOURCES += Preprocessor.cpp -SOURCES += main.cpp - -unix { - debug:OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared - release:OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared - - debug:MOC_DIR = $${OUT_PWD}/.moc/debug-shared - release:MOC_DIR = $${OUT_PWD}/.moc/release-shared - - RCC_DIR = $${OUT_PWD}/.rcc/ - UI_DIR = $${OUT_PWD}/.uic/ -} -- cgit v1.2.1 From aadc3804479bf8b65feb7eb6035a0305bc28edac Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 28 Jul 2014 13:56:35 +0300 Subject: BareMetal: Unviolate string freeze Use a similar message from Core Change-Id: Iccdcad0308cb7ac1b674522bce57124e3f0e9086 Reviewed-by: hjk Reviewed-by: Tim Sander --- src/plugins/baremetal/baremetalruncontrolfactory.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/baremetal/baremetalruncontrolfactory.cpp b/src/plugins/baremetal/baremetalruncontrolfactory.cpp index 47261b2fd0..1e2e98dbfe 100644 --- a/src/plugins/baremetal/baremetalruncontrolfactory.cpp +++ b/src/plugins/baremetal/baremetalruncontrolfactory.cpp @@ -47,6 +47,8 @@ #include #include +#include + using namespace Analyzer; using namespace Debugger; using namespace ProjectExplorer; @@ -135,7 +137,9 @@ RunControl *BareMetalRunControlFactory::create(RunConfiguration *runConfiguratio } DebuggerStartParameters sp = startParameters(rc); if (!QFile::exists(sp.executable)) { - *errorMessage = tr("Could not find executable"); + *errorMessage = QApplication::translate("Core::Internal::ExecuteFilter", + "Could not find executable for \"%1\".") + .arg(sp.executable); return 0; } return DebuggerPlugin::createDebugger(sp,runConfiguration,errorMessage); -- cgit v1.2.1 From 9b89379745a6590ce5f901397e86ea98d2aa7c95 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 22 Jul 2014 16:33:43 +0200 Subject: Squish: Revive WELP01 for Squish 5.1.1+ Change-Id: I1d1bc9334fe6c0fc1187b9bcde27d0b4ed3081b4 Reviewed-by: Robert Loehning --- tests/system/shared/suites_qtta.py | 10 +- tests/system/shared/utils.py | 6 +- tests/system/suite_WELP/tst_WELP01/test.py | 157 ++++++++++++--------- .../suite_general/tst_session_handling/test.py | 8 +- 4 files changed, 106 insertions(+), 75 deletions(-) diff --git a/tests/system/shared/suites_qtta.py b/tests/system/shared/suites_qtta.py index 01ed84a0da..8dce154b81 100755 --- a/tests/system/shared/suites_qtta.py +++ b/tests/system/shared/suites_qtta.py @@ -88,6 +88,10 @@ def checkIfObjectItemExists(object, item, timeout = 3000): def getQmlItem(type, container, clip, text=""): if (container.startswith(":")): container = "'%s'" % container - clip = ("%s" % __builtin__.bool(clip)).lower() - return ("{clip='%s' container=%s enabled='true' %s type='%s' unnamed='1' visible='true'}" - % (clip, container, text, type)) \ No newline at end of file + if clip != None: + clip = ("%s" % __builtin__.bool(clip)).lower() + return ("{clip='%s' container=%s enabled='true' %s type='%s' unnamed='1' visible='true'}" + % (clip, container, text, type)) + else: + return ("{container=%s enabled='true' %s type='%s' unnamed='1' visible='true'}" + % (container, text, type)) diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index c3177280a3..b9e35782ec 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -540,7 +540,7 @@ def setAlwaysStartFullHelp(): waitForObjectItem(":Options_QListView", "Help") clickItem(":Options_QListView", "Help", 5, 5, 0, Qt.LeftButton) clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "General") - selectFromCombo(":Startup.contextHelpComboBox_QComboBox", "Always Start Full Help") + selectFromCombo(":Startup.contextHelpComboBox_QComboBox", "Always Show in Help Mode") clickButton(waitForObject(":Options.OK_QPushButton")) def removePackagingDirectory(projectPath): @@ -674,3 +674,7 @@ def getHelpTitle(): return str(hv.title) except: return str(hv.documentTitle) + +def canTestEmbeddedQtQuick(): + return (squishinfo.major * 0x10000 + squishinfo.minor * 0x100 + + squishinfo.patch) > 0x050100 diff --git a/tests/system/suite_WELP/tst_WELP01/test.py b/tests/system/suite_WELP/tst_WELP01/test.py index 708d6b14a6..e5148e4f6b 100755 --- a/tests/system/suite_WELP/tst_WELP01/test.py +++ b/tests/system/suite_WELP/tst_WELP01/test.py @@ -30,91 +30,118 @@ source("../../shared/qtcreator.py") source("../../shared/suites_qtta.py") -webPageContentLoadedValue = 0 -gettingStartedText = getQmlItem("Text", ":Qt Creator_QDeclarativeView", False, - "text='Getting Started'") - -# wait until help gets loaded -def webPageContentLoaded(*args): - global webPageContentLoadedValue - objectClass = str(args[0].metaObject().className()) - if objectClass in ("QWebPage", "Help::Internal::HelpViewer"): - webPageContentLoadedValue += 1 +gettingStartedText = getQmlItem("Button", ":WelcomePage.scrollView_ScrollView", False, + "text='Get Started Now' id='gettingStartedButton'") def clickItemVerifyHelpCombo(qmlItem, expectedHelpComboRegex, testDetails): global gettingStartedText - webPageContentLoadedValue = 0 mouseClick(waitForObject(qmlItem), 5, 5, 0, Qt.LeftButton) - waitFor("webPageContentLoadedValue == 4", 5000) - foundText = str(waitForObject(":Qt Creator_HelpSelector_QComboBox").currentText) - if not test.verify(re.match(expectedHelpComboRegex, foundText), testDetails): - test.log("Found %s" % foundText) + helpCombo = waitForObject(":Qt Creator_HelpSelector_QComboBox") + if not test.verify(waitFor('re.match(expectedHelpComboRegex, str(helpCombo.currentText))', + 5000), testDetails): + test.log("Found %s" % str(helpCombo.currentText)) # select "Welcome" page from left toolbar again switchViewTo(ViewConstants.WELCOME) test.verify(checkIfObjectExists(gettingStartedText), - "Verifying: Getting Started topic is being displayed.") + "Verifying: Get Started Now button is being displayed.") + +def waitForButtonsState(projectsChecked, examplesChecked, tutorialsChecked, timeout=5000): + projButton = waitForObject(getQmlItem("Button", ":WelcomePage.scrollView_ScrollView", False, + "text='Projects'")) + exmpButton = waitForObject(getQmlItem("Button", ":WelcomePage.scrollView_ScrollView", False, + "text='Examples'")) + tutoButton = waitForObject(getQmlItem("Button", ":WelcomePage.scrollView_ScrollView", False, + "text='Tutorials'")) + return waitFor('projButton.checked == projectsChecked ' + 'and exmpButton.checked == examplesChecked ' + 'and tutoButton.checked == tutorialsChecked', timeout) def main(): - test.log("Welcome mode is not scriptable at the moment") - return - global webPageContentLoadedValue, gettingStartedText + if isQt4Build or not canTestEmbeddedQtQuick(): + test.log("Welcome mode is not available or not scriptable with this Squish version") + return + global gettingStartedText # open Qt Creator startApplication("qtcreator" + SettingsPath) if not startedWithoutPluginError(): return - installLazySignalHandler(":QWebPage","loadFinished(bool)", "webPageContentLoaded") - installLazySignalHandler(":Qt Creator_Help::Internal::HelpViewer", "loadFinished(bool)", - "webPageContentLoaded") + setAlwaysStartFullHelp() addCurrentCreatorDocumentation() - if not test.verify(checkIfObjectExists(gettingStartedText), - "Verifying: Qt Creator displays Welcome Page with Getting Started."): - mouseClick(waitForObject(getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False, - "text='Getting Started'")), 5, 5, 0, Qt.LeftButton) - qmlItem = getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False, "text='User Guide'") + + buttonsAndState = {'Projects':True, 'Examples':False, 'Tutorials':False, 'New Project':False, + 'Open Project':False} + for button, state in buttonsAndState.items(): + qmlItem = getQmlItem("Button", ":WelcomePage.scrollView_ScrollView", False, + "text='%s'" % button) + if test.verify(checkIfObjectExists(qmlItem), + "Verifying whether '%s' button is shown." % button): + buttonObj = findObject(qmlItem) + test.compare(buttonObj.checked, state, "Verifying whether '%s' button is checked." + % button) + + test.verify(checkIfObjectExists(gettingStartedText), + "Verifying: Qt Creator displays Welcome Page with 'Get Started Now' button.") expectedText = "(QtCreator : Qt Creator Manual)|(Qt Creator Manual [|] QtCreator)" testDetails = "Verifying: Help with Creator Documentation is being opened." - # select "User Guide" topic - clickItemVerifyHelpCombo(qmlItem, expectedText, testDetails) - # check "Online Community" link - test.verify(checkIfObjectExists(getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False, - "text='Online Community'")), - "Verifying: Link to Qt forums exists.") - test.verify(checkIfObjectExists(getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False, - "text='Blogs'")), - "Verifying: Link to Planet Qt exists.") - qmlItem = getQmlItem("Text", ":Qt Creator_QDeclarativeView", False, "text='IDE Overview'") - expectedText = "(QtCreator : IDE Overview)|(IDE Overview [|] QtCreator)" - testDetails = "Verifying: Help with IDE Overview topic is being opened." - # select "IDE Overview" - clickItemVerifyHelpCombo(qmlItem, expectedText, testDetails) - qmlItem = getQmlItem("Text", ":Qt Creator_QDeclarativeView", False, "text='User Interface'") - expectedText = "(QtCreator : User Interface)|(User Interface [|]) QtCreator" - testDetails = "Verifying: Help with User Interface topic is being opened." - # select "User interface" - clickItemVerifyHelpCombo(qmlItem, expectedText, testDetails) - # select "Building and Running an Example Application" - webPageContentLoadedValue = 0 - mouseClick(waitForObject(getQmlItem("Text", ":Qt Creator_QDeclarativeView", False, - "text='Building and Running an Example Application'")), - 5, 5, 0, Qt.LeftButton) - waitFor("webPageContentLoadedValue == 4", 5000) - checkPattern = ("(QtCreator : Building and Running an Example( Application)?)" - "|(Building and Running an Example( Application)? [|] QtCreator)") - checkText = str(waitForObject(":Qt Creator_HelpSelector_QComboBox").currentText) - if not test.verify(re.search(checkPattern, checkText), - "Verifying: Building and Running an Example is opened."): - test.fail("Pattern does not match: '%s', text found in QComboBox is: " - "'%s'" % (checkPattern, checkText)) + + clickItemVerifyHelpCombo(gettingStartedText, expectedText, testDetails) + textUrls = {'Online Community':'http://qt-project.org/forums', + 'Blogs':'http://planet.qt-project.org', + 'Qt Account':'https://login.qt.digia.com/qtaccount', + 'Qt Cloud Services':'https://developer.qtcloudservices.com', + 'User Guide':'qthelp://org.qt-project.qtcreator/doc/index.html' + } + for text, url in textUrls.items(): + qmlItem = getQmlItem("LinkedText", ":WelcomePage.scrollView_ScrollView", False, + "text='%s'" % text) + if test.verify(checkIfObjectExists(qmlItem), + "Verifying: Link to %s exists." % text): + itemObj = findObject(qmlItem) + # some URLs might have varying parameters - limiting them to URL without a query + if url.startswith("qthelp"): + relevantUrlPart = str(itemObj.parent.openHelpUrl).split("?")[0] + else: + relevantUrlPart = str(itemObj.parent.openUrl).split("?")[0] + test.compare(relevantUrlPart, url, "Verifying link.") + + mouseClick(gettingStartedText, 5, 5, 0, Qt.LeftButton) + qcManualQModelIndexStr = getQModelIndexStr("text~='Qt Creator Manual [0-9.]+'", + ":Qt Creator_QHelpContentWidget") + if str(waitForObject(":Qt Creator_HelpSelector_QComboBox").currentText) == "(Untitled)": + mouseClick(qcManualQModelIndexStr, 5, 5, 0, Qt.LeftButton) + test.warning("Clicking 'Get Started Now' the second time showed blank page (Untitled)") + # select "Welcome" page from left toolbar again switchViewTo(ViewConstants.WELCOME) test.verify(checkIfObjectExists(gettingStartedText), "Verifying: Getting Started topic is being displayed.") - # select "Start Developing" - mouseClick(waitForObject(getQmlItem("Text", ":Qt Creator_QDeclarativeView", False, - "text='Start Developing'")), 5, 5, 0, Qt.LeftButton) - test.verify(checkIfObjectExists(getQmlItem("Text", ":Qt Creator_QDeclarativeView", False, - "text='Tutorials'")), - "Verifying: Tutorials are opened in Welcome Page.") + # select Examples and roughly check them + mouseClick(waitForObject(getQmlItem("Button", ":WelcomePage.scrollView_ScrollView", False, + "text='Examples'")), 5, 5, 0, Qt.LeftButton) + waitForButtonsState(False, True, False) + expect = (("Rectangle", "id='rectangle1' radius='0'", "examples rectangle"), + ("TextField", "id='lineEdit' placeholderText='Search in Examples...'", + "examples search line edit"), + ("ComboBox", "id='comboBox'", "Qt version combo box"), + ("Delegate", "id='delegate' radius='0' caption~='.*Example'", "at least one example") + ) + for (qType, prop, info) in expect: + test.verify(checkIfObjectExists(getQmlItem(qType, ":WelcomePage.scrollView_ScrollView", + None, prop)), + "Verifying whether %s is shown" % info) + # select Tutorials and roughly check them + mouseClick(waitForObject(getQmlItem("Button", ":WelcomePage.scrollView_ScrollView", False, + "text='Tutorials'")), 5, 5, 0, Qt.LeftButton) + waitForButtonsState(False, False, True) + expect = (("Rectangle", "id='rectangle1' radius='0'", "tutorials rectangle"), + ("TextField", "id='lineEdit' placeholderText='Search in Tutorials...'", + "tutorials search line edit"), + ("Delegate", "id='delegate' radius='0' caption~='Creating.*'", "at least one tutorial") + ) + for (qType, prop, info) in expect: + test.verify(checkIfObjectExists(getQmlItem(qType, ":WelcomePage.scrollView_ScrollView", + None, prop)), + "Verifying whether %s is shown" % info) # exit Qt Creator invokeMenuItem("File", "Exit") diff --git a/tests/system/suite_general/tst_session_handling/test.py b/tests/system/suite_general/tst_session_handling/test.py index e5ef8cf410..ae65515424 100644 --- a/tests/system/suite_general/tst_session_handling/test.py +++ b/tests/system/suite_general/tst_session_handling/test.py @@ -29,10 +29,6 @@ source("../../shared/qtcreator.py") -def canTestQtQuick(): - return (squishinfo.major * 0x10000 + squishinfo.minor * 0x100 - + squishinfo.patch) > 0x050100 - def main(): projects = prepareTestExamples() if not projects: @@ -45,7 +41,7 @@ def main(): mainWindow = waitForObject(":Qt Creator_Core::Internal::MainWindow") test.verify(waitFor("sessionName in str(mainWindow.windowTitle)", 2000), "Verifying window title contains created session name.") - if not isQt4Build and canTestQtQuick(): + if not isQt4Build and canTestEmbeddedQtQuick(): checkWelcomePage(sessionName, True) for project in projects: openQmakeProject(project, Targets.DESKTOP_480_GCC) @@ -58,7 +54,7 @@ def main(): switchSession("default") test.verify(waitFor("'Qt Creator' == str(mainWindow.windowTitle)", 2000), "Verifying window title is set to default.") - if not isQt4Build and canTestQtQuick(): + if not isQt4Build and canTestEmbeddedQtQuick(): checkWelcomePage(sessionName, False) switchViewTo(ViewConstants.EDIT) checkNavigator(1, "Verifying that no more project is opened.") -- cgit v1.2.1 From 5cc17e6e4ba3502abb3e962586c6c347a10f041a Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Thu, 24 Jul 2014 15:40:54 +0200 Subject: QmlDesigner: avoid comment in comment warning on MSVC2010 Change-Id: I10c65028b730d3cbc05dac3114c64b8ba785e5c0 Reviewed-by: Thomas Hartmann --- src/plugins/qmldesigner/components/formeditor/formeditorview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp index 3780005779..5b7cdca461 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp @@ -299,7 +299,7 @@ void FormEditorView::propertiesRemoved(const QList &/*property { } -void FormEditorView::customNotification(const AbstractView */*view*/, const QString &identifier, const QList &/*nodeList*/, const QList &/*data*/) +void FormEditorView::customNotification(const AbstractView * /*view*/, const QString &identifier, const QList &/*nodeList*/, const QList &/*data*/) { if (identifier == QStringLiteral("puppet crashed")) m_dragTool->clearMoveDelay(); -- cgit v1.2.1 From 51350ef69de82cb866d8bf4d36b294fcdada1e33 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Thu, 24 Jul 2014 16:03:48 +0200 Subject: QmlDesigner: remove unnecessary qrc file Change-Id: I9bf7beacaa05e8f903c3b4315d25dd4c644b5598 Reviewed-by: Thomas Hartmann --- src/plugins/qmldesigner/components/stateseditor/stateseditor.qrc | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 src/plugins/qmldesigner/components/stateseditor/stateseditor.qrc diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditor.qrc b/src/plugins/qmldesigner/components/stateseditor/stateseditor.qrc deleted file mode 100644 index c2e935e893..0000000000 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditor.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - stateslist.qml - HorizontalScrollBar.qml - - -- cgit v1.2.1 From b663fc9539dee8dcae8b407beb25ed158c433e5c Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Mon, 28 Jul 2014 17:16:32 +0200 Subject: Fix debug to running application If there was only one kit and no selection for the last kit saved you got no process list. Change-Id: Ie4b770cdb9b92860fb8154eed9a80e6d0d64335d Reviewed-by: hjk --- src/plugins/projectexplorer/kitchooser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/kitchooser.cpp b/src/plugins/projectexplorer/kitchooser.cpp index 96fa0e0e46..34741b8840 100644 --- a/src/plugins/projectexplorer/kitchooser.cpp +++ b/src/plugins/projectexplorer/kitchooser.cpp @@ -106,7 +106,8 @@ void KitChooser::populate() const int n = m_chooser->count(); const int index = Core::ICore::settings()->value(QLatin1String(lastKitKey)).toInt(); - m_chooser->setCurrentIndex(0 <= index && index < n ? index : -1); + if (0 <= index && index < n) + m_chooser->setCurrentIndex(index); m_chooser->setEnabled(n > 1); if (n > 1) -- cgit v1.2.1 From e4189136ac342e50507b1d937f1079eaa222d1c4 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 28 Jul 2014 12:18:32 +0200 Subject: QmlDesigner.PropertyEditor: Fix bug in line edit I gave writeValueManually a proper name and added a missing check. Task-number: QTCREATORBUG-12642 Change-Id: I67b0d7754647c29ef378d6f12f023c8a4e728cd2 Reviewed-by: Tim Jenssen --- .../propertyEditorQmlSources/HelperWidgets/ColorEditor.qml | 2 +- .../propertyEditorQmlSources/HelperWidgets/LineEdit.qml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml index 13f976c3d5..37696f8eb1 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml @@ -149,7 +149,7 @@ Column { LineEdit { id: textField - hasToConvertColor: true + writeValueManually: true validator: RegExpValidator { regExp: /#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?/g diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/LineEdit.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/LineEdit.qml index 451c7d9bd8..a260f52a23 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/LineEdit.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/LineEdit.qml @@ -47,7 +47,7 @@ Controls.TextField { property bool showTranslateCheckBox: true - property bool hasToConvertColor: false + property bool writeValueManually: false property bool __dirty: false @@ -62,7 +62,7 @@ Controls.TextField { id: colorLogic backendValue: lineEdit.backendValue onValueFromBackendChanged: { - if (hasToConvertColor) { + if (writeValueManually) { lineEdit.text = convertColorToString(valueFromBackend) } else { lineEdit.text = valueFromBackend @@ -78,7 +78,7 @@ Controls.TextField { Connections { target: modelNodeBackend onSelectionToBeChanged: { - if (__dirty) { + if (__dirty && !writeValueManually) { lineEdit.backendValue.value = text } __dirty = false @@ -87,7 +87,7 @@ Controls.TextField { onEditingFinished: { - if (hasToConvertColor) + if (writeValueManually) return if (!__dirty) -- cgit v1.2.1 From 2dd9a0cc218f5bd6856c86e8b5d405c1214c9b73 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 28 Jul 2014 15:35:40 +0200 Subject: QmlDesigner.PropertyEditor: Fix selection in gradient editing Since property change signals can be emitted in any order we have to rely on selection changed signals to guarantee a valid state. I use the isInValidState which is only true after all properties have been setup correctly after a selection change for this. I added the signal selectionChanged for this. Task-number: QTCREATORBUG-12642 Task-number: QTCREATORBUG-12506 Change-Id: Idf3bbe8236ece541ca267efb1bd68e0737c99716 Reviewed-by: Tim Jenssen --- .../HelperWidgets/ColorEditor.qml | 25 ++++++++++++++-------- .../propertyeditor/propertyeditorqmlbackend.cpp | 5 +++++ .../propertyeditor/propertyeditorqmlbackend.h | 1 + .../propertyeditor/propertyeditorview.cpp | 3 +++ .../propertyeditor/qmlmodelnodeproxy.cpp | 5 +++++ .../components/propertyeditor/qmlmodelnodeproxy.h | 2 ++ 6 files changed, 32 insertions(+), 9 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml index 37696f8eb1..aa4b76edfe 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml @@ -62,6 +62,7 @@ Column { id: colorEditorTimer repeat: false interval: 100 + running: false onTriggered: { if (backendendValue !== undefined) backendendValue.value = colorEditor.color @@ -69,21 +70,22 @@ Column { } onColorChanged: { - if (!gradientLine.isCompleted) + if (!gradientLine.isInValidState) return; if (supportGradient && gradientLine.hasGradient) { - gradientLine.currentColor = color textField.text = convertColorToString(color) + gradientLine.currentColor = color } - if (buttonRow.checkedIndex !== 1) + if (buttonRow.checkedIndex !== 1) { //Delay setting the color to keep ui responsive colorEditorTimer.restart() + } } GradientLine { - property bool isCompleted: false + property bool isInValidState: false visible: buttonRow.checkedIndex === 1 id: gradientLine @@ -108,20 +110,25 @@ Column { buttonRow.checkedIndex = buttonRow.initalChecked } + Connections { + target: modelNodeBackend + onSelectionToBeChanged: { + colorEditorTimer.stop() + gradientLine.isInValidState = false + } + } + Connections { target: modelNodeBackend onSelectionChanged: { if (supportGradient && gradientLine.hasGradient) { colorEditor.color = gradientLine.currentColor - } else { - colorEditor.color = colorEditor.value + gradientLine.currentColor = color } + gradientLine.isInValidState = true } } - Component.onCompleted: { - isCompleted= true - } } SectionLayout { diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp index c4969943a5..1207514ecf 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp @@ -443,6 +443,11 @@ void PropertyEditorQmlBackend::emitSelectionToBeChanged() m_backendModelNode.emitSelectionToBeChanged(); } +void PropertyEditorQmlBackend::emitSelectionChanged() +{ + m_backendModelNode.emitSelectionChanged(); +} + QUrl PropertyEditorQmlBackend::getQmlUrlForModelNode(const ModelNode &modelNode, TypeName &className) { if (modelNode.isValid()) { diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h index e79caab56a..acc7571cac 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h @@ -75,6 +75,7 @@ public: static bool checkIfUrlExists(const QUrl &url); void emitSelectionToBeChanged(); + void emitSelectionChanged(); private: void createPropertyEditorValue(const QmlObjectNode &qmlObjectNode, diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp index 46e80c9238..25eed26b02 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp @@ -347,6 +347,9 @@ void PropertyEditorView::resetView() setupQmlBackend(); + if (m_qmlBackEndForCurrentType) + m_qmlBackEndForCurrentType->emitSelectionChanged(); + m_locked = false; if (m_timerId) diff --git a/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.cpp b/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.cpp index 58e1d71e9e..a662970b59 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.cpp @@ -55,6 +55,11 @@ void QmlModelNodeProxy::emitSelectionToBeChanged() emit selectionToBeChanged(); } +void QmlModelNodeProxy::emitSelectionChanged() +{ + selectionChanged(); +} + QmlItemNode QmlModelNodeProxy::qmlItemNode() const { return m_qmlItemNode; diff --git a/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.h b/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.h index 3bdb2b84c7..06cc93ba32 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.h +++ b/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.h @@ -50,6 +50,7 @@ public: static void registerDeclarativeType(); void emitSelectionToBeChanged(); + void emitSelectionChanged(); QmlItemNode qmlItemNode() const; @@ -58,6 +59,7 @@ public: signals: void modelNodeChanged(); void selectionToBeChanged(); + void selectionChanged(); public slots: -- cgit v1.2.1 From eab8054535c4726d9390fe331bb9a6cae5f623f9 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 28 Jul 2014 16:10:03 +0200 Subject: Debugger: Weaken abi check for attaching to local process Given that we don't detect all aspects of the tool chain under all circumstances, an '==' is too strong. Change-Id: I1c07d58d824e765f9d89fb7dd3007ca716997ee0 Reviewed-by: Tobias Hunger --- src/plugins/debugger/debuggerdialogs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp index e367e2891c..f919cb7a85 100644 --- a/src/plugins/debugger/debuggerdialogs.cpp +++ b/src/plugins/debugger/debuggerdialogs.cpp @@ -117,7 +117,7 @@ bool DebuggerKitChooser::kitMatches(const ProjectExplorer::Kit *k) const return false; if (m_mode == LocalDebugging) { const ProjectExplorer::ToolChain *tc = ToolChainKitInformation::toolChain(k); - return tc && tc->targetAbi().os() == m_hostAbi.os(); + return tc && tc->targetAbi().isCompatibleWith(m_hostAbi); } return true; } -- cgit v1.2.1 From 8eac129b0f1046ec0edd4bacf5ae38f8aeb564b8 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Mon, 28 Jul 2014 14:55:44 +0200 Subject: GenericProject: Fix logic for refresh(Everything) Change-Id: I0c80797ad1af8b01ffe8b12a211aed3b06fb1892 Reviewed-by: Tobias Hunger --- src/plugins/genericprojectmanager/genericproject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index 4fe7138c83..0fbee97628 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -227,7 +227,7 @@ void GenericProject::parseProject(RefreshOptions options) void GenericProject::refresh(RefreshOptions options) { QSet oldFileList; - if (!(options & Configuration)) + if (options & Files) oldFileList = m_files.toSet(); parseProject(options); -- cgit v1.2.1 From 147ab7cc7c8f1f7533bc7eb2816c4bf3a1a47a98 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Mon, 28 Jul 2014 14:41:55 +0200 Subject: GenericProject: Also change .include on adding files Task-number: QTCREATORBUG-12727 Change-Id: I3653f505739ace39cabbb63e227302fc0e71d055 Reviewed-by: Tobias Hunger --- .../genericprojectmanager/genericproject.cpp | 40 +++++++++++++++++++--- src/plugins/genericprojectmanager/genericproject.h | 2 ++ 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index 0fbee97628..d31a31a0fe 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -140,18 +140,24 @@ static QStringList readLines(const QString &absoluteFileName) } bool GenericProject::saveRawFileList(const QStringList &rawFileList) +{ + bool result = saveRawList(rawFileList, filesFileName()); + refresh(GenericProject::Files); + return result; +} + +bool GenericProject::saveRawList(const QStringList &rawList, const QString &fileName) { // Make sure we can open the file for writing - Utils::FileSaver saver(filesFileName(), QIODevice::Text); + Utils::FileSaver saver(fileName, QIODevice::Text); if (!saver.hasError()) { QTextStream stream(saver.file()); - foreach (const QString &filePath, rawFileList) + foreach (const QString &filePath, rawList) stream << filePath << QLatin1Char('\n'); saver.setResult(&stream); } if (!saver.finalize(ICore::mainWindow())) return false; - refresh(GenericProject::Files); return true; } @@ -163,7 +169,30 @@ bool GenericProject::addFiles(const QStringList &filePaths) foreach (const QString &filePath, filePaths) newList.append(baseDir.relativeFilePath(filePath)); - return saveRawFileList(newList); + + QSet includes = projectIncludePaths().toSet(); + QSet toAdd; + + foreach (const QString &filePaths, filePaths) { + QString directory = QFileInfo(filePaths).absolutePath(); + if (!includes.contains(directory) + && !toAdd.contains(directory)) + toAdd << directory; + } + + const QDir dir(projectDirectory().toString()); + foreach (const QString &path, toAdd) { + QString relative = dir.relativeFilePath(path); + if (relative.isEmpty()) + relative = QLatin1String("."); + m_rawProjectIncludePaths.append(relative); + } + + bool result = saveRawList(newList, filesFileName()); + result &= saveRawList(m_rawProjectIncludePaths, includesFileName()); + refresh(GenericProject::Everything); + + return result; } bool GenericProject::removeFiles(const QStringList &filePaths) @@ -214,7 +243,8 @@ void GenericProject::parseProject(RefreshOptions options) } if (options & Configuration) { - m_projectIncludePaths = processEntries(readLines(includesFileName())); + m_rawProjectIncludePaths = readLines(includesFileName()); + m_projectIncludePaths = processEntries(m_rawProjectIncludePaths); // TODO: Possibly load some configuration from the project file //QSettings projectInfo(m_fileName, QSettings::IniFormat); diff --git a/src/plugins/genericprojectmanager/genericproject.h b/src/plugins/genericprojectmanager/genericproject.h index 297e41df15..9a4087b1c1 100644 --- a/src/plugins/genericprojectmanager/genericproject.h +++ b/src/plugins/genericprojectmanager/genericproject.h @@ -89,6 +89,7 @@ protected: private: bool saveRawFileList(const QStringList &rawFileList); + bool saveRawList(const QStringList &rawList, const QString &fileName); void parseProject(RefreshOptions options); QStringList processEntries(const QStringList &paths, QHash *map = 0) const; @@ -106,6 +107,7 @@ private: QStringList m_rawFileList; QStringList m_files; QHash m_rawListEntries; + QStringList m_rawProjectIncludePaths; QStringList m_projectIncludePaths; GenericProjectNode *m_rootNode; -- cgit v1.2.1 From 72f1955b128e2ab41c1a941b0adf94bac045796f Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Mon, 28 Jul 2014 14:43:43 +0200 Subject: GenericProject: Don't show externally modified dialog for addFiles Change-Id: I3321e5c51f18388b8a691193159ef7e434971835 Reviewed-by: Tobias Hunger --- src/plugins/genericprojectmanager/genericproject.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index d31a31a0fe..c3b82136e6 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -148,6 +148,7 @@ bool GenericProject::saveRawFileList(const QStringList &rawFileList) bool GenericProject::saveRawList(const QStringList &rawList, const QString &fileName) { + DocumentManager::expectFileChange(fileName); // Make sure we can open the file for writing Utils::FileSaver saver(fileName, QIODevice::Text); if (!saver.hasError()) { @@ -156,9 +157,9 @@ bool GenericProject::saveRawList(const QStringList &rawList, const QString &file stream << filePath << QLatin1Char('\n'); saver.setResult(&stream); } - if (!saver.finalize(ICore::mainWindow())) - return false; - return true; + bool result = saver.finalize(ICore::mainWindow()); + DocumentManager::unexpectFileChange(fileName); + return result; } bool GenericProject::addFiles(const QStringList &filePaths) -- cgit v1.2.1 From b46dd452d2053de97807535b6701c7bf64e7dea9 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 29 Jul 2014 09:41:45 +0200 Subject: QmlDesigner.PropertyEditor: Use DesignerScrollViewStyle I set corner to an empty item, because otherwise it looks weird if both scrollbars are visible. Change-Id: I149e2ff58f9e9f71b2bb9f435fd64388cbf5529c Reviewed-by: Tim Jenssen --- share/qtcreator/qmldesigner/common/DesignerScrollViewStyle.qml | 1 + .../qmldesigner/propertyEditorQmlSources/HelperWidgets/ScrollView.qml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/share/qtcreator/qmldesigner/common/DesignerScrollViewStyle.qml b/share/qtcreator/qmldesigner/common/DesignerScrollViewStyle.qml index 1c90f7fc4f..173eaac792 100644 --- a/share/qtcreator/qmldesigner/common/DesignerScrollViewStyle.qml +++ b/share/qtcreator/qmldesigner/common/DesignerScrollViewStyle.qml @@ -58,4 +58,5 @@ ScrollViewStyle { decrementControl: Item {} incrementControl: Item {} + corner: Item {} } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ScrollView.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ScrollView.qml index 54d68e7485..0a7ba0098a 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ScrollView.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ScrollView.qml @@ -1,6 +1,10 @@ import QtQuick 2.1 import QtQuick.Controls 1.0 as Controls +import "../../common/" Controls.ScrollView { + style: DesignerScrollViewStyle { + } + frameVisible: false } -- cgit v1.2.1 From 6537d72b1fc25b6d5627bc668f331bb4d6295f3f Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 29 Jul 2014 12:24:22 +0200 Subject: Update qbs submodule. To HEAD of the 1.3 branch. Change-Id: Ie95d869808128e83cc25851f2baf80a8788bbe87 Reviewed-by: Joerg Bornemann --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index c1767ae75e..472a0e505a 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit c1767ae75e098ae224337cc2b8bd886be54c2e86 +Subproject commit 472a0e505a78fddf5d7ce02b2c6ef8f859926b3e -- cgit v1.2.1 From 33c674615ca47b40b3603b961a554fd6b658f0e7 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 29 Jul 2014 14:20:39 +0200 Subject: Doc: fix change field name "Android target SDK" was changed to "Android build SDK" in the deploy settings. Updated the screenshot. Change-Id: Ic8c1ce4ad8610d76c0d23bc65762e5bb0aaddfdb Reviewed-by: Daniel Teske --- .../qtcreator-android-deploy-configurations.png | Bin 58932 -> 61808 bytes doc/src/android/androiddev.qdoc | 2 +- doc/src/android/deploying-android.qdoc | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/images/qtcreator-android-deploy-configurations.png b/doc/images/qtcreator-android-deploy-configurations.png index 169b5ce239..ea3f9a9505 100644 Binary files a/doc/images/qtcreator-android-deploy-configurations.png and b/doc/images/qtcreator-android-deploy-configurations.png differ diff --git a/doc/src/android/androiddev.qdoc b/doc/src/android/androiddev.qdoc index 3adc7d08e9..1a144cf468 100644 --- a/doc/src/android/androiddev.qdoc +++ b/doc/src/android/androiddev.qdoc @@ -190,7 +190,7 @@ information, see the Android documentation. In addition, debugging is supported at android-10 API level, or higher. In - the run settings for the project, in the \gui {Android target SDK} field, + the run settings for the project, in the \gui {Android build SDK} field, select android-10, or higher. For more information about Android API levels, see \l{http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels} {What is API Level?}. diff --git a/doc/src/android/deploying-android.qdoc b/doc/src/android/deploying-android.qdoc index 8261e4fb2b..94d876be9e 100644 --- a/doc/src/android/deploying-android.qdoc +++ b/doc/src/android/deploying-android.qdoc @@ -146,7 +146,7 @@ \section3 Selecting API Level - In the \gui {Android target SDK} field, you can select the API level to use + In the \gui {Android build SDK} field, you can select the API level to use for building the application. Usually, you should select the newest API level available. -- cgit v1.2.1 From 77ba7eb8b8a35230d031a8b8df0b611fab8787f3 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 29 Jul 2014 14:58:39 +0200 Subject: Doc: including Android permissions needed by Qt New check box in Android Manifest Editor. Fix the description for adding permissions from the list. Update screenshot. Change-Id: Ifc74a84be7a9df32a5cc0513e56f8fa4d504c9c5 Reviewed-by: Daniel Teske --- doc/images/qtcreator-android-manifest-editor.png | Bin 54010 -> 69470 bytes doc/src/android/deploying-android.qdoc | 5 ++++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/images/qtcreator-android-manifest-editor.png b/doc/images/qtcreator-android-manifest-editor.png index 13b206f066..31ac17eb1c 100644 Binary files a/doc/images/qtcreator-android-manifest-editor.png and b/doc/images/qtcreator-android-manifest-editor.png differ diff --git a/doc/src/android/deploying-android.qdoc b/doc/src/android/deploying-android.qdoc index 94d876be9e..a1202e5d7b 100644 --- a/doc/src/android/deploying-android.qdoc +++ b/doc/src/android/deploying-android.qdoc @@ -235,6 +235,9 @@ install the application. Android OS then grants the application access to the appropriate data and features. - To add permissions, select \gui Add and select permissions from the list. + Select the \gui {Include default permissions and features for Qt modules} + check box to add the permissions needed by Qt libraries. + + To add permissions, select them in the list, and then select \gui Add. */ -- cgit v1.2.1 From 27afbe49ea98ded7b4f8c357a44d051f26942d8b Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 28 Jul 2014 17:34:05 +0200 Subject: QmlDesigner.PropertyEditor: Select new created gradient stop Task-number: QTCREATORBUG-12507 Change-Id: I2d2bc4d478e53b5b5a0faeeda68cd95d7c85377e Reviewed-by: Tim Jenssen --- .../propertyEditorQmlSources/HelperWidgets/GradientLine.qml | 7 +++++-- .../qmldesigner/components/propertyeditor/gradientmodel.cpp | 10 +++++++--- .../qmldesigner/components/propertyeditor/gradientmodel.h | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/GradientLine.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/GradientLine.qml index 9296f27752..f6af022399 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/GradientLine.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/GradientLine.qml @@ -122,8 +122,11 @@ Item { onClicked: { var currentPosition = mouseX / colorLine.effectiveWidth - gradientModel.addStop(currentPosition, currentColor) - colorLine.select(gradientModel.count - 1) + var newIndex = gradientModel.addStop(currentPosition, currentColor) + + if (newIndex > 0) + colorLine.select(newIndex) + colorLine.invalidate() } Item { diff --git a/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.cpp b/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.cpp index f7e89dae5b..7264ac8490 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.cpp @@ -94,13 +94,13 @@ QVariant GradientModel::data(const QModelIndex &index, int role) const return QVariant(); } -void GradientModel::addStop(qreal position, const QColor &color) +int GradientModel::addStop(qreal position, const QColor &color) { if (m_lock) - return; + return -1; if (!m_itemNode.isValid() || gradientPropertyName().isEmpty()) - return; + return -1; if (m_itemNode.modelNode().hasNodeProperty(gradientPropertyName().toUtf8())) { //QmlDesigner::RewriterTransaction transaction = m_itemNode.modelNode().view()->beginRewriterTransaction(); @@ -125,7 +125,11 @@ void GradientModel::addStop(qreal position, const QColor &color) gradientNode.nodeListProperty("stops").slide(stopNodes.count() - 1, properPos); setupModel(); + + return properPos; } + + return -1; } void GradientModel::addGradient() diff --git a/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.h b/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.h index 944d295667..56b6acaf3c 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.h +++ b/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.h @@ -53,7 +53,7 @@ public: QHash roleNames() const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - Q_INVOKABLE void addStop(qreal position, const QColor &color); + Q_INVOKABLE int addStop(qreal position, const QColor &color); Q_INVOKABLE void addGradient(); Q_INVOKABLE void setColor(int index, const QColor &color); -- cgit v1.2.1 From 3f4e966664eff0b53bad8a3681cdbbc3be2aa194 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 29 Jul 2014 15:34:18 +0200 Subject: QmlDesigner.PropertyEditor: Fix tooltip property For Button the property is called tooltip and not toolTip ComboBox has no tooltip property. Task-number: QTCREATORBUG-12334 Change-Id: I19b01e171deccaa5a65ddf640c46820072048d88 Reviewed-by: Tim Jenssen --- .../componentsplugin/Controls/ButtonSpecifics.qml | 2 +- .../componentsplugin/Controls/ComboBoxSpecifics.qml | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/plugins/qmldesigner/componentsplugin/Controls/ButtonSpecifics.qml b/src/plugins/qmldesigner/componentsplugin/Controls/ButtonSpecifics.qml index df91e3c956..5f415ff0e4 100644 --- a/src/plugins/qmldesigner/componentsplugin/Controls/ButtonSpecifics.qml +++ b/src/plugins/qmldesigner/componentsplugin/Controls/ButtonSpecifics.qml @@ -129,7 +129,7 @@ Column { SecondColumnLayout { LineEdit { - backendValue: backendValues.toolTip + backendValue: backendValues.tooltip implicitWidth: 180 } ExpandingSpacer { diff --git a/src/plugins/qmldesigner/componentsplugin/Controls/ComboBoxSpecifics.qml b/src/plugins/qmldesigner/componentsplugin/Controls/ComboBoxSpecifics.qml index a9ac70a878..0fd118c000 100644 --- a/src/plugins/qmldesigner/componentsplugin/Controls/ComboBoxSpecifics.qml +++ b/src/plugins/qmldesigner/componentsplugin/Controls/ComboBoxSpecifics.qml @@ -42,21 +42,6 @@ Column { SectionLayout { - Label { - text: qsTr("Tool tip") - toolTip: qsTr("The tool tip shown for the combobox.") - } - - SecondColumnLayout { - LineEdit { - backendValue: backendValues.tooltip - implicitWidth: 180 - } - ExpandingSpacer { - - } - } - Label { text: qsTr("Focus on press") toolTip: "Determines whether the combobox gets focus if pressed." -- cgit v1.2.1 From 677746cd820ea8baa400df6ea3546888d96ec462 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Tue, 29 Jul 2014 13:32:24 +0200 Subject: Android: Warn about broken gdbs on every platform Add more indicators for a broken gdb. This also fixes a bug where the message was errounously shown on non-OS X platforms Task-number: QTCREATORBUG-12747 Change-Id: I7936e5eea58896aec382616d6e7236b8276f998d Reviewed-by: hjk --- src/plugins/android/androidsettingswidget.cpp | 102 ++++++++++++++------------ src/plugins/android/androidsettingswidget.h | 4 +- 2 files changed, 58 insertions(+), 48 deletions(-) diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp index 6db4467442..59a84b87e6 100644 --- a/src/plugins/android/androidsettingswidget.cpp +++ b/src/plugins/android/androidsettingswidget.cpp @@ -136,6 +136,9 @@ AndroidSettingsWidget::AndroidSettingsWidget(QWidget *parent) { m_ui->setupUi(this); + connect(&m_checkGdbWatcher, SIGNAL(finished()), + this, SLOT(checkGdbFinished())); + m_ui->SDKLocationPathChooser->setFileName(m_androidConfig.sdkLocation()); m_ui->SDKLocationPathChooser->setPromptDialogTitle(tr("Select Android SDK folder")); m_ui->NDKLocationPathChooser->setFileName(m_androidConfig.ndkLocation()); @@ -180,8 +183,6 @@ AndroidSettingsWidget::AndroidSettingsWidget(QWidget *parent) connect(&m_futureWatcher, SIGNAL(finished()), this, SLOT(avdAdded())); - connect(&m_checkGdbWatcher, SIGNAL(finished()), - this, SLOT(checkGdbFinished())); } AndroidSettingsWidget::~AndroidSettingsWidget() @@ -191,38 +192,47 @@ AndroidSettingsWidget::~AndroidSettingsWidget() } // NOTE: Will be run via QFuture -static QPair checkGdbForBrokenPython(const QString &path) -{ - QTime timer; - timer.start(); - QProcess proc; - proc.setProcessChannelMode(QProcess::MergedChannels); - proc.start(path); - proc.waitForStarted(); - - QByteArray output; - while (proc.waitForReadyRead(300)) { - output += proc.readAll(); - if (output.contains("(gdb)")) - break; - if (timer.elapsed() > 7 * 1000) - return qMakePair(path, false); // Took too long, abort - } +static QPair checkGdbForBrokenPython(const QStringList &paths) +{ + foreach (const QString &path, paths) { + QTime timer; + timer.start(); + QProcess proc; + proc.setProcessChannelMode(QProcess::MergedChannels); + proc.start(path); + proc.waitForStarted(); + + QByteArray output; + while (proc.waitForReadyRead(300)) { + output += proc.readAll(); + if (output.contains("(gdb)")) + break; + if (timer.elapsed() > 7 * 1000) + return qMakePair(path, true); // Took too long, abort + } - output.clear(); + output.clear(); - proc.write("python import struct\n"); - proc.write("quit\n"); - while (proc.waitForFinished(300)) { - if (timer.elapsed() > 9 * 1000) - return qMakePair(path, false); // Took too long, abort - } - proc.waitForFinished(); + proc.write("python import string\n"); + proc.write("python print(string.ascii_uppercase)\n"); + proc.write("python import struct\n"); + proc.write("quit\n"); + while (proc.waitForFinished(300)) { + if (timer.elapsed() > 9 * 1000) + return qMakePair(path, true); // Took too long, abort + } + proc.waitForFinished(); - output = proc.readAll(); + output = proc.readAll(); - bool error = output.contains("_PyObject_Free") || output.contains("_PyExc_IOError"); - return qMakePair(path, error); + bool error = output.contains("_PyObject_Free") + || output.contains("_PyExc_IOError") + || output.contains("_sysconfigdata_nd ") + || !output.contains("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + if (error) + return qMakePair(paths, error); + } + return qMakePair(paths, false); } void AndroidSettingsWidget::check(AndroidSettingsWidget::Mode mode) @@ -240,6 +250,8 @@ void AndroidSettingsWidget::check(AndroidSettingsWidget::Mode mode) Utils::FileName platformPath = m_androidConfig.ndkLocation(); Utils::FileName toolChainPath = m_androidConfig.ndkLocation(); Utils::FileName sourcesPath = m_androidConfig.ndkLocation(); + m_ui->gdbWarningIconLabel->setVisible(false); + m_ui->gdbWarningLabel->setVisible(false); if (m_androidConfig.ndkLocation().isEmpty()) { m_ndkState = NotSet; } else if (!platformPath.appendPath(QLatin1String("platforms")).toFileInfo().exists() @@ -257,22 +269,20 @@ void AndroidSettingsWidget::check(AndroidSettingsWidget::Mode mode) m_ndkCompilerCount = compilerPaths.count(); // Check for a gdb with a broken python - if (Utils::HostOsInfo::isMacHost()) { - foreach (const AndroidToolChainFactory::AndroidToolChainInformation &ati, compilerPaths) { - // we only check the arm gdbs, that's indicative enough - if (ati.architecture != ProjectExplorer::Abi::ArmArchitecture) - continue; - Utils::FileName gdbPath = AndroidConfigurations::currentConfig().gdbPath(ati.architecture, ati.version); - if (gdbPath.toFileInfo().exists()) { - m_ui->gdbWarningIconLabel->setVisible(false); - m_ui->gdbWarningLabel->setVisible(false); - m_checkGdbWatcher.setFuture(QtConcurrent::run(&checkGdbForBrokenPython, gdbPath.toString())); - m_gdbCheckPath = gdbPath.toString(); - break; - } - } + QStringList gdbPaths; + foreach (const AndroidToolChainFactory::AndroidToolChainInformation &ati, compilerPaths) { + // we only check the arm gdbs, that's indicative enough + if (ati.architecture != ProjectExplorer::Abi::ArmArchitecture) + continue; + Utils::FileName gdbPath = m_androidConfig.gdbPath(ati.architecture, ati.version); + if (gdbPath.toFileInfo().exists()) + gdbPaths << gdbPath.toString(); } + if (!gdbPaths.isEmpty()) { + m_checkGdbWatcher.setFuture(QtConcurrent::run(&checkGdbForBrokenPython, gdbPaths)); + m_gdbCheckPaths = gdbPaths; + } // See if we have qt versions for those toolchains QSet toolchainsForArch; @@ -569,8 +579,8 @@ void AndroidSettingsWidget::createKitToggled() void AndroidSettingsWidget::checkGdbFinished() { - QPair result = m_checkGdbWatcher.future().result(); - if (result.first != m_gdbCheckPath) // no longer relevant + QPair result = m_checkGdbWatcher.future().result(); + if (result.first != m_gdbCheckPaths) // no longer relevant return; m_ui->gdbWarningIconLabel->setVisible(result.second); m_ui->gdbWarningLabel->setVisible(result.second); diff --git a/src/plugins/android/androidsettingswidget.h b/src/plugins/android/androidsettingswidget.h index 2be6b1b522..8e7aaf5b89 100644 --- a/src/plugins/android/androidsettingswidget.h +++ b/src/plugins/android/androidsettingswidget.h @@ -114,8 +114,8 @@ private: AndroidConfig m_androidConfig; AvdModel m_AVDModel; QFutureWatcher m_futureWatcher; - QFutureWatcher> m_checkGdbWatcher; - QString m_gdbCheckPath; + QFutureWatcher> m_checkGdbWatcher; + QStringList m_gdbCheckPaths; }; } // namespace Internal -- cgit v1.2.1 From efbdd5297a53eb2ba77f0773d90a880bb3d9277a Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Tue, 29 Jul 2014 17:16:57 +0200 Subject: ios: fix deploy script for iossim_1_8_2 iossim_1_8_2 (the tool used to deploy to the simulator with Xcode <=5.0.x) wasen't being "qtdeployed", and had incorrect library paths. This made deploy to simulator fail on older Xcode installations. Task-number: QTCREATORBUG-12753 Change-Id: Iecae2938daa0f7180c1fa576c62dd519ac7846d5 Reviewed-by: Kai Koehne --- scripts/deployqtHelper_mac.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/deployqtHelper_mac.sh b/scripts/deployqtHelper_mac.sh index 28e3d26c23..3331e27a2e 100755 --- a/scripts/deployqtHelper_mac.sh +++ b/scripts/deployqtHelper_mac.sh @@ -44,6 +44,7 @@ macdeployqt "$1" \ "-executable=$1/Contents/Resources/sdktool" \ "-executable=$1/Contents/Resources/ios/iostool" \ "-executable=$1/Contents/Resources/ios/iossim" \ + "-executable=$1/Contents/Resources/ios/iossim_1_8_2" \ "$qmlpuppetArgument" "$qml2puppetArgument" || exit 1 # copy qt creator qt.conf -- cgit v1.2.1 From 31463402112113e7d5a3297a503b3e56f443f68d Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Mon, 28 Jul 2014 18:07:31 +0200 Subject: QmlDesigner: Get whole values for value types too. Task-number: QTCREATORBUG-12130 Change-Id: Ic43826060d9ce38aded7fc3a68dff2ea6860bfc1 Reviewed-by: Tim Jenssen --- .../qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp index b5ca681a9f..3db4add25c 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp @@ -713,6 +713,7 @@ PropertyNameList allPropertyNames(QObject *object, const PropertyName &baseName } else if (QQmlValueTypeFactory::valueType(metaProperty.userType())) { QQmlValueType *valueType = QQmlValueTypeFactory::valueType(metaProperty.userType()); valueType->setValue(metaProperty.read(object)); + propertyNameList.append(baseName + PropertyName(metaProperty.name())); propertyNameList.append(allPropertyNames(valueType, baseName + PropertyName(metaProperty.name()) + '.', inspectedObjects)); } else { propertyNameList.append(baseName + PropertyName(metaProperty.name())); -- cgit v1.2.1 From ed9261733bd752e061cfa1fb3d443a80cb4d0b4e Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 28 Jul 2014 16:01:11 +0200 Subject: Squish: Replace Qt 5.0 by Qt 5.3 Change-Id: I2fb5ea259c523fce4e71f02ca087ed93fd9a0ae1 Reviewed-by: Christian Stenger Reviewed-by: Robert Loehning --- tests/system/README | 12 ++++++++++-- .../settings/mac/QtProject/qtcreator/profiles.xml | 17 ++++++++++------- .../settings/mac/QtProject/qtcreator/qtversion.xml | 14 +++++++------- .../settings/unix/QtProject/qtcreator/profiles.xml | 17 ++++++++++------- .../settings/unix/QtProject/qtcreator/qtversion.xml | 14 +++++++------- .../settings/windows/QtProject/qtcreator/profiles.xml | 10 ++++++---- .../settings/windows/QtProject/qtcreator/qtversion.xml | 14 +++++++------- tests/system/shared/classes.py | 16 ++++++++++------ tests/system/shared/project.py | 10 +++++----- tests/system/suite_CCOM/tst_CCOM01/test.py | 2 +- tests/system/suite_CCOM/tst_CCOM02/test.py | 2 +- tests/system/suite_debugger/tst_qml_locals/test.py | 2 +- .../system/suite_qtquick/tst_qtquick_creation4/test.py | 4 ++-- 13 files changed, 77 insertions(+), 57 deletions(-) diff --git a/tests/system/README b/tests/system/README index c1c18284d9..c220aa5267 100644 --- a/tests/system/README +++ b/tests/system/README @@ -11,8 +11,8 @@ On Linux/Mac this is ~/QtSDK, and on Windows this is C:\QtSDK. After installing the QtSDK you should use the package manager of the QtSDK (SDKMaintenanceTool) to add some more packages. You'll need at least Desktop Qt versions 4.7.4, 4.8.0, Harmattan stuff (except QEmu), Maemo Toolchain, Qt Examples, Simulator, Documentation files. -Third - some of the test suites/test cases expect Qt 5.0.1 and Qt 5.2.1 installed in its default location. -On Linux/Mac this is ~/Qt5.0.1 or ~/Qt5.2.1, and on Windows this is C:\Qt\Qt5.0.1 or C:\Qt\Qt5.2.1. +Third - some of the test suites/test cases expect Qt 5.2.1 and Qt 5.3.1 installed in its default location. +On Linux/Mac this is ~/Qt5.2.1 or ~/Qt5.3.1, and on Windows this is C:\Qt\Qt5.2.1 or C:\Qt\Qt5.3.1. Fourth - you'll have to provide some additional repositories (and for the hooking into subprocesses even some more Squish bundles, see below). These additional repositories are located inside ~/QtSDK/src or C:\QtSDK\src (depending on the OS you're on). @@ -32,6 +32,14 @@ Normally it should be okay to just install them as usual and add their executabl Attention! If any of these prerequisites cannot be satisfied the tests will likely fail (or not run at all). +Prerequisites - testing on Qt4 +------------------------------ +If you want to test a Qt Creator based on Qt4, you should make sure that your build of Qt contains the change +98530cbc3a0bbb633bab96eebb535d7f92ecb1fa +Qt 4.8.7 will contain this change. +Additionally, you'll have to set the variable isQt4Build to "True" in shared/classes.py. + + Prerequisites - hooking into subprocesses ----------------------------------------- The usage of the hook-into subprocess has following prerequisites: diff --git a/tests/system/settings/mac/QtProject/qtcreator/profiles.xml b/tests/system/settings/mac/QtProject/qtcreator/profiles.xml index dacc8f46ce..ca971e6011 100644 --- a/tests/system/settings/mac/QtProject/qtcreator/profiles.xml +++ b/tests/system/settings/mac/QtProject/qtcreator/profiles.xml @@ -1,6 +1,6 @@ - + Profile.0 @@ -111,6 +111,7 @@ Profile.5 false + {2f514661-b9f7-4f83-8822-a9a9d0699600} @@ -119,13 +120,14 @@ ProjectExplorer.ToolChain.Clang:{6afe7dea-8caa-424e-b370-b7b0a34015fb} - 7 + 9 :///DESKTOP/// - {9c58fcfd-9e49-4a08-971f-a677dc9ce185} + {fc5f34fd-e703-4f4c-85ce-ea5bf5869e6a} - Desktop 501 default + Desktop 521 default false + @@ -162,13 +164,14 @@ ProjectExplorer.ToolChain.Clang:{6afe7dea-8caa-424e-b370-b7b0a34015fb} - 9 + 11 :///DESKTOP/// - {fc5f34fd-e703-4f4c-85ce-ea5bf5869e6a} + {a1e860d1-c241-4abf-80fe-cf0c9f0a43b3} - Desktop 521 default + Desktop 531 default false + diff --git a/tests/system/settings/mac/QtProject/qtcreator/qtversion.xml b/tests/system/settings/mac/QtProject/qtcreator/qtversion.xml index 9dd3b5f076..941d0cac12 100644 --- a/tests/system/settings/mac/QtProject/qtcreator/qtversion.xml +++ b/tests/system/settings/mac/QtProject/qtcreator/qtversion.xml @@ -1,6 +1,6 @@ - + QtVersion.0 @@ -55,9 +55,9 @@ QtVersion.5 - 7 - Desktop Qt 5.0.1 (SQUISH_DEFAULT_COMPILER) - ~/Qt5.0.1/5.0.1/SQUISH_DEFAULT_COMPILER/bin/qmake + 9 + Desktop Qt 5.2.1 (SQUISH_DEFAULT_COMPILER) + ~/Qt5.2.1/5.2.1/SQUISH_DEFAULT_COMPILER/bin/qmake Qt4ProjectManager.QtVersion.Desktop false @@ -65,9 +65,9 @@ QtVersion.6 - 9 - Desktop Qt 5.2.1 (SQUISH_DEFAULT_COMPILER) - ~/Qt5.2.1/5.2.1/SQUISH_DEFAULT_COMPILER/bin/qmake + 11 + Desktop Qt 5.3.1 (SQUISH_DEFAULT_COMPILER) + ~/Qt5.3.1/5.3/SQUISH_DEFAULT_COMPILER/bin/qmake Qt4ProjectManager.QtVersion.Desktop false diff --git a/tests/system/settings/unix/QtProject/qtcreator/profiles.xml b/tests/system/settings/unix/QtProject/qtcreator/profiles.xml index 2e15247fc1..b515d34047 100644 --- a/tests/system/settings/unix/QtProject/qtcreator/profiles.xml +++ b/tests/system/settings/unix/QtProject/qtcreator/profiles.xml @@ -1,6 +1,6 @@ - + Profile.0 @@ -111,6 +111,7 @@ Profile.5 false + {70e26273-2c0b-4534-bbc0-eb6ca670821a} @@ -119,13 +120,14 @@ ProjectExplorer.ToolChain.Gcc:{c3f59b87-6997-4bd8-8067-ee04dc536371} - 7 + 9 :///DESKTOP/// - {9c58fcfd-9e49-4a08-971f-a677dc9ce185} + {17ae70be-817d-4019-9337-fa7761c4b0ed} - Desktop 501 default + Desktop 521 default false + @@ -162,13 +164,14 @@ ProjectExplorer.ToolChain.Gcc:{c3f59b87-6997-4bd8-8067-ee04dc536371} - 9 + 11 :///DESKTOP/// - {17ae70be-817d-4019-9337-fa7761c4b0ed} + {e91398ba-6443-4b02-b416-782a70d9df90} - Desktop 521 default + Desktop 531 default false + diff --git a/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml b/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml index 9dd3b5f076..6ed59e9a93 100644 --- a/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml +++ b/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml @@ -1,6 +1,6 @@ - + QtVersion.0 @@ -55,9 +55,9 @@ QtVersion.5 - 7 - Desktop Qt 5.0.1 (SQUISH_DEFAULT_COMPILER) - ~/Qt5.0.1/5.0.1/SQUISH_DEFAULT_COMPILER/bin/qmake + 9 + Desktop Qt 5.2.1 (SQUISH_DEFAULT_COMPILER) + ~/Qt5.2.1/5.2.1/SQUISH_DEFAULT_COMPILER/bin/qmake Qt4ProjectManager.QtVersion.Desktop false @@ -65,9 +65,9 @@ QtVersion.6 - 9 - Desktop Qt 5.2.1 (SQUISH_DEFAULT_COMPILER) - ~/Qt5.2.1/5.2.1/SQUISH_DEFAULT_COMPILER/bin/qmake + 11 + Qt 5.3.1 (SQUISH_DEFAULT_COMPILER) + ~/Qt5.3.1/5.3/SQUISH_DEFAULT_COMPILER/bin/qmake Qt4ProjectManager.QtVersion.Desktop false diff --git a/tests/system/settings/windows/QtProject/qtcreator/profiles.xml b/tests/system/settings/windows/QtProject/qtcreator/profiles.xml index 658e518ffd..f04407b93b 100644 --- a/tests/system/settings/windows/QtProject/qtcreator/profiles.xml +++ b/tests/system/settings/windows/QtProject/qtcreator/profiles.xml @@ -1,6 +1,6 @@ - + Profile.0 @@ -111,6 +111,7 @@ Profile.5 false + {811977c9-ea95-4616-bc28-c66d1935ff65} @@ -119,13 +120,14 @@ ProjectExplorer.ToolChain.Msvc:{1186dad9-c485-4f69-b7e1-aff54c89ecb2} - 18 + 20 :///DESKTOP/// - {175f6238-a585-4e62-b2d3-d15e90296bb6} + {6a95566e-8372-4372-8286-ef73af7de191} - Desktop 501 default + Desktop 531 default false + diff --git a/tests/system/settings/windows/QtProject/qtcreator/qtversion.xml b/tests/system/settings/windows/QtProject/qtcreator/qtversion.xml index 543ca215c0..853d07393c 100644 --- a/tests/system/settings/windows/QtProject/qtcreator/qtversion.xml +++ b/tests/system/settings/windows/QtProject/qtcreator/qtversion.xml @@ -1,6 +1,6 @@ - + QtVersion.0 @@ -65,9 +65,9 @@ QtVersion.6 - 18 - Desktop Qt 5.0.1 (msvc2010) - C:/Qt/Qt5.0.1/5.0.1/msvc2010/bin/qmake.exe + 4 + Desktop Qt 5.2.1 (msvc2010) + C:/Qt/Qt5.2.1/5.2.1/msvc2010/bin/qmake.exe Qt4ProjectManager.QtVersion.Desktop false @@ -75,9 +75,9 @@ QtVersion.7 - 4 - Desktop Qt 5.2.1 (msvc2010) - C:/Qt/Qt5.2.1/5.2.1/msvc2010/bin/qmake.exe + 20 + Qt 5.3.1 (msvc2010_opengl) + C:/Qt/Qt5.3.1/5.3/msvc2010_opengl/bin/qmake.exe Qt4ProjectManager.QtVersion.Desktop false diff --git a/tests/system/shared/classes.py b/tests/system/shared/classes.py index 35061df5c0..87ffc83903 100644 --- a/tests/system/shared/classes.py +++ b/tests/system/shared/classes.py @@ -40,13 +40,13 @@ class Targets: HARMATTAN = 16 EMBEDDED_LINUX = 32 DESKTOP_480_MSVC2010 = 64 - DESKTOP_501_DEFAULT = 128 - DESKTOP_521_DEFAULT = 256 + DESKTOP_521_DEFAULT = 128 + DESKTOP_531_DEFAULT = 256 @staticmethod def desktopTargetClasses(): desktopTargets = (Targets.DESKTOP_474_GCC | Targets.DESKTOP_480_GCC - | Targets.DESKTOP_501_DEFAULT | Targets.DESKTOP_521_DEFAULT) + | Targets.DESKTOP_521_DEFAULT | Targets.DESKTOP_531_DEFAULT) if platform.system() in ('Windows', 'Microsoft'): desktopTargets |= Targets.DESKTOP_480_MSVC2010 return desktopTargets @@ -67,10 +67,10 @@ class Targets: return "Embedded Linux" elif target == Targets.DESKTOP_480_MSVC2010: return "Desktop 480 MSVC2010" - elif target == Targets.DESKTOP_501_DEFAULT: - return "Desktop 501 default" elif target == Targets.DESKTOP_521_DEFAULT: return "Desktop 521 default" + elif target == Targets.DESKTOP_531_DEFAULT: + return "Desktop 531 default" else: return None @@ -88,13 +88,17 @@ class Targets: def intToArray(targets): available = [Targets.DESKTOP_474_GCC, Targets.DESKTOP_480_GCC, Targets.SIMULATOR, Targets.MAEMO5, Targets.HARMATTAN, Targets.EMBEDDED_LINUX, Targets.DESKTOP_480_MSVC2010, - Targets.DESKTOP_501_DEFAULT, Targets.DESKTOP_521_DEFAULT] + Targets.DESKTOP_521_DEFAULT, Targets.DESKTOP_531_DEFAULT] return filter(lambda x: x & targets == x, available) @staticmethod def arrayToInt(targetArr): return reduce(operator.or_, targetArr, 0) + @staticmethod + def getDefaultKit(): + return Targets.DESKTOP_521_DEFAULT + # this class holds some constants for easier usage inside the Projects view class ProjectSettings: BUILD = 1 diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index 3e62cccb85..f94dfa445c 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -385,8 +385,8 @@ def __chooseTargets__(targets=Targets.DESKTOP_474_GCC, availableTargets=None): available = availableTargets else: # following targets depend on the build environment - added for further/later tests - available = [Targets.DESKTOP_474_GCC, Targets.DESKTOP_480_GCC, Targets.DESKTOP_501_DEFAULT, - Targets.DESKTOP_521_DEFAULT, Targets.MAEMO5, Targets.EMBEDDED_LINUX, + available = [Targets.DESKTOP_474_GCC, Targets.DESKTOP_480_GCC, Targets.DESKTOP_521_DEFAULT, + Targets.DESKTOP_531_DEFAULT, Targets.MAEMO5, Targets.EMBEDDED_LINUX, Targets.SIMULATOR, Targets.HARMATTAN] if platform.system() in ('Windows', 'Microsoft'): available.remove(Targets.EMBEDDED_LINUX) @@ -620,7 +620,7 @@ def __getSupportedPlatforms__(text, templateName, getAsStrings=False): result.append(Targets.EMBEDDED_LINUX) elif platform.system() in ('Windows', 'Microsoft'): result.append(Targets.DESKTOP_480_MSVC2010) - result.extend([Targets.DESKTOP_501_DEFAULT, Targets.DESKTOP_521_DEFAULT]) + result.extend([Targets.DESKTOP_521_DEFAULT, Targets.DESKTOP_531_DEFAULT]) if 'MeeGo/Harmattan' in supports: result.append(Targets.HARMATTAN) if 'Maemo/Fremantle' in supports: @@ -629,8 +629,8 @@ def __getSupportedPlatforms__(text, templateName, getAsStrings=False): result.append(Targets.SIMULATOR) elif 'Platform independent' in text: # MAEMO5 and HARMATTAN could be wrong here - depends on having Madde plugin enabled or not - result = [Targets.DESKTOP_474_GCC, Targets.DESKTOP_480_GCC, Targets.DESKTOP_501_DEFAULT, - Targets.DESKTOP_521_DEFAULT, Targets.MAEMO5, Targets.SIMULATOR, Targets.HARMATTAN] + result = [Targets.DESKTOP_474_GCC, Targets.DESKTOP_480_GCC, Targets.DESKTOP_521_DEFAULT, + Targets.DESKTOP_531_DEFAULT, Targets.MAEMO5, Targets.SIMULATOR, Targets.HARMATTAN] if platform.system() in ('Windows', 'Microsoft'): result.append(Targets.DESKTOP_480_MSVC2010) else: diff --git a/tests/system/suite_CCOM/tst_CCOM01/test.py b/tests/system/suite_CCOM/tst_CCOM01/test.py index e0b9016fef..f795ede512 100755 --- a/tests/system/suite_CCOM/tst_CCOM01/test.py +++ b/tests/system/suite_CCOM/tst_CCOM01/test.py @@ -44,7 +44,7 @@ def main(): return # open example project # qmlapplicationviewer of this example supports only Qt version < 5 - targets = Targets.desktopTargetClasses() ^ Targets.DESKTOP_501_DEFAULT ^ Targets.DESKTOP_521_DEFAULT + targets = Targets.desktopTargetClasses() ^ Targets.DESKTOP_521_DEFAULT ^ Targets.DESKTOP_531_DEFAULT checkedTargets = openQmakeProject(examplePath, targets) if not replaceLine("propertyanimation.Sources.main\\.cpp", "#include ", diff --git a/tests/system/suite_CCOM/tst_CCOM02/test.py b/tests/system/suite_CCOM/tst_CCOM02/test.py index 6244c58ef6..fa2023bcd0 100755 --- a/tests/system/suite_CCOM/tst_CCOM02/test.py +++ b/tests/system/suite_CCOM/tst_CCOM02/test.py @@ -44,7 +44,7 @@ def main(): if not startedWithoutPluginError(): return # open example project - targets = Targets.desktopTargetClasses() ^ Targets.DESKTOP_501_DEFAULT ^ Targets.DESKTOP_521_DEFAULT + targets = Targets.desktopTargetClasses() ^ Targets.DESKTOP_521_DEFAULT ^ Targets.DESKTOP_531_DEFAULT openQmakeProject(examplePath, targets) # create syntax error openDocument("propertyanimation.QML.qml.property-animation\\.qml") diff --git a/tests/system/suite_debugger/tst_qml_locals/test.py b/tests/system/suite_debugger/tst_qml_locals/test.py index ce74e4c8a7..b8d1c88bca 100644 --- a/tests/system/suite_debugger/tst_qml_locals/test.py +++ b/tests/system/suite_debugger/tst_qml_locals/test.py @@ -54,7 +54,7 @@ def main(): exe, target = getExecutableAndTargetFromToolTip(str(waitForObject(fancyConfButton).toolTip)) if not (test.verify(fancyRunButton.enabled and fancyDebugButton.enabled, "Verifying Run and Debug are enabled (Qt5 is available).") - and test.compare(target, Targets.getStringForTarget(Targets.DESKTOP_521_DEFAULT), + and test.compare(target, Targets.getStringForTarget(Targets.getDefaultKit()), "Verifying selected Target is Qt5.") and test.compare(exe, "QML Scene", "Verifying selected executable is QML Scene.")): earlyExit("Something went wrong opening Qml project - probably missing Qt5.") diff --git a/tests/system/suite_qtquick/tst_qtquick_creation4/test.py b/tests/system/suite_qtquick/tst_qtquick_creation4/test.py index 36b328d449..641b27da54 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation4/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation4/test.py @@ -33,8 +33,8 @@ def main(): startApplication("qtcreator" + SettingsPath) if not startedWithoutPluginError(): return - for targ, quickVer in [[Targets.DESKTOP_480_GCC, 1], [Targets.DESKTOP_501_DEFAULT, 2], - [Targets.DESKTOP_521_DEFAULT, 2]]: + for targ, quickVer in [[Targets.DESKTOP_480_GCC, 1], [Targets.DESKTOP_521_DEFAULT, 2], + [Targets.DESKTOP_531_DEFAULT, 2]]: # using a temporary directory won't mess up a potentially existing createNewQmlExtension(tempDir(), targ, quickVer) # wait for parsing to complete -- cgit v1.2.1 From 8f3bb6421b08a859088d2fbbfbf373ff25cf8372 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Mon, 28 Jul 2014 16:58:44 +0200 Subject: QmlDesigner: Fix enumerations properties Task-number: QTCREATORBUG-12741 Change-Id: I1ef1909d585732a39bbf80b90512851a10f60600 Reviewed-by: Tim Jenssen --- .../qml2puppet/instances/objectnodeinstance.cpp | 20 ++++++++++++-------- .../qml2puppet/instances/objectnodeinstance.h | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp index 3db4add25c..589c47883f 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp @@ -94,7 +94,7 @@ static bool isPropertyBlackListed(const QmlDesigner::PropertyName &propertyName) namespace QmlDesigner { namespace Internal { -QHash ObjectNodeInstance::m_enumationValueHash; +QHash ObjectNodeInstance::m_enumationValueHash; ObjectNodeInstance::ObjectNodeInstance(QObject *object) : m_object(object), @@ -1328,27 +1328,31 @@ void ObjectNodeInstance::doComponentCompleteRecursive(QObject *object, NodeInsta } } -static QHash enumationValuesFromMetaEnum(const QMetaEnum &metaEnum) +static QHash enumationValuesFromMetaEnum(const QMetaEnum &metaEnum) { - QHash enumationValues; + QHash enumationValues; for (int index = 0; index < metaEnum.keyCount(); index++) { EnumerationName enumerationName = EnumerationName(metaEnum.scope()) + "." + metaEnum.key(index); - enumationValues.insert(enumerationName, metaEnum.value(index)); + enumationValues.insert(enumerationName, QVariant::fromValue(metaEnum.value(index))); + qDebug() << __FUNCTION__ << enumerationName << metaEnum.value(index); } return enumationValues; } -static QHash collectEnumationValues(const Enumeration &enumeration) +static QHash collectEnumationValues(const Enumeration &enumeration) { - QHash enumationValues; + QHash enumationValues; EnumerationName enumerationScope = enumeration.scope(); - const QMetaObject *metaObject = QMetaType::metaObjectForType(QMetaType::type(enumerationScope.data())); + const QMetaObject *metaObject = QMetaType::metaObjectForType(QMetaType::type(enumerationScope.constData())); if (metaObject) { int enumeratorCount = metaObject->enumeratorOffset() + metaObject->enumeratorCount(); for (int index = metaObject->enumeratorOffset(); index < enumeratorCount; index++) enumationValues.unite(enumationValuesFromMetaEnum(metaObject->enumerator(index))); + } else { + enumationValues.insert(enumeration.toEnumerationName(), QVariant::fromValue(enumeration.nameToString())); } + return enumationValues; } @@ -1358,7 +1362,7 @@ QVariant ObjectNodeInstance::enumationValue(const Enumeration &enumeration) if (!m_enumationValueHash.contains(enumerationName)) m_enumationValueHash.unite(collectEnumationValues(enumeration)); - return QVariant::fromValue(m_enumationValueHash.value(enumerationName)); + return m_enumationValueHash.value(enumerationName); } ObjectNodeInstance::Pointer ObjectNodeInstance::parentInstance() const diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.h index 2d4635b372..239b774491 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.h @@ -220,7 +220,7 @@ private: qint32 m_instanceId; bool m_deleteHeldInstance; bool m_isInLayoutable; - static QHash m_enumationValueHash; + static QHash m_enumationValueHash; }; } // namespace Internal -- cgit v1.2.1 From ded24c39978e634b568605866335b9dce22179b8 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Tue, 29 Jul 2014 14:03:33 +0200 Subject: QmlDesigner: Fix d&d in navigator Check if you want to remove the same node you like to reparent. Task-number: QTCREATORBUG-12744 Change-Id: Ib098a5723faf1679217f508a73e56359850aa4bc Reviewed-by: Tim Jenssen --- .../qmldesigner/components/navigator/navigatortreemodel.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp index e967ad9e4c..a32f2504fa 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp @@ -578,10 +578,10 @@ static bool removeModelNodeFromNodeProperty(NodeAbstractProperty &parentProperty { if (parentProperty.isNodeProperty()) { - bool removeNodeInPropertySucceeded = true; + bool removeNodeInPropertySucceeded = false; ModelNode propertyNode = parentProperty.toNodeProperty().modelNode(); // Destruction of ancestors is not allowed - if (!propertyNode.isAncestorOf(modelNode)) { + if (modelNode != propertyNode && !propertyNode.isAncestorOf(modelNode)) { QApplication::setOverrideCursor(Qt::ArrowCursor); QMessageBox::StandardButton selectedButton = QMessageBox::warning(Core::ICore::dialogParent(), @@ -658,9 +658,8 @@ void NavigatorTreeModel::moveNodesInteractive(NodeAbstractProperty &parentProper if (nodeCanBeMovedToParentProperty) { reparentModelNodeToNodeProperty(parentProperty, modelNode); + slideModelNodeInList(parentProperty, modelNode, targetIndex); } - - slideModelNodeInList(parentProperty, modelNode, targetIndex); } } } catch (RewritingException &exception) { //better safe than sorry! There always might be cases where we fail @@ -708,7 +707,7 @@ void NavigatorTreeModel::handleItemLibraryItemDrop(const QMimeData *mimeData, in ItemLibraryEntry itemLibraryEntry = itemLibraryEntryFromData(mimeData->data("application/vnd.bauhaus.itemlibraryinfo")); QmlItemNode newQmlItemNode = QmlItemNode::createQmlItemNode(m_view, itemLibraryEntry, QPointF(0., 0.), targetProperty); - if (newQmlItemNode.isValid()) { + if (newQmlItemNode.isValid() && targetProperty.isNodeListProperty()) { QList newModelNodeList; newModelNodeList.append(newQmlItemNode); -- cgit v1.2.1 From 7a7690f0ece1be07ee859dabaeb583a6993af830 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 30 Jul 2014 09:52:16 +0300 Subject: Git: Parse for-each-ref output as UTF-8 Adding a branch with non-ascii chars then refreshing the branch list on Windows invalidates the branch name. Change-Id: I59d3e092c66fdcc7cea38a8451de6b5e42cd5de0 Reviewed-by: Friedemann Kleint --- src/plugins/git/gitclient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index f5d1c628fc..5e1909f061 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -1952,7 +1952,7 @@ bool GitClient::synchronousForEachRefCmd(const QString &workingDirectory, QStrin QByteArray errorText; const bool rc = fullySynchronousGit(workingDirectory, args, &outputText, &errorText, VcsBasePlugin::SuppressCommandLogging); - *output = commandOutputFromLocal8Bit(outputText); + *output = Utils::SynchronousProcess::normalizeNewlines(QString::fromUtf8(outputText)); if (!rc) msgCannotRun(args, workingDirectory, errorText, errorMessage); -- cgit v1.2.1 From 6618edd0808a2d72ddf55c3d201b97df811bf159 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 30 Jul 2014 09:21:10 +0200 Subject: Doc: fix typos in the WinRT topic Change-Id: I7d6340a48a4ce910fdbc6d5adc4605ff5ea13637 Reviewed-by: Leena Miettinen --- doc/src/winrt/creator-winrt.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/winrt/creator-winrt.qdoc b/doc/src/winrt/creator-winrt.qdoc index ba6b744010..58228be6e5 100644 --- a/doc/src/winrt/creator-winrt.qdoc +++ b/doc/src/winrt/creator-winrt.qdoc @@ -42,7 +42,7 @@ \list 1 \li Select \gui Help > \gui {About Plugins} > \gui {Device Support} > - \gui WinRT to enable the experimental Winows Runtime plugin. + \gui WinRT to enable the experimental Windows Runtime plugin. \li Restart \QC to be able to use the plugin. @@ -55,7 +55,7 @@ \li Select \gui Projects > \gui {Build & Run} > \gui {Add Kit} to add a kit for building and running applications on Windows - Runtime devices (the local computer, for now) Windows Phones, + Runtime devices (the local computer, for now), Windows Phones, or the Windows Phone emulator. \endlist -- cgit v1.2.1 From ac039f9655fb6a87f3222995794be171225f106f Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 30 Jul 2014 09:26:42 +0200 Subject: Debugger: fix typo in UI text Change-Id: If5eb80f2d92632d61797f2b1f3bb7b7a604f3cac Reviewed-by: hjk --- src/plugins/debugger/commonoptionspage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp index 7c5a18fb73..090d7eca2b 100644 --- a/src/plugins/debugger/commonoptionspage.cpp +++ b/src/plugins/debugger/commonoptionspage.cpp @@ -397,7 +397,7 @@ QWidget *LocalsAndExpressionsOptionsPage::widget() layout1->addRow(checkBoxShowQtNamespace); layout1->addItem(new QSpacerItem(10, 10)); layout1->addRow(tr("Maximum string length:"), spinBoxMaximalStringLength); - layout1->addRow(tr("Displayh string length:"), spinBoxDisplayStringLimit); + layout1->addRow(tr("Display string length:"), spinBoxDisplayStringLimit); auto lowerLayout = new QHBoxLayout; lowerLayout->addLayout(layout1); -- cgit v1.2.1 From ca23a29178d080474bffcbe1aed3c1e523a4934e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 30 Jul 2014 09:22:20 +0200 Subject: Android: Fix compilation with Qt 4. Change-Id: I2a25cbb19246526702c91b41e3e62f05f7833e87 Reviewed-by: Christian Stenger --- src/plugins/android/androidsettingswidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp index 59a84b87e6..48fe21213f 100644 --- a/src/plugins/android/androidsettingswidget.cpp +++ b/src/plugins/android/androidsettingswidget.cpp @@ -208,7 +208,7 @@ static QPair checkGdbForBrokenPython(const QStringList &paths if (output.contains("(gdb)")) break; if (timer.elapsed() > 7 * 1000) - return qMakePair(path, true); // Took too long, abort + return qMakePair(QStringList(path), true); // Took too long, abort } output.clear(); @@ -219,7 +219,7 @@ static QPair checkGdbForBrokenPython(const QStringList &paths proc.write("quit\n"); while (proc.waitForFinished(300)) { if (timer.elapsed() > 9 * 1000) - return qMakePair(path, true); // Took too long, abort + return qMakePair(QStringList(path), true); // Took too long, abort } proc.waitForFinished(); -- cgit v1.2.1 From 50540c34d3a57ae8e15d46e958ccbc8cabdee9aa Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 30 Jul 2014 10:01:48 +0200 Subject: Core: remove deleted files from qbs file These files have been removed with c3093cfff7f958087681f34afa147cbce39d5941. Change-Id: I96b1c188bda8ff55a1cd4fba69c19f076be2efdb Reviewed-by: Christian Kandeler --- src/plugins/coreplugin/coreplugin.qbs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/plugins/coreplugin/coreplugin.qbs b/src/plugins/coreplugin/coreplugin.qbs index ea6218ba16..a03dcf2331 100644 --- a/src/plugins/coreplugin/coreplugin.qbs +++ b/src/plugins/coreplugin/coreplugin.qbs @@ -174,8 +174,6 @@ QtcPlugin { name: "ProgressManager_mac" condition: qbs.targetOS.contains("osx") files: [ - "macfullscreen.h", - "macfullscreen.mm", "progressmanager/progressmanager_mac.mm", ] } -- cgit v1.2.1 From 882eb4f33571e3cacb7f0e2c6830c84ff79db212 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 28 Jul 2014 18:33:48 +0200 Subject: QmlDesigner.PropertyEditor: Fixing usability issue for color editing Task-number: QTCREATORBUG-12621 Task-number: QTCREATORBUG-12563 Change-Id: I6834633be92f2fcdf85995604490ceea14af9ef6 Reviewed-by: Tim Jenssen --- .../qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorButton.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorButton.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorButton.qml index 1e72852039..c3a6363593 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorButton.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorButton.qml @@ -252,7 +252,7 @@ Item { } onPressed: positionChanged(mouse) - onClicked: colorButton.clicked() + onReleased: colorButton.clicked() } Rectangle { anchors.fill: parent -- cgit v1.2.1 From e8f2bc1f607c58d2bcf616451b923b05575e923c Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Wed, 30 Jul 2014 11:24:22 +0200 Subject: Android: Fix wrong return values Change-Id: Ia5917387c429278cac34a8d1f7a67631d491bff2 Reviewed-by: Daniel Teske --- src/plugins/android/androidsettingswidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp index 48fe21213f..7243f99de5 100644 --- a/src/plugins/android/androidsettingswidget.cpp +++ b/src/plugins/android/androidsettingswidget.cpp @@ -208,7 +208,7 @@ static QPair checkGdbForBrokenPython(const QStringList &paths if (output.contains("(gdb)")) break; if (timer.elapsed() > 7 * 1000) - return qMakePair(QStringList(path), true); // Took too long, abort + return qMakePair(paths, true); // Took too long, abort } output.clear(); @@ -219,7 +219,7 @@ static QPair checkGdbForBrokenPython(const QStringList &paths proc.write("quit\n"); while (proc.waitForFinished(300)) { if (timer.elapsed() > 9 * 1000) - return qMakePair(QStringList(path), true); // Took too long, abort + return qMakePair(paths, true); // Took too long, abort } proc.waitForFinished(); -- cgit v1.2.1 From 616f01bc2efd18bf1ac9e1f171cce7143d9b55bd Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 30 Jul 2014 10:19:02 +0200 Subject: QmlDesigner.PropertyEditor: Do not show ExtendedFunctionButton for id Change-Id: I3ccc2e341591913d1645b3e748ee07acf7cecee7 Reviewed-by: Tim Jenssen --- .../qmldesigner/propertyEditorQmlSources/HelperWidgets/LineEdit.qml | 4 +++- .../qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/LineEdit.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/LineEdit.qml index a260f52a23..9cea91a9e5 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/LineEdit.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/LineEdit.qml @@ -51,11 +51,13 @@ Controls.TextField { property bool __dirty: false + property bool showExtendedFunctionButton: true + ExtendedFunctionButton { x: 2 y: 4 backendValue: lineEdit.backendValue - visible: lineEdit.enabled + visible: lineEdit.enabled && showExtendedFunctionButton } ColorLogic { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml index cf34062a01..693d069b40 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml @@ -77,6 +77,7 @@ Rectangle { Layout.fillWidth: true Layout.maximumWidth: 320 showTranslateCheckBox: false + showExtendedFunctionButton: false } ExpandingSpacer { -- cgit v1.2.1 From 30c02e78b0651aebb9f619ac08065d8b96a4e167 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 30 Jul 2014 10:34:37 +0200 Subject: QmlDesigner.PropertyEditor: This is not a property of PathView This is a property of ListView and GridView. Task-number: QTCREATORBUG-12507 Change-Id: Ie3f6db2f90bc8b67bcc208c709b87717f653525d Reviewed-by: Tim Jenssen --- .../QtQuick/PathViewSpecifics.qml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/PathViewSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/PathViewSpecifics.qml index 8b5454a58c..3825a17215 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/PathViewSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/PathViewSpecifics.qml @@ -208,22 +208,6 @@ Column { } } - - Label { - text: qsTr("Follows current") - toolTip: qsTr("Determines whether the highlight is managed by the view.") - } - - SecondColumnLayout { - CheckBox { - backendValue: backendValues.highlightFollowsCurrentItem - } - - ExpandingSpacer { - - } - } - } } } -- cgit v1.2.1 From 8914c4fd57da916819611b965493989d7d874720 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 28 Jul 2014 14:26:17 +0200 Subject: QmlDesigner.Rewriter: We officially support Qt Quick 2.3 Change-Id: Ib157a55910f2416fc43cc1ee40684508ed498ea0 Reviewed-by: Tim Jenssen --- src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp index 8a1ba2e664..3908507115 100644 --- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp +++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp @@ -65,7 +65,9 @@ namespace { static inline QStringList supportedVersionsList() { QStringList list; - list << QStringLiteral("1.0") << QStringLiteral("1.1") << QStringLiteral("2.0") << QStringLiteral("2.1") << QStringLiteral("2.2"); + list << QStringLiteral("1.0") << QStringLiteral("1.1") + << QStringLiteral("2.0") << QStringLiteral("2.1") + << QStringLiteral("2.2") << QStringLiteral("2.3"); return list; } -- cgit v1.2.1 From 49d2450c011f3ec9e4bdc980ef4ac6dfcaa1302f Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 30 Jul 2014 10:51:53 +0200 Subject: QmlDesigner.PropertyEditor: Set a proper maximum value for radius Task-number: QTCREATORBUG-12574 Change-Id: I5be4fb1e0004a9f1ab32d9b83e2048031cfb3eb6 Reviewed-by: Tim Jenssen --- .../qmldesigner/propertyEditorQmlSources/QtQuick/RectangleSpecifics.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RectangleSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RectangleSpecifics.qml index df43a5cc84..9dd3a44894 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RectangleSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RectangleSpecifics.qml @@ -91,6 +91,8 @@ Column { backendValue: backendValues.radius hasSlider: true Layout.preferredWidth: 80 + minimumValue: 0 + maximumValue: Math.min(backendValues.height.value, backendValues.width.value) / 2 } ExpandingSpacer { -- cgit v1.2.1 From 9e8a8791bc4f6171f3c3f48d5f91f43b3ab3f269 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 29 Jul 2014 14:19:40 +0200 Subject: Debugger: Prefer GDB on Linux and LLDB on Mac in default kit setup Change-Id: I2c9f1391060a5c4af51e084ba7d86743700d0ce7 Reviewed-by: Robert Loehning Reviewed-by: hjk --- src/plugins/debugger/debuggeritem.cpp | 27 +++++++++++++++++-------- src/plugins/debugger/debuggeritem.h | 2 +- src/plugins/debugger/debuggerkitinformation.cpp | 2 ++ 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/plugins/debugger/debuggeritem.cpp b/src/plugins/debugger/debuggeritem.cpp index 8fbfcf53ff..56e573938a 100644 --- a/src/plugins/debugger/debuggeritem.cpp +++ b/src/plugins/debugger/debuggeritem.cpp @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -228,7 +229,7 @@ void DebuggerItem::setAbi(const Abi &abi) m_abis.append(abi); } -static DebuggerItem::MatchLevel matchSingle(const Abi &debuggerAbi, const Abi &targetAbi) +static DebuggerItem::MatchLevel matchSingle(const Abi &debuggerAbi, const Abi &targetAbi, DebuggerEngineType engineType) { if (debuggerAbi.architecture() != Abi::UnknownArchitecture && debuggerAbi.architecture() != targetAbi.architecture()) @@ -254,14 +255,22 @@ static DebuggerItem::MatchLevel matchSingle(const Abi &debuggerAbi, const Abi &t if (debuggerAbi.wordWidth() != 0 && debuggerAbi.wordWidth() != targetAbi.wordWidth()) return DebuggerItem::DoesNotMatch; - return DebuggerItem::MatchesPerfectly; + // We have at least 'Matches well' now. Mark the combinations we really like. + if (HostOsInfo::isWindowsHost() && engineType == GdbEngineType && targetAbi.os() == Abi::WindowsMSysFlavor) + return DebuggerItem::MatchesPerfectly; + if (HostOsInfo::isLinuxHost() && engineType == GdbEngineType && targetAbi.os() == Abi::LinuxOS) + return DebuggerItem::MatchesPerfectly; + if (HostOsInfo::isMacHost() && engineType == LldbEngineType && targetAbi.os() == Abi::MacOS) + return DebuggerItem::MatchesPerfectly; + + return DebuggerItem::MatchesWell; } DebuggerItem::MatchLevel DebuggerItem::matchTarget(const Abi &targetAbi) const { MatchLevel bestMatch = DoesNotMatch; foreach (const Abi &debuggerAbi, m_abis) { - MatchLevel currentMatch = matchSingle(debuggerAbi, targetAbi); + MatchLevel currentMatch = matchSingle(debuggerAbi, targetAbi, m_engineType); if (currentMatch > bestMatch) bestMatch = currentMatch; } @@ -302,11 +311,11 @@ void Debugger::DebuggerPlugin::testDebuggerMatching_data() QTest::newRow("Fuzzy match 1") << (QStringList() << QLatin1String("unknown-unknown-unknown-unknown-0bit")) << QString::fromLatin1("x86-linux-generic-elf-32bit") - << int(DebuggerItem::MatchesPerfectly); // Is this the expected behavior? + << int(DebuggerItem::MatchesWell); // Is this the expected behavior? QTest::newRow("Fuzzy match 2") << (QStringList() << QLatin1String("unknown-unknown-unknown-unknown-0bit")) << QString::fromLatin1("arm-windows-msys-pe-64bit") - << int(DebuggerItem::MatchesPerfectly); // Is this the expected behavior? + << int(DebuggerItem::MatchesWell); // Is this the expected behavior? QTest::newRow("Architecture mismatch") << (QStringList() << QLatin1String("x86-linux-generic-elf-32bit")) @@ -324,7 +333,7 @@ void Debugger::DebuggerPlugin::testDebuggerMatching_data() QTest::newRow("Linux perfect match") << (QStringList() << QLatin1String("x86-linux-generic-elf-32bit")) << QString::fromLatin1("x86-linux-generic-elf-32bit") - << int(DebuggerItem::MatchesPerfectly); + << int(DebuggerItem::MatchesWell); QTest::newRow("Linux match") << (QStringList() << QLatin1String("x86-linux-generic-elf-64bit")) << QString::fromLatin1("x86-linux-generic-elf-32bit") @@ -333,11 +342,11 @@ void Debugger::DebuggerPlugin::testDebuggerMatching_data() QTest::newRow("Windows perfect match 1") << (QStringList() << QLatin1String("x86-windows-msvc2013-pe-64bit")) << QString::fromLatin1("x86-windows-msvc2013-pe-64bit") - << int(DebuggerItem::MatchesPerfectly); + << int(DebuggerItem::MatchesWell); QTest::newRow("Windows perfect match 2") << (QStringList() << QLatin1String("x86-windows-msvc2013-pe-64bit")) << QString::fromLatin1("x86-windows-msvc2012-pe-64bit") - << int(DebuggerItem::MatchesPerfectly); + << int(DebuggerItem::MatchesWell); QTest::newRow("Windows match 1") << (QStringList() << QLatin1String("x86-windows-msvc2013-pe-64bit")) << QString::fromLatin1("x86-windows-msvc2013-pe-32bit") @@ -376,6 +385,8 @@ void Debugger::DebuggerPlugin::testDebuggerMatching() item.setAbis(debuggerAbis); DebuggerItem::MatchLevel level = item.matchTarget(Abi(target)); + if (level == DebuggerItem::MatchesPerfectly) + level = DebuggerItem::MatchesWell; QCOMPARE(expectedLevel, level); } diff --git a/src/plugins/debugger/debuggeritem.h b/src/plugins/debugger/debuggeritem.h index a9910b0ad5..d73685d6fe 100644 --- a/src/plugins/debugger/debuggeritem.h +++ b/src/plugins/debugger/debuggeritem.h @@ -86,7 +86,7 @@ public: void setAbis(const QList &abis); void setAbi(const ProjectExplorer::Abi &abi); - enum MatchLevel { DoesNotMatch, MatchesSomewhat, MatchesPerfectly }; + enum MatchLevel { DoesNotMatch, MatchesSomewhat, MatchesWell, MatchesPerfectly }; MatchLevel matchTarget(const ProjectExplorer::Abi &targetAbi) const; QStringList abiNames() const; diff --git a/src/plugins/debugger/debuggerkitinformation.cpp b/src/plugins/debugger/debuggerkitinformation.cpp index 3ffc8195a4..2013a478c8 100644 --- a/src/plugins/debugger/debuggerkitinformation.cpp +++ b/src/plugins/debugger/debuggerkitinformation.cpp @@ -126,6 +126,8 @@ void DebuggerKitInformation::setup(Kit *k) goodItem = &item; if (detection == DetectedAutomatically && item.engineType() == autoEngine) goodItem = &item; + if (item.isAutoDetected()) + goodItem = &item; if (goodItem) { DebuggerItem::MatchLevel level = goodItem->matchTarget(toolChainAbi); -- cgit v1.2.1 From 62645e33c8ada48300dc0e84fd103e7e279ae6fb Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 30 Jul 2014 12:16:47 +0200 Subject: QmlDesigner: Fix quotes for mac quick1 puppet Task-number: QTCREATORBUG-12746 Change-Id: If749457cd5f9336f7b1708cd05ca073925177a3b Reviewed-by: Joerg Bornemann --- share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri b/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri index 516300a870..d54a5b4e3f 100644 --- a/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri +++ b/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri @@ -25,7 +25,7 @@ DEFINES -= QT_NO_CAST_FROM_ASCII OTHER_FILES += Info.plist macx { CONFIG -= app_bundle - QMAKE_LFLAGS += -sectcreate __TEXT __info_plist $$quote($$PWD/Info.plist) + QMAKE_LFLAGS += -sectcreate __TEXT __info_plist \"$$PWD/Info.plist\" } else { target.path = $$QTC_PREFIX/bin INSTALLS += target -- cgit v1.2.1 From b601b147abeabc5b12c169739cdff0328ed07a17 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Tue, 22 Jul 2014 15:43:45 +0200 Subject: QmlDesigner: Remove superfluous function call Change-Id: I8cc953040269b6230f91f40cf85fe405684bc58d Reviewed-by: Tim Jenssen --- src/plugins/qmldesigner/components/formeditor/dragtool.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/qmldesigner/components/formeditor/dragtool.cpp b/src/plugins/qmldesigner/components/formeditor/dragtool.cpp index b2922bd80d..b7a5ff220c 100644 --- a/src/plugins/qmldesigner/components/formeditor/dragtool.cpp +++ b/src/plugins/qmldesigner/components/formeditor/dragtool.cpp @@ -284,7 +284,6 @@ void DragTool::dragLeaveEvent(const QList &/*itemList*/, QGraphi m_rewriterTransaction.commit(); - view()->clearSelectedModelNodes(); view()->changeToSelectionTool(); } } -- cgit v1.2.1 From 0ee609f8fc8a86a1e5e4d4c950a47ba35f0adb66 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Tue, 29 Jul 2014 19:11:31 +0200 Subject: QmlDesigner: Fix reset width and height Task-number: QTBUG-38426 Change-Id: I28e9ed70042c118ff65801c4d07e5a67dc7c3db1 Reviewed-by: Tim Jenssen --- .../qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp index 33931cbd70..9ed471cde5 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp @@ -325,7 +325,7 @@ QSizeF QuickItemNodeInstance::size() const { double width; - if (DesignerSupport::isValidWidth(quickItem())) { + if (DesignerSupport::isValidHeight(quickItem())) { // isValidHeight is QQuickItemPrivate::get(item)->widthValid width = quickItem()->width(); } else { width = quickItem()->implicitWidth(); @@ -333,7 +333,7 @@ QSizeF QuickItemNodeInstance::size() const double height; - if (DesignerSupport::isValidHeight(quickItem())) { + if (DesignerSupport::isValidWidth(quickItem())) { // isValidWidth is QQuickItemPrivate::get(item)->heightValid height = quickItem()->height(); } else { height = quickItem()->implicitHeight(); -- cgit v1.2.1 From 953d688d88577ccff8776d35e93d842c93e035cc Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Mon, 28 Jul 2014 16:14:32 +0200 Subject: Doc: add info about Qt Quick Dialogs and Layouts Task-number: QTCREATORBUG-12721 Change-Id: Ib6ff3e53806be26f714378d4ffcd3b54a36a6e8f Reviewed-by: Leena Miettinen --- doc/src/qtquick/qtquick-app-development.qdoc | 12 ++++++------ doc/src/qtquick/qtquick-components.qdoc | 13 +++++-------- doc/src/qtquick/qtquick-creating.qdoc | 12 ++++++++---- doc/src/qtquick/qtquick-designer.qdoc | 6 +++--- doc/src/qtquick/qtquick-screens.qdoc | 6 +++--- 5 files changed, 25 insertions(+), 24 deletions(-) diff --git a/doc/src/qtquick/qtquick-app-development.qdoc b/doc/src/qtquick/qtquick-app-development.qdoc index 307d22c29e..c54a065498 100644 --- a/doc/src/qtquick/qtquick-app-development.qdoc +++ b/doc/src/qtquick/qtquick-app-development.qdoc @@ -43,14 +43,14 @@ \li \l {Creating Components} - You can use predefined QML types to create components or use a set - of Qt Quick Controls for creating classic desktop-style user - interfaces using Qt Quick 2.1 (available since Qt 5.1). + You can use basic QML types to create your own components that you + can combine with ready-made Qt Quick Controls and Layouts + (available since Qt 5.1). \li \l {Creating Screens} - You can use predefined QML types, Qt Quick Controls, and your own - components to create screens. You can use states and transitions to - navigate between screens. + You can combine basic QML types with ready-made Qt Quick Controls, + Dialogs, and Layouts (available since Qt 5.1) to create screens. You + can use states and transitions to navigate between screens. \li \l {Exporting Designs from Graphics Software} You can export designs from graphics software, such as Adobe diff --git a/doc/src/qtquick/qtquick-components.qdoc b/doc/src/qtquick/qtquick-components.qdoc index 4980510261..07fb88aeb5 100644 --- a/doc/src/qtquick/qtquick-components.qdoc +++ b/doc/src/qtquick/qtquick-components.qdoc @@ -71,14 +71,11 @@ \endlist - QML types allow you to write cross-platform applications with custom look - and feel. You can also use ready-made Qt Quick Components (for Qt 4) to - create screens with a native look and feel for a particular target platform. - Since Qt 5.1, a set of Qt Quick Controls is available for creating classic - desktop-style user interfaces using Qt Quick 2.1. - - Qt Quick 1 Components are a part of Qt 4, whereas Qt Quick Controls were - added to Qt 5.1. + You can also use ready-made Qt Quick 1 Components (for Qt 4) to create + screens with a native look and feel for a particular target platform. + Since Qt 5.1, Qt Quick Controls, Dialogs, and Layouts are available for + creating classic desktop-style user interfaces using Qt Quick 2.1. You can + use the Qt Quick Controls Styles to customize Qt Quick Controls. The \QC project wizards create Qt Quick applications that use Qt Quick Components or Controls. diff --git a/doc/src/qtquick/qtquick-creating.qdoc b/doc/src/qtquick/qtquick-creating.qdoc index 8c0117a25b..8870e7c1ad 100644 --- a/doc/src/qtquick/qtquick-creating.qdoc +++ b/doc/src/qtquick/qtquick-creating.qdoc @@ -68,10 +68,10 @@ \gui {Qt Quick UI} > \gui Choose. \li In the \gui {Qt Quick component set} field, select the component set - to use for the project. The Qt Quick imports enable you to create - cross-platform applications with a custom look and feel, whereas the - Qt Quick Controls provide the look and feel for a particular - platform: + to use for the project. The Qt Quick imports enable you to use the + basic QML types to create user interfaces, whereas the Qt Quick + Controls provide a set of ready-made controls that you can customize + by using Qt Quick Controls Styles: \list @@ -85,6 +85,10 @@ \endlist + You can add imports later to combine Qt Quick basic types with Qt Quick + Controls, Qt Quick Dialogs, and Qt Quick Layouts (available since + Qt 5.1). + \endlist \QC creates the following files: diff --git a/doc/src/qtquick/qtquick-designer.qdoc b/doc/src/qtquick/qtquick-designer.qdoc index c6b22bb80a..cc8b45025e 100644 --- a/doc/src/qtquick/qtquick-designer.qdoc +++ b/doc/src/qtquick/qtquick-designer.qdoc @@ -143,9 +143,9 @@ components, basic types, layouts, positioner types, and views. Sets of UI components with the look and feel of a particular mobile device - platform have been defined for Qt Quick 1. Since Qt 5.1, a set of Qt Quick - Controls is available for creating classic desktop-style user interfaces - using Qt Quick 2.1. The Qt Quick Components and Controls are based on + platform have been defined for Qt Quick 1. Since Qt 5.1, ready-made Qt + Quick Controls, Dialogs, and Layouts are available for creating user + interfaces using Qt Quick 2.1. The components and controls are based on standard QML types. To view the components and controls in the \gui {Library} pane, import the component sets in the \gui Imports pane. diff --git a/doc/src/qtquick/qtquick-screens.qdoc b/doc/src/qtquick/qtquick-screens.qdoc index 283fcc9f4f..e5fcee617e 100644 --- a/doc/src/qtquick/qtquick-screens.qdoc +++ b/doc/src/qtquick/qtquick-screens.qdoc @@ -40,9 +40,9 @@ You can also use ready-made Qt Quick 1 Components (for Qt 4) to create screens with a native look and feel for a particular target platform. - Since Qt 5.1, a set of Qt Quick Controls is available for creating classic - desktop-style user interfaces using Qt Quick 2.1. Qt Quick 1 Components are - a part of Qt 4, whereas Qt Quick Controls were added to Qt 5.1. + Since Qt 5.1, Qt Quick Controls, Dialogs, and Layouts are available for + creating classic desktop-style user interfaces using Qt Quick 2.1. You can + use the Qt Quick Controls Styles to customize Qt Quick Controls. \section1 Adding Components to Screens -- cgit v1.2.1 From 67a5cc39d1a812eebfaca58edea293df32d1cf95 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 30 Jul 2014 13:14:52 +0200 Subject: Doc: remove unnecessary nested lists There was only one item in the top level list, so turned it into a leading sentence for the sublist. Change-Id: I8190cea29a04664a39822a59192093dba717dc66 Reviewed-by: Leena Miettinen --- doc/src/linux-mobile/creator-projects-running-generic-linux.qdocinc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/doc/src/linux-mobile/creator-projects-running-generic-linux.qdocinc b/doc/src/linux-mobile/creator-projects-running-generic-linux.qdocinc index e0f8398459..e276915812 100644 --- a/doc/src/linux-mobile/creator-projects-running-generic-linux.qdocinc +++ b/doc/src/linux-mobile/creator-projects-running-generic-linux.qdocinc @@ -1,8 +1,6 @@ \section1 Running on Embedded Linux Devices - \list 1 - - \li Build and run the application for a device: + To build and run the application for a device: \list 1 @@ -13,8 +11,6 @@ \endlist - \endlist - \QC uses the compiler specified in the project build settings (tool chain) to build the application. -- cgit v1.2.1 From 5778a393173823118339083a4fd4f2ed11fd85a8 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Thu, 24 Jul 2014 19:38:51 +0200 Subject: QmlDesigner: read window mock from file Change-Id: Ic525b1d3ac18c42c6abb6a93195e220465dd017f Reviewed-by: Tim Jenssen --- share/qtcreator/qml/qmlpuppet/mockfiles/Window.qml | 5 +++++ .../qml2puppet/instances/objectnodeinstance.cpp | 18 ++++++------------ share/qtcreator/qml/qmlpuppet/qmlpuppet.qrc | 1 + 3 files changed, 12 insertions(+), 12 deletions(-) create mode 100644 share/qtcreator/qml/qmlpuppet/mockfiles/Window.qml diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/Window.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/Window.qml new file mode 100644 index 0000000000..e04c067cf8 --- /dev/null +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/Window.qml @@ -0,0 +1,5 @@ +import QtQuick 2.2 + +Rectangle { + property string title +} diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp index 589c47883f..bc1e5c7bd3 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp @@ -1089,17 +1089,9 @@ static bool isCrashingType(QQmlType *type) return false; } -static QObject *createDummyWindow(QQmlContext *context, const QUrl &sourceUrl) +static QObject *createDummyWindow(QQmlContext *context) { - QQmlComponent component(context->engine()); - QByteArray dummyWindow; - dummyWindow.append("import QtQuick 2.0\n"); - dummyWindow.append("Rectangle {\n"); - dummyWindow.append("property string title\n"); - dummyWindow.append("}\n"); - - component.setData(dummyWindow, sourceUrl); - + QQmlComponent component(context->engine(), QUrl(QStringLiteral("qrc:/qtquickplugin/mockfiles/Window.qml"))); return component.create(); } @@ -1137,10 +1129,12 @@ QObject *ObjectNodeInstance::createPrimitive(const QString &typeName, int majorN if (isWindow(object)) { delete object; - object = createDummyWindow(context, type->sourceUrl()); + object = createDummyWindow(context); } - } else { + } + + if (!object) { qWarning() << "QuickDesigner: Cannot create an object of type" << QString("%1 %2,%3").arg(typeName).arg(majorNumber).arg(minorNumber) << "- type isn't known to declarative meta type system"; diff --git a/share/qtcreator/qml/qmlpuppet/qmlpuppet.qrc b/share/qtcreator/qml/qmlpuppet/qmlpuppet.qrc index ceb6142cb3..e9588ab045 100644 --- a/share/qtcreator/qml/qmlpuppet/qmlpuppet.qrc +++ b/share/qtcreator/qml/qmlpuppet/qmlpuppet.qrc @@ -3,5 +3,6 @@ images/template_image.png html/welcome.html images/webkit.png + mockfiles/Window.qml -- cgit v1.2.1 From 8780a5a5e0a79128672e349266d43546cf04053c Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 30 Jul 2014 13:41:03 +0200 Subject: QmlDesigner: Fix quick1 tests The test still used the unsupported Qt 4.7 import. Task-number: QTCREATORBUG-12567 Change-Id: I47eee256d9e3160aea8e41537fcea92d20b42fd7 Reviewed-by: Tim Jenssen --- tests/manual/qml/testfiles/components/MyButton.qml | 2 +- tests/manual/qml/testfiles/empty.qml | 2 +- tests/manual/qml/testfiles/flipable.qml | 2 +- tests/manual/qml/testfiles/helloworld.qml | 2 +- tests/manual/qml/testfiles/helloworld_inverted.qml | 2 +- tests/manual/qml/testfiles/images.qml | 2 +- tests/manual/qml/testfiles/listmodel.qml | 2 +- tests/manual/qml/testfiles/listview.qml | 2 +- tests/manual/qml/testfiles/states.qml | 2 +- tests/manual/qml/testfiles/subcomponent.qml | 2 +- tests/manual/qml/testfiles/usingbutton.qml | 2 +- tests/manual/qml/testfiles/webview.qml | 1 + 12 files changed, 12 insertions(+), 11 deletions(-) diff --git a/tests/manual/qml/testfiles/components/MyButton.qml b/tests/manual/qml/testfiles/components/MyButton.qml index 4138cbf74d..20109e8593 100644 --- a/tests/manual/qml/testfiles/components/MyButton.qml +++ b/tests/manual/qml/testfiles/components/MyButton.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.1 Rectangle { width: 64 diff --git a/tests/manual/qml/testfiles/empty.qml b/tests/manual/qml/testfiles/empty.qml index 11a6607c98..35da140ec6 100644 --- a/tests/manual/qml/testfiles/empty.qml +++ b/tests/manual/qml/testfiles/empty.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.1 Rectangle { width: 640 diff --git a/tests/manual/qml/testfiles/flipable.qml b/tests/manual/qml/testfiles/flipable.qml index 7b0ecd67bc..3a392d7c8e 100644 --- a/tests/manual/qml/testfiles/flipable.qml +++ b/tests/manual/qml/testfiles/flipable.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.1 Flipable { width: 640 diff --git a/tests/manual/qml/testfiles/helloworld.qml b/tests/manual/qml/testfiles/helloworld.qml index 3a53670a80..72b734bea7 100644 --- a/tests/manual/qml/testfiles/helloworld.qml +++ b/tests/manual/qml/testfiles/helloworld.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.1 Rectangle { width: 200 diff --git a/tests/manual/qml/testfiles/helloworld_inverted.qml b/tests/manual/qml/testfiles/helloworld_inverted.qml index 45821b103d..abd81bea39 100644 --- a/tests/manual/qml/testfiles/helloworld_inverted.qml +++ b/tests/manual/qml/testfiles/helloworld_inverted.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.1 Rectangle { width: 200 diff --git a/tests/manual/qml/testfiles/images.qml b/tests/manual/qml/testfiles/images.qml index d9365272e7..99fd5f750d 100644 --- a/tests/manual/qml/testfiles/images.qml +++ b/tests/manual/qml/testfiles/images.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.1 Rectangle { width: 640 diff --git a/tests/manual/qml/testfiles/listmodel.qml b/tests/manual/qml/testfiles/listmodel.qml index bfa72575c1..f437850fb7 100644 --- a/tests/manual/qml/testfiles/listmodel.qml +++ b/tests/manual/qml/testfiles/listmodel.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.1 ListModel { id: myModel diff --git a/tests/manual/qml/testfiles/listview.qml b/tests/manual/qml/testfiles/listview.qml index 43d26825d3..cc05278807 100644 --- a/tests/manual/qml/testfiles/listview.qml +++ b/tests/manual/qml/testfiles/listview.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 1.1 Item { width: 200 diff --git a/tests/manual/qml/testfiles/states.qml b/tests/manual/qml/testfiles/states.qml index 995ac81cf9..89c03ca79e 100644 --- a/tests/manual/qml/testfiles/states.qml +++ b/tests/manual/qml/testfiles/states.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.1 Rectangle { id: rect diff --git a/tests/manual/qml/testfiles/subcomponent.qml b/tests/manual/qml/testfiles/subcomponent.qml index b55bd44139..5371099a36 100644 --- a/tests/manual/qml/testfiles/subcomponent.qml +++ b/tests/manual/qml/testfiles/subcomponent.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.1 Rectangle { width: 640 diff --git a/tests/manual/qml/testfiles/usingbutton.qml b/tests/manual/qml/testfiles/usingbutton.qml index c7aae10599..25e5a21a96 100644 --- a/tests/manual/qml/testfiles/usingbutton.qml +++ b/tests/manual/qml/testfiles/usingbutton.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.1 import "components" as X Rectangle { diff --git a/tests/manual/qml/testfiles/webview.qml b/tests/manual/qml/testfiles/webview.qml index 51c05dd3e6..02d2bca051 100644 --- a/tests/manual/qml/testfiles/webview.qml +++ b/tests/manual/qml/testfiles/webview.qml @@ -27,6 +27,7 @@ ** ****************************************************************************/ +import QtQuick 1.1 import QtWebKit 1.0 // Test loading of import libraries -- cgit v1.2.1 From 901d20d10324a27a9fd614808a8966a94ec9d986 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 30 Jul 2014 14:07:10 +0200 Subject: QmlDesigner.ItemLibrary: Remove StatusBar and ToolBar These items are poorly supported at the moment. we should not encourage the usage in the designer. Change-Id: I2218bfd48c5d45d1cdd7abe083010e48fa72f962 Reviewed-by: Tim Jenssen --- .../componentsplugin/components.metainfo | 30 ---------------------- 1 file changed, 30 deletions(-) diff --git a/src/plugins/qmldesigner/componentsplugin/components.metainfo b/src/plugins/qmldesigner/componentsplugin/components.metainfo index fbbfdf13fa..93410ed01e 100644 --- a/src/plugins/qmldesigner/componentsplugin/components.metainfo +++ b/src/plugins/qmldesigner/componentsplugin/components.metainfo @@ -278,36 +278,6 @@ MetaInfo { } } - - Type { - name: "QtQuick.Controls.ToolBar" - icon: ":/componentsplugin/images/toolbar16.png" - - ItemLibraryEntry { - name: "Tool Bar" - category: "Qt Quick - Controls" - libraryIcon: ":/componentsplugin/images/toolbar.png" - version: "1.0" - requiredImport: "QtQuick.Controls" - - Property { name: "width"; type: "int"; value: 360; } - Property { name: "height"; type: "int"; value: 50; } - } - } - - Type { - name: "QtQuick.Controls.StatusBar" - icon: ":/componentsplugin/images/toolbar16.png" - - ItemLibraryEntry { - name: "Status Bar" - category: "Qt Quick - Controls" - libraryIcon: ":/componentsplugin/images/toolbar.png" - version: "1.0" - requiredImport: "QtQuick.Controls" - } - } - Type { name: "QtQuick.Controls.Dial" //icon: ":/componentsplugin/images/progressbar16.png" -- cgit v1.2.1 From 52c06731c31b0b5685ef2b0cf8f26a5f4e55f6e5 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 30 Jul 2014 14:05:56 +0200 Subject: QmlDesigner.ItemLibrary: Remove Flipable Flipable is basically unsuported by the designer and it does not make sense to show something unsupported in the library. Change-Id: Ib75be87f8303e0da7fe0a069bc257600296c3cbe Reviewed-by: Tim Jenssen --- .../qmldesigner/qtquickplugin/quick.metainfo | 25 ---------------------- 1 file changed, 25 deletions(-) diff --git a/src/plugins/qmldesigner/qtquickplugin/quick.metainfo b/src/plugins/qmldesigner/qtquickplugin/quick.metainfo index bd8a6b2dc1..6aeb725db7 100644 --- a/src/plugins/qmldesigner/qtquickplugin/quick.metainfo +++ b/src/plugins/qmldesigner/qtquickplugin/quick.metainfo @@ -242,31 +242,6 @@ MetaInfo { } } - Type { - name: "QtQuick.Flipable" - icon: ":/qtquickplugin/images/flipable-icon16.png" - - ItemLibraryEntry { - name: "Flipable" - category: "Qt Quick - Basic" - libraryIcon: ":/qtquickplugin/images/flipable-icon.png" - version: "1.0" - - Property { name: "width"; type: "int"; value: 200; } - Property { name: "height"; type: "int"; value: 200; } - } - - ItemLibraryEntry { - name: "Flipable" - category: "Qt Quick - Basic" - libraryIcon: ":/qtquickplugin/images/flipable-icon.png" - version: "2.0" - - Property { name: "width"; type: "int"; value: 200; } - Property { name: "height"; type: "int"; value: 200; } - } - } - Type { name: "QtQuick.GridView" icon: ":/qtquickplugin/images/gridview-icon16.png" -- cgit v1.2.1 From 13090e244d035e7461a4ddf14181b8f6a67de674 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 30 Jul 2014 16:46:25 +0200 Subject: Doc: update FakeVim options screenshot An option was added. Change-Id: Ia66e085e14a73815c91fec22157fc1e48a614db2 Reviewed-by: Leena Miettinen --- doc/images/qtcreator-fakevim-options.png | Bin 27599 -> 108110 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/doc/images/qtcreator-fakevim-options.png b/doc/images/qtcreator-fakevim-options.png index d5e788eabe..4257cfa098 100644 Binary files a/doc/images/qtcreator-fakevim-options.png and b/doc/images/qtcreator-fakevim-options.png differ -- cgit v1.2.1 From 8567ab09734c42d8daa821eebfe87f4bf3c03f81 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 30 Jul 2014 16:47:45 +0200 Subject: Doc: some writing style fixes Change-Id: Ibfd4d1ed174e5d656589cfaaf1303cf4d75fa05d Reviewed-by: Leena Miettinen --- doc/src/editors/creator-coding-edit-mode.qdoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/src/editors/creator-coding-edit-mode.qdoc b/doc/src/editors/creator-coding-edit-mode.qdoc index 53924284c5..67223821e6 100644 --- a/doc/src/editors/creator-coding-edit-mode.qdoc +++ b/doc/src/editors/creator-coding-edit-mode.qdoc @@ -142,12 +142,12 @@ \section1 Moving to Symbol Definition or Declaration You can move directly to the definition or the declaration of a symbol by - holding the \key Ctrl and clicking the symbol. If you have multiple splits + holding the \key Ctrl key and clicking the symbol. If you have multiple splits opened, you can open the link in the next split by holding \key Ctrl and - \key Alt while clicking on the symbol. + \key Alt while clicking the symbol. - To enable this moving function, in \gui Tools > \gui{Options} > - \gui{Text Editor} > \gui Behavior, select \gui{Enable mouse navigation}. + To enable this moving function, select \gui Tools > \gui{Options} > + \gui{Text Editor} > \gui Behavior > \gui{Enable mouse navigation}. You can also select the symbol and press \key F2, or right-click the symbol and select \gui {Follow Symbol Under Cursor} to move to its definition or -- cgit v1.2.1 From 1be0e914c69aa849a6d5818fb4562f9d99434863 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 30 Jul 2014 16:49:21 +0200 Subject: Doc: explain all build commands in one place Change-Id: I6c1844fd5c0519f24eb61793ff8f049ce4e7b469 Reviewed-by: Daniel Teske --- doc/src/projects/creator-projects-building.qdoc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/src/projects/creator-projects-building.qdoc b/doc/src/projects/creator-projects-building.qdoc index ccbedf5770..59ccb91dd8 100644 --- a/doc/src/projects/creator-projects-building.qdoc +++ b/doc/src/projects/creator-projects-building.qdoc @@ -48,12 +48,17 @@ \list 1 - \li Select a \l{glossary-buildandrun-kit}{kit} for the project. + \li Click the \gui {Build and Run Kit Selector} icon (1) or select + \gui Build > \gui {Open Build and Run Kit Selector} to select the + build and run \l{glossary-buildandrun-kit}{kit}. \image qtcreator-kit-selector.png "Kit selector" \li Choose \gui {Build > Build Project} or press \key {Ctrl+B}. + You can also select the \gui Run button (2) to also deploy and run + the application after building it. + \endlist For more information on the options you have, see @@ -63,4 +68,10 @@ subproject, you can use the \gui Build menu commands to build a file or subproject. + To remove all build artifacts, select \gui Build > \gui {Clean All} or + \gui {Clean Project}. To clean the build directory and then build the + project, select \gui Build > \gui {Rebuild All} or \gui {Rebuild Project}. + + To run qmake to generate new Makefiles, select \gui Build > \gui qmake. + */ -- cgit v1.2.1 From d40585d7b159301ff323bdf92143519cacb71ed2 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 30 Jul 2014 21:55:18 +0300 Subject: Debugger: Fix comparison of wrong value debuggeritem.cpp:259: warning: comparison between 'enum ProjectExplorer::Abi::OS' and 'enum ProjectExplorer::Abi::OSFlavor' [-Wenum-compare] Change-Id: I3b4f484abec56429bb7d7796749e7f1fa4e0317a Reviewed-by: Fawzi Mohamed --- src/plugins/debugger/debuggeritem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/debugger/debuggeritem.cpp b/src/plugins/debugger/debuggeritem.cpp index 56e573938a..f95d2e3f52 100644 --- a/src/plugins/debugger/debuggeritem.cpp +++ b/src/plugins/debugger/debuggeritem.cpp @@ -256,7 +256,7 @@ static DebuggerItem::MatchLevel matchSingle(const Abi &debuggerAbi, const Abi &t return DebuggerItem::DoesNotMatch; // We have at least 'Matches well' now. Mark the combinations we really like. - if (HostOsInfo::isWindowsHost() && engineType == GdbEngineType && targetAbi.os() == Abi::WindowsMSysFlavor) + if (HostOsInfo::isWindowsHost() && engineType == GdbEngineType && targetAbi.osFlavor() == Abi::WindowsMSysFlavor) return DebuggerItem::MatchesPerfectly; if (HostOsInfo::isLinuxHost() && engineType == GdbEngineType && targetAbi.os() == Abi::LinuxOS) return DebuggerItem::MatchesPerfectly; -- cgit v1.2.1 From e9e405cb18e0d7ed7a177fa6d67c2774c2113bfa Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Tue, 29 Jul 2014 17:57:04 +0200 Subject: DebuggerRunControlFactory::createAndScheduleRun: Remove unused parameter No caller actually passed in a runconfiguration. Change-Id: I68a0cea8cd5d9bbdd4fb0b979ef4c5698f5b769d Reviewed-by: hjk --- src/plugins/debugger/debuggerruncontrolfactory.h | 4 +--- src/plugins/debugger/debuggerrunner.cpp | 8 ++------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/plugins/debugger/debuggerruncontrolfactory.h b/src/plugins/debugger/debuggerruncontrolfactory.h index 4b6ab2be34..52933f09b8 100644 --- a/src/plugins/debugger/debuggerruncontrolfactory.h +++ b/src/plugins/debugger/debuggerruncontrolfactory.h @@ -59,9 +59,7 @@ public: const DebuggerStartParameters &sp, QString *errorMessage); - static DebuggerRunControl *createAndScheduleRun( - const DebuggerStartParameters &sp, - ProjectExplorer::RunConfiguration *runConfiguration = 0); + static DebuggerRunControl *createAndScheduleRun(const DebuggerStartParameters &sp); static DebuggerRunControl *doCreate(const DebuggerStartParameters &sp, ProjectExplorer::RunConfiguration *rc, QString *errorMessage); diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index fcee2fedc2..b715955524 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -454,14 +454,10 @@ IRunConfigurationAspect *DebuggerRunControlFactory::createRunConfigurationAspect return new DebuggerRunConfigurationAspect(rc); } -DebuggerRunControl *DebuggerRunControlFactory::createAndScheduleRun - (const DebuggerStartParameters &sp, RunConfiguration *runConfiguration) +DebuggerRunControl *DebuggerRunControlFactory::createAndScheduleRun(const DebuggerStartParameters &sp) { QString errorMessage; - if (runConfiguration && !runConfiguration->ensureConfigured(&errorMessage)) - ProjectExplorer::ProjectExplorerPlugin::showRunErrorMessage(errorMessage); - - DebuggerRunControl *rc = doCreate(sp, runConfiguration, &errorMessage); + DebuggerRunControl *rc = doCreate(sp, 0, &errorMessage); if (!rc) { ProjectExplorer::ProjectExplorerPlugin::showRunErrorMessage(errorMessage); return 0; -- cgit v1.2.1 From b20b1d3378b55f2b4f48c5d3ef04deb4dac863fc Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 30 Jul 2014 12:03:01 +0200 Subject: Doc: make the running instructions be about kit selector Remove the section about running on desktop and add instructions for opening the kit selector. Update the screen shot. Change-Id: I164381287bd2167eb45dd6b4c2c3da555027af12 Reviewed-by: Daniel Teske --- doc/images/qtcreator-kit-selector.png | Bin 24369 -> 39125 bytes .../creator-projects-running-desktop.qdocinc | 11 ----------- doc/src/projects/creator-projects-running.qdoc | 22 +++++++++++++++++---- 3 files changed, 18 insertions(+), 15 deletions(-) delete mode 100644 doc/src/projects/creator-projects-running-desktop.qdocinc diff --git a/doc/images/qtcreator-kit-selector.png b/doc/images/qtcreator-kit-selector.png index 4319cb32a4..dcd53f7fa9 100644 Binary files a/doc/images/qtcreator-kit-selector.png and b/doc/images/qtcreator-kit-selector.png differ diff --git a/doc/src/projects/creator-projects-running-desktop.qdocinc b/doc/src/projects/creator-projects-running-desktop.qdocinc deleted file mode 100644 index 5782622658..0000000000 --- a/doc/src/projects/creator-projects-running-desktop.qdocinc +++ /dev/null @@ -1,11 +0,0 @@ - \section1 Running on Desktop - - \list 1 - - \li Select \gui Desktop as the build and run \l{glossary-buildandrun-kit}{kit}. - - \image qtcreator-kit-selector.png "Kit selector" - - \li Click the \gui Run button. - - \endlist diff --git a/doc/src/projects/creator-projects-running.qdoc b/doc/src/projects/creator-projects-running.qdoc index 534bec7690..48d7866f64 100644 --- a/doc/src/projects/creator-projects-running.qdoc +++ b/doc/src/projects/creator-projects-running.qdoc @@ -34,14 +34,28 @@ location from where it can be run on the desktop, on a device emulator or simulator, or on a mobile device that is connected to the development PC. - To run executable files without deploying them first, deselect the - \gui {Tools > Options > Project > Always deploy project before running it} - option. + To run executable files without deploying them first, select \gui Build > + \gui {Run Without Deployment}. To make this the default option, deselect the + \gui Tools > \gui Options > \gui Project > + \gui {Always deploy project before running it} option. + + To run applications: + + \list 1 + + \li Click the \gui {Build and Run Kit Selector} icon (1) or select + \gui Build > \gui {Open Build and Run Kit Selector} to select the + build and run \l{glossary-buildandrun-kit}{kit}. + + \image qtcreator-kit-selector.png "Kit selector" + + \li Click the \gui Run button (2). + + \endlist For more information on the options you have, see \l{Specifying Run Settings}. - \include projects/creator-projects-running-desktop.qdocinc \include linux-mobile/creator-projects-running-generic-linux.qdocinc \include qnx/creator-projects-running-qnx.qdocinc */ -- cgit v1.2.1 From 0266f44a2a073dd0eaa7a353b662003543b1049d Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Tue, 29 Jul 2014 18:03:18 +0200 Subject: RunControlFactories: No need to check for isConfigured Checking if a runconfiguration is configured happens before searching for the right factory, thus the factory can assume that it always gets a configured runconfiguration. Change-Id: I171318dda22c4e89f3619418336865cb28a3dc5f Reviewed-by: hjk --- src/plugins/debugger/debuggerrunner.cpp | 2 -- src/plugins/projectexplorer/localapplicationruncontrol.cpp | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index b715955524..6d29ec7718 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -310,8 +310,6 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu QTC_ASSERT(rc, return sp); EnvironmentAspect *environment = rc->extraAspect(); QTC_ASSERT(environment, return sp); - if (!rc->ensureConfigured(errorMessage)) - return sp; Target *target = runConfiguration->target(); Kit *kit = target ? target->kit() : KitManager::defaultKit(); diff --git a/src/plugins/projectexplorer/localapplicationruncontrol.cpp b/src/plugins/projectexplorer/localapplicationruncontrol.cpp index d0a78621d1..e5072117ff 100644 --- a/src/plugins/projectexplorer/localapplicationruncontrol.cpp +++ b/src/plugins/projectexplorer/localapplicationruncontrol.cpp @@ -54,11 +54,9 @@ bool LocalApplicationRunControlFactory::canRun(RunConfiguration *runConfiguratio RunControl *LocalApplicationRunControlFactory::create(RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage) { + Q_UNUSED(errorMessage) QTC_ASSERT(canRun(runConfiguration, mode), return 0); LocalApplicationRunConfiguration *localRunConfiguration = qobject_cast(runConfiguration); - // Force the dialog about executables at this point and fail if there is none - if (!localRunConfiguration->ensureConfigured(errorMessage)) - return 0; return new LocalApplicationRunControl(localRunConfiguration, mode); } -- cgit v1.2.1 From 3787e9c64efdf29fe2e7f9dc7930ebe70c7dd20b Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 30 Jul 2014 17:53:49 +0200 Subject: Update qbs submodule. To HEAD of 1.3 branch. Change-Id: I30344ddbf055f5ba8c29e672a019909d1c0babe8 Reviewed-by: Joerg Bornemann --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index 472a0e505a..59aed7c423 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 472a0e505a78fddf5d7ce02b2c6ef8f859926b3e +Subproject commit 59aed7c423ab1ff8e19d34736619cb128cc8b49a -- cgit v1.2.1 From 3c6b2691b72411f42d157667b52765d33437755f Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 31 Jul 2014 14:13:44 +0200 Subject: Set the minimum qbs version on the project. So people will understand why they can't open the projects with older Creator versions. Change-Id: Ie9291096ba001b0d31a58d834ba23c95a569d20f Reviewed-by: Joerg Bornemann --- qtcreator.qbs | 1 + 1 file changed, 1 insertion(+) diff --git a/qtcreator.qbs b/qtcreator.qbs index 25bbb3e128..0efe98001b 100644 --- a/qtcreator.qbs +++ b/qtcreator.qbs @@ -1,6 +1,7 @@ import qbs 1.0 Project { + minimumQbsVersion: "1.3" property bool withAutotests: qbs.buildVariant === "debug" property string ide_version_major: '3' property string ide_version_minor: '1' -- cgit v1.2.1 From 5aabc70619fd9b4181fb1c510055d3102aad1551 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 30 Jul 2014 15:55:08 +0200 Subject: QmlDesigner: Check directory and not anymore only directory entries On some file systems the time stamp of the directory is updated as the file stamp is updated. Change-Id: I825377e43c26abe89c882f054d175b31dd93768c Reviewed-by: Tim Jenssen --- src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp b/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp index 44d3bc8053..bbed270ba8 100644 --- a/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp +++ b/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp @@ -95,9 +95,11 @@ QDateTime PuppetCreator::puppetSourceLastModified() const sourceDirectoryPathes.append(basePuppetSourcePath + QStringLiteral("/qml2puppet/instances")); foreach (const QString directoryPath, sourceDirectoryPathes) { - QDateTime directoryPathLastModified = QFileInfo(directoryPath).lastModified(); - if (lastModified < directoryPathLastModified) - lastModified = directoryPathLastModified; + foreach (const QFileInfo fileEntry, QDir(directoryPath).entryInfoList()) { + QDateTime filePathLastModified = fileEntry.lastModified(); + if (lastModified < filePathLastModified) + lastModified = filePathLastModified; + } } return lastModified; -- cgit v1.2.1 From edb7961fe690ad9cd18e2f22aab42754c4f14b76 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 31 Jul 2014 15:05:25 +0200 Subject: Revert "Debugger: Weaken abi check for attaching to local process" This reverts commit eab8054535c4726d9390fe331bb9a6cae5f623f9. The commit introduces regressions as GDB will be considered as suitable for MSVC compiled binaries. Task-number: QTCREATORBUG-12772 Change-Id: I87b17cd81621aca0142633c008c0f1114f349b1f Reviewed-by: Robert Loehning --- src/plugins/debugger/debuggerdialogs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp index f919cb7a85..e367e2891c 100644 --- a/src/plugins/debugger/debuggerdialogs.cpp +++ b/src/plugins/debugger/debuggerdialogs.cpp @@ -117,7 +117,7 @@ bool DebuggerKitChooser::kitMatches(const ProjectExplorer::Kit *k) const return false; if (m_mode == LocalDebugging) { const ProjectExplorer::ToolChain *tc = ToolChainKitInformation::toolChain(k); - return tc && tc->targetAbi().isCompatibleWith(m_hostAbi); + return tc && tc->targetAbi().os() == m_hostAbi.os(); } return true; } -- cgit v1.2.1 From 0da08c227f2834311241c9f04027ee4adc674247 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Thu, 31 Jul 2014 16:45:21 +0200 Subject: QmlDesigner: Use a POSIX shared memory for unix QSharedMemory is using SVR4 shared memory for unix which is limited to 4 MB globally which is really hurting the performance for the designer. POSIX shared memory is lifting some of this constraints but still has some bugs on Max OS but generally works better. Change-Id: I74c1ffd56495f408cd9340cd159190a1175a4086 Reviewed-by: Tim Jenssen --- .../qmlpuppet/commands/valueschangedcommand.cpp | 26 +- .../qml/qmlpuppet/container/container.pri | 27 +- .../qml/qmlpuppet/container/imagecontainer.cpp | 69 +-- .../qml/qmlpuppet/container/sharedmemory.h | 96 ++++ .../qml/qmlpuppet/container/sharedmemory_qt.cpp | 117 +++++ .../qml/qmlpuppet/container/sharedmemory_unix.cpp | 488 +++++++++++++++++++++ .../qml/qmlpuppet/qml2puppet/qml2puppet.pri | 5 +- .../qml/qmlpuppet/qmlpuppet/qmlpuppet.pri | 2 + src/plugins/qmldesigner/qmldesignerplugin.pro | 2 + 9 files changed, 776 insertions(+), 56 deletions(-) create mode 100644 share/qtcreator/qml/qmlpuppet/container/sharedmemory.h create mode 100644 share/qtcreator/qml/qmlpuppet/container/sharedmemory_qt.cpp create mode 100644 share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp diff --git a/share/qtcreator/qml/qmlpuppet/commands/valueschangedcommand.cpp b/share/qtcreator/qml/qmlpuppet/commands/valueschangedcommand.cpp index cb7a316426..a995ab36fb 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/valueschangedcommand.cpp +++ b/share/qtcreator/qml/qmlpuppet/commands/valueschangedcommand.cpp @@ -29,7 +29,7 @@ #include "valueschangedcommand.h" -#include +#include "sharedmemory.h" #include #include @@ -37,7 +37,7 @@ namespace QmlDesigner { -static QCache globalSharedMemoryCache(10000); +static QCache globalSharedMemoryCache(10000); ValuesChangedCommand::ValuesChangedCommand() : m_keyNumber(0) @@ -63,7 +63,7 @@ quint32 ValuesChangedCommand::keyNumber() const void ValuesChangedCommand::removeSharedMemorys(const QVector &keyNumberVector) { foreach (qint32 keyNumber, keyNumberVector) { - QSharedMemory *sharedMemory = globalSharedMemoryCache.take(keyNumber); + SharedMemory *sharedMemory = globalSharedMemoryCache.take(keyNumber); delete sharedMemory; } } @@ -75,17 +75,11 @@ void ValuesChangedCommand::sort() static const QLatin1String valueKeyTemplateString("Values-%1"); -static QSharedMemory *createSharedMemory(qint32 key, int byteCount) +static SharedMemory *createSharedMemory(qint32 key, int byteCount) { - QSharedMemory *sharedMemory = new QSharedMemory(QString(valueKeyTemplateString).arg(key)); + SharedMemory *sharedMemory = new SharedMemory(QString(valueKeyTemplateString).arg(key)); bool sharedMemoryIsCreated = sharedMemory->create(byteCount); - if (!sharedMemoryIsCreated) { - if (sharedMemory->isAttached()) - sharedMemory->attach(); - sharedMemory->detach(); - sharedMemoryIsCreated = sharedMemory->create(byteCount); - } if (sharedMemoryIsCreated) { globalSharedMemoryCache.insert(key, sharedMemory); @@ -109,12 +103,13 @@ QDataStream &operator<<(QDataStream &out, const ValuesChangedCommand &command) temporaryOutDataStream << command.valueChanges(); - QSharedMemory *sharedMemory = createSharedMemory(keyCounter, outDataStreamByteArray.size()); + SharedMemory *sharedMemory = createSharedMemory(keyCounter, outDataStreamByteArray.size()); if (sharedMemory) { sharedMemory->lock(); std::memcpy(sharedMemory->data(), outDataStreamByteArray.constData(), sharedMemory->size()); sharedMemory->unlock(); + out << command.keyNumber(); return out; } @@ -128,13 +123,18 @@ QDataStream &operator<<(QDataStream &out, const ValuesChangedCommand &command) void readSharedMemory(qint32 key, QVector *valueChangeVector) { - QSharedMemory sharedMemory(QString(valueKeyTemplateString).arg(key)); + SharedMemory sharedMemory(QString(valueKeyTemplateString).arg(key)); bool canAttach = sharedMemory.attach(QSharedMemory::ReadOnly); if (canAttach) { + sharedMemory.lock(); + QDataStream in(QByteArray::fromRawData(static_cast(sharedMemory.constData()), sharedMemory.size())); in.setVersion(QDataStream::Qt_4_8); in >> *valueChangeVector; + + sharedMemory.unlock(); + sharedMemory.detach(); } } diff --git a/share/qtcreator/qml/qmlpuppet/container/container.pri b/share/qtcreator/qml/qmlpuppet/container/container.pri index 8889196708..51bbb43aec 100644 --- a/share/qtcreator/qml/qmlpuppet/container/container.pri +++ b/share/qtcreator/qml/qmlpuppet/container/container.pri @@ -1,21 +1,24 @@ INCLUDEPATH += $$PWD/ HEADERS += $$PWD/addimportcontainer.h +HEADERS += $$PWD/sharedmemory.h HEADERS += $$PWD/imagecontainer.h HEADERS += $$PWD/idcontainer.h HEADERS += $$PWD/informationcontainer.h HEADERS += $$PWD/instancecontainer.h HEADERS += $$PWD/reparentcontainer.h -HEADERS += $$PWD/propertyabstractcontainer.h -HEADERS += $$PWD/propertybindingcontainer.h -HEADERS += $$PWD/propertyvaluecontainer.h +HEADERS += $$PWD/propertyabstractcontainer.h +HEADERS += $$PWD/propertybindingcontainer.h +HEADERS += $$PWD/propertyvaluecontainer.h -SOURCES += $$PWD/addimportcontainer.cpp -SOURCES += $$PWD/imagecontainer.cpp -SOURCES += $$PWD/idcontainer.cpp -SOURCES += $$PWD/informationcontainer.cpp -SOURCES += $$PWD/instancecontainer.cpp -SOURCES += $$PWD/reparentcontainer.cpp -SOURCES += $$PWD/propertyabstractcontainer.cpp -SOURCES += $$PWD/propertybindingcontainer.cpp -SOURCES += $$PWD/propertyvaluecontainer.cpp +SOURCES += $$PWD/addimportcontainer.cpp +unix:SOURCES += $$PWD/sharedmemory_unix.cpp +!unix:SOURCES += $$PWD/sharedmemory_qt.cpp +SOURCES += $$PWD/imagecontainer.cpp +SOURCES += $$PWD/idcontainer.cpp +SOURCES += $$PWD/informationcontainer.cpp +SOURCES += $$PWD/instancecontainer.cpp +SOURCES += $$PWD/reparentcontainer.cpp +SOURCES += $$PWD/propertyabstractcontainer.cpp +SOURCES += $$PWD/propertybindingcontainer.cpp +SOURCES += $$PWD/propertyvaluecontainer.cpp diff --git a/share/qtcreator/qml/qmlpuppet/container/imagecontainer.cpp b/share/qtcreator/qml/qmlpuppet/container/imagecontainer.cpp index b312c39702..031602e75c 100644 --- a/share/qtcreator/qml/qmlpuppet/container/imagecontainer.cpp +++ b/share/qtcreator/qml/qmlpuppet/container/imagecontainer.cpp @@ -29,7 +29,7 @@ #include "imagecontainer.h" -#include +#include "sharedmemory.h" #include #include @@ -42,7 +42,7 @@ namespace QmlDesigner { -static QCache globalSharedMemoryCache(10000); +static QCache globalSharedMemoryCache(10000); ImageContainer::ImageContainer() : m_instanceId(-1), @@ -82,41 +82,52 @@ void ImageContainer::setImage(const QImage &image) void ImageContainer::removeSharedMemorys(const QVector &keyNumberVector) { foreach (qint32 keyNumber, keyNumberVector) { - QSharedMemory *sharedMemory = globalSharedMemoryCache.take(keyNumber); + SharedMemory *sharedMemory = globalSharedMemoryCache.take(keyNumber); delete sharedMemory; } } static const QLatin1String imageKeyTemplateString("Image-%1"); -static QSharedMemory *createSharedMemory(qint32 key, int byteCount) +static SharedMemory *createSharedMemory(qint32 key, int byteCount) { - QSharedMemory *sharedMemory = globalSharedMemoryCache.take(key); - - if (sharedMemory == 0) - sharedMemory = new QSharedMemory(QString(imageKeyTemplateString).arg(key)); - - bool sharedMemoryIsCreated = sharedMemory->isAttached(); - if (!sharedMemoryIsCreated) - sharedMemoryIsCreated = sharedMemory->attach(); - - bool sharedMemorySizeIsSmallerThanByteCount = sharedMemory->size() < byteCount; - bool sharedMemorySizeIsDoubleBiggerThanByteCount = sharedMemory->size() * 2 > byteCount; - - if (!sharedMemoryIsCreated || sharedMemorySizeIsSmallerThanByteCount || sharedMemorySizeIsDoubleBiggerThanByteCount) { - sharedMemory->detach(); - sharedMemoryIsCreated = sharedMemory->create(byteCount); - } - - if (sharedMemoryIsCreated) { - globalSharedMemoryCache.insert(key, sharedMemory); - return sharedMemory; + SharedMemory *sharedMemory = globalSharedMemoryCache.take(key); + + if (sharedMemory == 0) { + sharedMemory = new SharedMemory(QString(imageKeyTemplateString).arg(key)); + bool sharedMemoryIsCreated = sharedMemory->create(byteCount); + if (sharedMemoryIsCreated) { + globalSharedMemoryCache.insert(key, sharedMemory); + } else { + delete sharedMemory; + sharedMemory = 0; + } + } else { + bool sharedMemoryIsAttached = sharedMemory->isAttached(); + if (!sharedMemoryIsAttached) + sharedMemoryIsAttached = sharedMemory->attach(); + + bool sharedMemorySizeIsSmallerThanByteCount = sharedMemory->size() < byteCount; + bool sharedMemorySizeIsDoubleBiggerThanByteCount = sharedMemory->size() > (byteCount * 2); + + if (!sharedMemoryIsAttached) { + sharedMemory->create(byteCount); + } else if (sharedMemorySizeIsSmallerThanByteCount || sharedMemorySizeIsDoubleBiggerThanByteCount) { + sharedMemory->detach(); + sharedMemory->create(byteCount); + } + + if (!sharedMemory->isAttached()) { + globalSharedMemoryCache.remove(key); + delete sharedMemory; + sharedMemory = 0; + } } - return 0; + return sharedMemory; } -static void writeSharedMemory(QSharedMemory *sharedMemory, const QImage &image) +static void writeSharedMemory(SharedMemory *sharedMemory, const QImage &image) { sharedMemory->lock(); @@ -129,7 +140,6 @@ static void writeSharedMemory(QSharedMemory *sharedMemory, const QImage &image) std::memcpy(sharedMemory->data(), headerData, 20); std::memcpy(reinterpret_cast(sharedMemory->data()) + 20, image.constBits(), image.byteCount()); - sharedMemory->unlock(); } @@ -156,7 +166,7 @@ QDataStream &operator<<(QDataStream &out, const ImageContainer &container) out << qint32(0); writeStream(out, image); } else { - QSharedMemory *sharedMemory = createSharedMemory(container.keyNumber(), image.byteCount() + extraDataSize); + SharedMemory *sharedMemory = createSharedMemory(container.keyNumber(), image.byteCount() + extraDataSize); out << qint32(sharedMemory != 0); // send if shared memory is used @@ -171,7 +181,7 @@ QDataStream &operator<<(QDataStream &out, const ImageContainer &container) static void readSharedMemory(qint32 key, ImageContainer &container) { - QSharedMemory sharedMemory(QString(imageKeyTemplateString).arg(key)); + SharedMemory sharedMemory(QString(imageKeyTemplateString).arg(key)); bool canAttach = sharedMemory.attach(QSharedMemory::ReadOnly); @@ -194,6 +204,7 @@ static void readSharedMemory(qint32 key, ImageContainer &container) container.setImage(image); sharedMemory.unlock(); + sharedMemory.detach(); } } diff --git a/share/qtcreator/qml/qmlpuppet/container/sharedmemory.h b/share/qtcreator/qml/qmlpuppet/container/sharedmemory.h new file mode 100644 index 0000000000..32815b65ae --- /dev/null +++ b/share/qtcreator/qml/qmlpuppet/container/sharedmemory.h @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#ifndef QMLDESIGNER_SHAREDMEMORY_H +#define QMLDESIGNER_SHAREDMEMORY_H + +#include +#include + +namespace QmlDesigner { + +class SharedMemory +{ + friend class SharedMemoryLocker; +public: + SharedMemory(); + SharedMemory(const QString &key); + ~SharedMemory(); + + void setKey(const QString &key); + QString key() const; + + bool create(int size, QSharedMemory::AccessMode mode = QSharedMemory::ReadWrite); + int size() const; + + bool attach(QSharedMemory::AccessMode mode = QSharedMemory::ReadWrite); + bool isAttached() const; + bool detach(); + + void *data(); + const void* constData() const; + const void *data() const; + + bool lock(); + bool unlock(); + + QSharedMemory::SharedMemoryError error() const; + QString errorString() const; + +protected: +#ifdef Q_OS_UNIX + bool initKeyInternal(); + bool cleanHandleInternal(); + bool createInternal(QSharedMemory::AccessMode mode, int size); + bool attachInternal(QSharedMemory::AccessMode mode); + bool detachInternal(); + int handle(); + + void setErrorString(const QString &function); +#endif +private: +#ifndef Q_OS_UNIX + QSharedMemory m_sharedMemory; +#else + void *m_memory; + int m_size; + QString m_key; + QByteArray m_nativeKey; + QSharedMemory::SharedMemoryError m_error; + QString m_errorString; + QSystemSemaphore m_systemSemaphore; + bool m_lockedByMe; + int m_fileHandle; + bool m_createdByMe; +#endif +}; + +} // namespace QmlDesigner + +#endif // QMLDESIGNER_SHAREDMEMORY_H diff --git a/share/qtcreator/qml/qmlpuppet/container/sharedmemory_qt.cpp b/share/qtcreator/qml/qmlpuppet/container/sharedmemory_qt.cpp new file mode 100644 index 0000000000..78923658d8 --- /dev/null +++ b/share/qtcreator/qml/qmlpuppet/container/sharedmemory_qt.cpp @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#include "sharedmemory.h" + +namespace QmlDesigner { + +SharedMemory::SharedMemory() +{ +} + +SharedMemory::SharedMemory(const QString &key) + : m_sharedMemory(key) +{ +} + +SharedMemory::~SharedMemory() +{ +} + +void SharedMemory::setKey(const QString &key) +{ + m_sharedMemory.setKey(key); +} + +QString SharedMemory::key() const +{ + return m_sharedMemory.key(); +} + +bool SharedMemory::create(int size, QSharedMemory::AccessMode mode) +{ + return m_sharedMemory.create(size, mode); +} + +int SharedMemory::size() const +{ + return m_sharedMemory.size(); +} + +bool SharedMemory::attach(QSharedMemory::AccessMode mode) +{ + return m_sharedMemory.attach(mode); +} + +bool SharedMemory::isAttached() const +{ + return m_sharedMemory.isAttached(); +} + +bool SharedMemory::detach() +{ + return m_sharedMemory.detach(); +} + +void *SharedMemory::data() +{ + return m_sharedMemory.data(); +} + +const void *SharedMemory::constData() const +{ + return m_sharedMemory.constData(); +} + +const void *SharedMemory::data() const +{ + return m_sharedMemory.data(); +} + +bool SharedMemory::lock() +{ + return m_sharedMemory.lock(); +} + +bool SharedMemory::unlock() +{ + return m_sharedMemory.unlock(); +} + +QSharedMemory::SharedMemoryError SharedMemory::error() const +{ + return m_sharedMemory.error(); +} + +QString SharedMemory::errorString() const +{ + return m_sharedMemory.errorString(); +} + +} // namespace QmlDesigner diff --git a/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp b/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp new file mode 100644 index 0000000000..cbc5635ad0 --- /dev/null +++ b/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp @@ -0,0 +1,488 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#include "sharedmemory.h" +#include +#include + +#include "qplatformdefs.h" + +#include + +#include +#include /* For mode constants */ +#include /* For O_* constants */ + +#include +#include +#ifdef Q_OS_OSX +#include +#endif +#include +#include + +#include + +#ifdef Q_OS_OSX +#define NAME_MAX PSHMNAMLEN +#endif + +namespace QmlDesigner { + +class SharedMemoryLocker +{ +public: + SharedMemoryLocker(SharedMemory *sharedMemory) : m_sharedMemory(sharedMemory) + { + Q_ASSERT(m_sharedMemory); + } + + ~SharedMemoryLocker() + { + if (m_sharedMemory) + m_sharedMemory->unlock(); + } + + bool lock() + { + if (m_sharedMemory && m_sharedMemory->lock()) + return true; + m_sharedMemory = 0; + return false; + } + + bool tryLocker(const QString function) { + if (!lock()) { + m_sharedMemory->m_errorString = QStringLiteral("%1: unable to lock").arg(function); + m_sharedMemory->m_error = QSharedMemory::LockError; + return false; + } + return true; + } + +private: + SharedMemory *m_sharedMemory; +}; + +static QByteArray makePlatformSafeKey(const QString &key) +{ + if (key.isEmpty()) + return QByteArray(); + + return QCryptographicHash::hash(key.toLatin1(), QCryptographicHash::Sha1).toBase64(QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals); +} + + +SharedMemory::SharedMemory() + : m_memory(0), + m_size(0), + m_error(QSharedMemory::NoError), + m_systemSemaphore(QString()), + m_lockedByMe(false), + m_fileHandle(-1), + m_createdByMe(false) +{ +} + +SharedMemory::SharedMemory(const QString &key) + : m_memory(0), + m_size(0), + m_error(QSharedMemory::NoError), + m_systemSemaphore(QString()), + m_lockedByMe(false), + m_fileHandle(-1), + m_createdByMe(false) +{ + setKey(key); +} + +SharedMemory::~SharedMemory() +{ + if (m_memory) { + munmap(m_memory, m_size); + } + + if (m_fileHandle != -1) { + close(m_fileHandle); + if (m_createdByMe) + shm_unlink(m_nativeKey); + } + + setKey(QString()); +} + +void SharedMemory::setKey(const QString &key) +{ + if (key == m_key && makePlatformSafeKey(key) == m_nativeKey) + return; + + if (isAttached()) + detach(); + cleanHandleInternal(); + m_key = key; + m_nativeKey = makePlatformSafeKey(key); +} + +QString SharedMemory::key() const +{ + return m_key; +} + +bool SharedMemory::create(int size, QSharedMemory::AccessMode mode) +{ + if (!initKeyInternal()) + return false; + + + m_systemSemaphore.setKey(m_key, 1, QSystemSemaphore::Create); + + + QString function = QLatin1String("SharedMemory::create"); + + SharedMemoryLocker lock(this); + if (!m_key.isNull() && !lock.tryLocker(function)) + return false; + + if (size <= 0) { + m_error = QSharedMemory::InvalidSize; + m_errorString = QStringLiteral("%1: create size is less then 0").arg(function); + return false; + } + + return createInternal(mode ,size); +} + +int SharedMemory::size() const +{ + return m_size; +} + +bool SharedMemory::attach(QSharedMemory::AccessMode mode) +{ + if (isAttached() || !initKeyInternal()) + return false; + + SharedMemoryLocker lock(this); + if (!m_key.isNull() && !lock.tryLocker(QStringLiteral("SharedMemory::attach"))) + return false; + + if (isAttached() || !handle()) + return false; + + return attachInternal(mode); +} + + +bool SharedMemory::isAttached() const +{ + return (0 != m_memory); +} + +bool SharedMemory::detach() +{ + if (!isAttached()) + return false; + + SharedMemoryLocker lock(this); + if (!m_key.isNull() && !lock.tryLocker(QStringLiteral("SharedMemory::detach"))) + return false; + + return detachInternal(); +} + +void *SharedMemory::data() +{ + return m_memory; +} + +const void* SharedMemory::constData() const +{ + return m_memory; +} + +const void *SharedMemory::data() const +{ + return m_memory; +} + +bool SharedMemory::lock() +{ + if (m_lockedByMe) { + qWarning("SharedMemory::lock: already locked"); + return true; + } + if (m_systemSemaphore.acquire()) { + m_lockedByMe = true; + return true; + } + QString function = QStringLiteral("SharedMemory::lock"); + m_errorString = QStringLiteral("%1: unable to lock").arg(function); + m_error = QSharedMemory::LockError; + return false; +} + +bool SharedMemory::unlock() +{ + if (!m_lockedByMe) + return false; + m_lockedByMe = false; + if (m_systemSemaphore.release()) + return true; + QString function = QStringLiteral("SharedMemory::unlock"); + m_errorString = QStringLiteral("%1: unable to unlock").arg(function); + m_error = QSharedMemory::LockError; + return false; +} + +QSharedMemory::SharedMemoryError SharedMemory::error() const +{ + return m_error; +} + +QString SharedMemory::errorString() const +{ + return m_errorString; +} + +void SharedMemory::setErrorString(const QString &function) +{ + // EINVAL is handled in functions so they can give better error strings + switch (errno) { + case EACCES: + m_errorString = QStringLiteral("%1: permission denied").arg(function); + m_error = QSharedMemory::PermissionDenied; + break; + case EEXIST: + m_errorString = QStringLiteral("%1: already exists").arg(function); + m_error = QSharedMemory::AlreadyExists; + break; + case ENOENT: + m_errorString = QStringLiteral("%1: doesn't exist").arg(function); + m_error = QSharedMemory::NotFound; + break; + case EMFILE: + case ENOMEM: + case ENOSPC: + m_errorString = QStringLiteral("%1: out of resources").arg(function); + m_error = QSharedMemory::OutOfResources; + break; + default: + m_errorString = QStringLiteral("%1: unknown error %2").arg(function).arg(strerror(errno)); + m_error = QSharedMemory::UnknownError; + } +} + +bool SharedMemory::initKeyInternal() +{ + if (!cleanHandleInternal()) + return false; + + m_systemSemaphore.setKey(QString(), 1); + m_systemSemaphore.setKey(m_key, 1); + if (m_systemSemaphore.error() != QSystemSemaphore::NoError) { + m_errorString = QStringLiteral("SharedMemoryPrivate::initKey: unable to set key on lock"); + switch (m_systemSemaphore.error()) { + case QSystemSemaphore::PermissionDenied: + m_error = QSharedMemory::PermissionDenied; + break; + case QSystemSemaphore::KeyError: + m_error = QSharedMemory::KeyError; + break; + case QSystemSemaphore::AlreadyExists: + m_error = QSharedMemory::AlreadyExists; + break; + case QSystemSemaphore::NotFound: + m_error = QSharedMemory::NotFound; + break; + case QSystemSemaphore::OutOfResources: + m_error = QSharedMemory::OutOfResources; + break; + case QSystemSemaphore::UnknownError: + default: + m_error = QSharedMemory::UnknownError; + break; + } + + return false; + } + + m_errorString = QString(); + m_error = QSharedMemory::NoError; + return true; +} + +int SharedMemory::handle() +{ + return m_fileHandle; +} + +bool SharedMemory::cleanHandleInternal() +{ + m_fileHandle = -1; + return true; +} + +bool SharedMemory::createInternal(QSharedMemory::AccessMode mode, int size) +{ + detachInternal(); + +#ifdef Q_OS_OSX + if (m_fileHandle > -1 && m_createdByMe) { + close(m_fileHandle); + shm_unlink(m_nativeKey.constData()); + m_fileHandle = -1; + } +#endif + + if (m_fileHandle == -1) { + int permission = mode == QSharedMemory::ReadOnly ? O_RDONLY : O_RDWR; + m_fileHandle = shm_open(m_nativeKey.constData(), O_CREAT | permission, 0666); + + if (m_fileHandle == -1) { + switch (errno) { + case EINVAL: + m_errorString = QStringLiteral("QSharedMemory::create: key is not invalid"); + m_error = QSharedMemory::KeyError; + break; + case EMFILE: + m_errorString = QStringLiteral("QSharedMemory::create: maximum file limit reached"); + m_error = QSharedMemory::UnknownError; + break; + case ENAMETOOLONG: + m_errorString = QStringLiteral("QSharedMemory::create: key is to long"); + m_error = QSharedMemory::KeyError; + break; + default: + setErrorString(QStringLiteral("SharedMemory::create")); + } + return false; + } + + m_createdByMe = true; + } + + struct stat statBuffer; + fstat(m_fileHandle, &statBuffer); + int fileSize = statBuffer.st_size; + + if (fileSize < size) { + int returnValue = ftruncate(m_fileHandle, size); + if (returnValue == -1) { + switch (errno) { + case EFBIG: + m_errorString = QStringLiteral("QSharedMemory::create: size is to large"); + m_error = QSharedMemory::InvalidSize; + break; + default: + setErrorString(QStringLiteral("SharedMemory::create")); + } + + close(m_fileHandle); + shm_unlink(m_nativeKey.constData()); + m_fileHandle = -1; + m_size = 0; + + return false; + } + } + + int protection = mode == QSharedMemory::ReadOnly ? PROT_READ : PROT_WRITE; + m_memory = mmap(0, size, protection, MAP_SHARED, m_fileHandle, 0); + + if (m_memory == MAP_FAILED) { + close(m_fileHandle); + shm_unlink(m_nativeKey.constData()); + m_memory = 0; + m_fileHandle = -1; + m_size = 0; + + return false; + } + + m_size = size; + + return true; +} + +bool SharedMemory::attachInternal(QSharedMemory::AccessMode mode) +{ + if (m_fileHandle == -1) { + int permission = mode == QSharedMemory::ReadOnly ? O_RDONLY : O_RDWR; + m_fileHandle = shm_open(m_nativeKey.constData(), permission, 0666); + if (m_fileHandle == -1) { + switch (errno) { + case EINVAL: + m_errorString = QStringLiteral("QSharedMemory::attach: key is invalid"); + m_error = QSharedMemory::KeyError; + break; + case EMFILE: + m_errorString = QStringLiteral("QSharedMemory::attach: maximum file limit reached"); + m_error = QSharedMemory::UnknownError; + break; + case ENAMETOOLONG: + m_errorString = QStringLiteral("QSharedMemory::attach: key is to long"); + m_error = QSharedMemory::KeyError; + break; + default: + setErrorString(QStringLiteral("SharedMemory::attach")); + } + return false; + } + } + + struct stat statBuffer; + fstat(m_fileHandle, &statBuffer); + int size = statBuffer.st_size; + + int protection = mode == QSharedMemory::ReadOnly ? PROT_READ : PROT_WRITE; + m_memory = mmap(0, size, protection, MAP_SHARED, m_fileHandle, 0); + + if (m_memory == MAP_FAILED) { + m_memory = 0; + + return false; + } + + m_size = size; + + return true; +} + +bool SharedMemory::detachInternal() +{ + if (m_memory) { + munmap(m_memory, m_size); + m_memory = 0; + m_size = 0; + } + + return false; +} + +} // namespace QmlDesigner diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri b/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri index 466507e455..924c015db6 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri @@ -14,7 +14,7 @@ QT += core-private qml-private quick-private gui-private QT += v8-private } -!macx { +!osx { CONFIG += c++11 } @@ -41,8 +41,9 @@ DEFINES -= QT_NO_CAST_FROM_ASCII OTHER_FILES += Info.plist +unix:!osx:LIBS += -lrt # posix shared memory -macx { +osx { CONFIG -= app_bundle QMAKE_LFLAGS += -sectcreate __TEXT __info_plist $$system_quote($$PWD/Info.plist) } else { diff --git a/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri b/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri index d54a5b4e3f..6b9a19bfd6 100644 --- a/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri +++ b/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri @@ -22,6 +22,8 @@ SOURCES += $$PWD/qmlpuppetmain.cpp RESOURCES += $$PWD/../qmlpuppet.qrc DEFINES -= QT_NO_CAST_FROM_ASCII +unix:!osx:LIBS += -lrt # posix shared memory + OTHER_FILES += Info.plist macx { CONFIG -= app_bundle diff --git a/src/plugins/qmldesigner/qmldesignerplugin.pro b/src/plugins/qmldesigner/qmldesignerplugin.pro index c2512a171d..190a8d6582 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.pro +++ b/src/plugins/qmldesigner/qmldesignerplugin.pro @@ -3,6 +3,8 @@ CONFIG += exceptions INCLUDEPATH += $$PWD +unix:!osx:LIBS += -lrt # posix shared memory + include(../../qtcreatorplugin.pri) include(designercore/designercore-lib.pri) -- cgit v1.2.1 From 1c4b960d51fe24be2a78a32ebf4eee62332a5652 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 30 Jul 2014 14:27:13 +0200 Subject: QmlDesigner: Always use fall back puppet Task-number: QTCREATORBUG-12758 Change-Id: I7ac35ac513081ce37354c3151522463e17e59818 Reviewed-by: Tim Jenssen --- .../designercore/instances/puppetcreator.cpp | 40 +++++++++------------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp b/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp index bbed270ba8..c1fa25344f 100644 --- a/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp +++ b/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp @@ -243,34 +243,31 @@ static void warnAboutInvalidKit() void PuppetCreator::createQml1PuppetExecutableIfMissing() { + m_availablePuppetType = FallbackPuppet; + if (!m_useOnlyFallbackPuppet && m_kit) { - if (m_qml1PuppetForKitPuppetHash.contains(m_kit->id())) { - m_availablePuppetType = m_qml1PuppetForKitPuppetHash.value(m_kit->id()); - } else if (checkQmlpuppetIsReady()) { - m_availablePuppetType = UserSpacePuppet; + if (m_qml1PuppetForKitPuppetHash.contains(m_kit->id())) { + m_availablePuppetType = m_qml1PuppetForKitPuppetHash.value(m_kit->id()); + } else if (checkQmlpuppetIsReady()) { + m_availablePuppetType = UserSpacePuppet; + } else { + if (m_kit->isValid()) { + bool buildSucceeded = build(qmlPuppetProjectFile()); + if (buildSucceeded) + m_availablePuppetType = UserSpacePuppet; } else { - if (m_kit->isValid()) { - - bool buildSucceeded = build(qmlPuppetProjectFile()); - if (buildSucceeded) - m_availablePuppetType = UserSpacePuppet; - else - m_availablePuppetType = FallbackPuppet; - } else { - warnAboutInvalidKit(); - m_availablePuppetType = FallbackPuppet; - } - m_qml1PuppetForKitPuppetHash.insert(m_kit->id(), m_availablePuppetType); + warnAboutInvalidKit(); } - } else { - m_availablePuppetType = FallbackPuppet; + m_qml1PuppetForKitPuppetHash.insert(m_kit->id(), m_availablePuppetType); + } } } void PuppetCreator::createQml2PuppetExecutableIfMissing() { - if (!m_useOnlyFallbackPuppet && m_kit) { + m_availablePuppetType = FallbackPuppet; + if (!m_useOnlyFallbackPuppet && m_kit) { if (m_qml2PuppetForKitPuppetHash.contains(m_kit->id())) { m_availablePuppetType = m_qml2PuppetForKitPuppetHash.value(m_kit->id()); } else if (checkQml2PuppetIsReady()) { @@ -280,16 +277,11 @@ void PuppetCreator::createQml2PuppetExecutableIfMissing() bool buildSucceeded = build(qml2PuppetProjectFile()); if (buildSucceeded) m_availablePuppetType = UserSpacePuppet; - else - m_availablePuppetType = FallbackPuppet; } else { warnAboutInvalidKit(); - m_availablePuppetType = FallbackPuppet; } m_qml2PuppetForKitPuppetHash.insert(m_kit->id(), m_availablePuppetType); } - } else { - m_availablePuppetType = FallbackPuppet; } } -- cgit v1.2.1 From bb42157f04639a29b1521d33899bf377c1b7eb80 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Thu, 31 Jul 2014 16:53:32 +0200 Subject: Android: Prevent crash if running on a terget without deployconfiguration Should be impossible to do, but the stacktrace in the linked task shows that it is possible somehow. Task-number: QTCREATORBUG-12776 Change-Id: I1f2054bbaa132c29dfc4579fb7020f364bddd939 Reviewed-by: BogDan Vatra --- src/plugins/android/androidglobal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/android/androidglobal.h b/src/plugins/android/androidglobal.h index dc93a878b4..f8f29e1b1a 100644 --- a/src/plugins/android/androidglobal.h +++ b/src/plugins/android/androidglobal.h @@ -47,6 +47,8 @@ public: template static T *buildStep(const ProjectExplorer::DeployConfiguration *dc) { + if (!dc) + return 0; ProjectExplorer::BuildStepList *bsl = dc->stepList(); if (!bsl) return 0; -- cgit v1.2.1 From 3d06c00e9b63d7b1f287d479a4d67a909919a443 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Thu, 31 Jul 2014 14:21:15 +0200 Subject: QmlDesigner: use explicit build type for puppet creation Change-Id: Ibeba1cc874ddfd083113249a408caa05e1e012a5 Reviewed-by: Marco Bubke --- src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp b/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp index c1fa25344f..48249a07ba 100644 --- a/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp +++ b/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp @@ -194,7 +194,9 @@ bool PuppetCreator::build(const QString &qmlPuppetProjectFilePath) const qmakeArguments.append(QStringLiteral("-r")); qmakeArguments.append(QStringLiteral("-after")); qmakeArguments.append(QStringLiteral("DESTDIR=") + qmlPuppetDirectory(UserSpacePuppet)); -#ifndef QT_DEBUG +#ifdef QT_DEBUG + qmakeArguments.append(QStringLiteral("CONFIG+=debug")); +#else qmakeArguments.append(QStringLiteral("CONFIG+=release")); #endif qmakeArguments.append(qmlPuppetProjectFilePath); -- cgit v1.2.1 From 434389bd930d4e7b17a2099a1f51f092cf9f8755 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 31 Jul 2014 13:59:09 +0200 Subject: Make strings translatable Change-Id: I1dc1d306d0c1e8070e75a73c23f622389f06fad1 Reviewed-by: Oswald Buddenhagen Reviewed-by: hjk --- src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h | 2 ++ src/plugins/debugger/commonoptionspage.cpp | 4 ++++ src/plugins/debugger/commonoptionspage.h | 2 ++ 3 files changed, 8 insertions(+) diff --git a/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h b/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h index 16096a1494..06834ada17 100644 --- a/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h +++ b/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h @@ -43,6 +43,8 @@ namespace Internal { class BareMetalDeviceConfigurationWizardSetupPage : public QWizardPage { + Q_OBJECT + public: explicit BareMetalDeviceConfigurationWizardSetupPage(QWidget *parent = 0); diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp index 090d7eca2b..23a30e75e7 100644 --- a/src/plugins/debugger/commonoptionspage.cpp +++ b/src/plugins/debugger/commonoptionspage.cpp @@ -55,6 +55,8 @@ namespace Internal { class CommonOptionsPageWidget : public QWidget { + Q_OBJECT + public: explicit CommonOptionsPageWidget(const QSharedPointer &group); @@ -431,3 +433,5 @@ QWidget *LocalsAndExpressionsOptionsPage::widget() } // namespace Internal } // namespace Debugger + +#include "commonoptionspage.moc" diff --git a/src/plugins/debugger/commonoptionspage.h b/src/plugins/debugger/commonoptionspage.h index ea87caa9c2..e444d22f8f 100644 --- a/src/plugins/debugger/commonoptionspage.h +++ b/src/plugins/debugger/commonoptionspage.h @@ -86,6 +86,8 @@ private: class LocalsAndExpressionsOptionsPage : public Core::IOptionsPage { + Q_OBJECT + public: LocalsAndExpressionsOptionsPage(); -- cgit v1.2.1 From 92cdd7045b48ea6140341f7f0cb0f591d2c0a351 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Thu, 31 Jul 2014 16:36:46 +0200 Subject: CmakeProject: Don't crash on addKit + cancel This was introduced by adding the remote linux support for 3.0 in 328a24edee3008a8d6bbbc7f57ac064bcd806d37. If the user cancels the run cmake dialog, no buildconfiguration is created. The adding of kit should then not happen. A target without a buildconfiguration should not happen. Task-number: QTCREATORBUG-12773 Change-Id: Ic43c5cc13f9e114ea24cc97154a6c084125f6318 Reviewed-by: Christian Stenger --- src/plugins/cmakeprojectmanager/cmakeproject.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 5a96b62270..6ae4e4e5f1 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -604,6 +604,8 @@ bool CMakeProject::fromMap(const QVariantMap &map) bool CMakeProject::setupTarget(Target *t) { t->updateDefaultBuildConfigurations(); + if (t->buildConfigurations().isEmpty()) + return false; t->updateDefaultDeployConfigurations(); return true; -- cgit v1.2.1 From 1a26446186b19fadc0592a4b12d2830d4995cbd3 Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Thu, 31 Jul 2014 15:11:58 +0200 Subject: qmljs: do not try to dump without uri qmlplugindump --path always fails, so skip it Change-Id: Ica2d25c864104aa77efbc26913b079c98ff5e283 Reviewed-by: Kai Koehne --- src/libs/qmljs/qmljsplugindumper.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/libs/qmljs/qmljsplugindumper.cpp b/src/libs/qmljs/qmljsplugindumper.cpp index bdd6c63cf4..18fb1666ed 100644 --- a/src/libs/qmljs/qmljsplugindumper.cpp +++ b/src/libs/qmljs/qmljsplugindumper.cpp @@ -465,18 +465,13 @@ void PluginDumper::dump(const Plugin &plugin) connect(process, SIGNAL(finished(int)), SLOT(qmlPluginTypeDumpDone(int))); connect(process, SIGNAL(error(QProcess::ProcessError)), SLOT(qmlPluginTypeDumpError(QProcess::ProcessError))); QStringList args; - if (plugin.importUri.isEmpty()) { - args << QLatin1String("--path"); - args << plugin.importPath; - if (ComponentVersion(plugin.importVersion).isValid()) - args << plugin.importVersion; - } else { - if (info.qmlDumpHasRelocatableFlag) - args << QLatin1String("-relocatable"); - args << plugin.importUri; - args << plugin.importVersion; - args << plugin.importPath; - } + if (plugin.importUri.isEmpty()) + return; // dumping with --path always fails + if (info.qmlDumpHasRelocatableFlag) + args << QLatin1String("-relocatable"); + args << plugin.importUri; + args << plugin.importVersion; + args << plugin.importPath; process->start(info.qmlDumpPath, args); m_runningQmldumps.insert(process, plugin.qmldirPath); } -- cgit v1.2.1 From 2bfd14dbf855f1f585a6a1c2b90c87cd076261d0 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Fri, 1 Aug 2014 10:38:03 +0200 Subject: QmlPuppet: Fix compile with Qt older than 5.2 Change-Id: I0ef3c5e374b1b01c22b553b99dfbd8eb7783fa90 Reviewed-by: Christian Stenger Reviewed-by: Tim Jenssen --- .../qml/qmlpuppet/container/sharedmemory_unix.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp b/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp index cbc5635ad0..a685b9fd40 100644 --- a/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp +++ b/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp @@ -53,6 +53,14 @@ #define NAME_MAX PSHMNAMLEN #endif +#ifndef QStringLiteral +#define QStringLiteral(str) QString::fromUtf8(str) +#endif + +#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) +#include +#endif + namespace QmlDesigner { class SharedMemoryLocker @@ -94,8 +102,17 @@ static QByteArray makePlatformSafeKey(const QString &key) { if (key.isEmpty()) return QByteArray(); +#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) + QByteArray data(QCryptographicHash::hash(key.toLatin1(), QCryptographicHash::Sha1).toBase64()); + QString ambiguousChars(QStringLiteral("[=~<>|?*!@#$%^&:,; \\\\]")); + + QByteArray normalizedData; + normalizedData = QString(data).replace(QRegExp(ambiguousChars), QStringLiteral("_")).toLatin1(); + return normalizedData; +#else return QCryptographicHash::hash(key.toLatin1(), QCryptographicHash::Sha1).toBase64(QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals); +#endif } -- cgit v1.2.1 From 186f82a730a2bdc46d0845ae3f4a845c391b7082 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Fri, 1 Aug 2014 11:13:13 +0200 Subject: QmlDesigner: SharedMemory key needs to be the same with all Qts Change-Id: I7b514e3d21f0874fec35331e7fd73c209e9b30d7 Reviewed-by: Christian Stenger --- share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp b/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp index a685b9fd40..9269f7a9e3 100644 --- a/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp +++ b/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp @@ -102,17 +102,13 @@ static QByteArray makePlatformSafeKey(const QString &key) { if (key.isEmpty()) return QByteArray(); -#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) QByteArray data(QCryptographicHash::hash(key.toLatin1(), QCryptographicHash::Sha1).toBase64()); - QString ambiguousChars(QStringLiteral("[=~<>|?*!@#$%^&:,; \\\\]")); + QString notBase64UrlChars(QStringLiteral("[=+/]")); QByteArray normalizedData; - normalizedData = QString(data).replace(QRegExp(ambiguousChars), QStringLiteral("_")).toLatin1(); + normalizedData = QString(data).replace(QRegExp(notBase64UrlChars), QStringLiteral("_")).toLatin1(); return normalizedData; -#else - return QCryptographicHash::hash(key.toLatin1(), QCryptographicHash::Sha1).toBase64(QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals); -#endif } -- cgit v1.2.1 From 0cfab4ca43838eb98ffec9412da3a04995c3a958 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Fri, 1 Aug 2014 11:19:43 +0200 Subject: QmlDesigner: using old QRegExp works on all Qts Change-Id: I9650efac738c76b8ace531416ac8e4664f637ffb Reviewed-by: Christian Stenger --- share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp b/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp index 9269f7a9e3..d249e5e49a 100644 --- a/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp +++ b/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp @@ -57,9 +57,7 @@ #define QStringLiteral(str) QString::fromUtf8(str) #endif -#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) #include -#endif namespace QmlDesigner { -- cgit v1.2.1 From 5a06e6f903b7608a15b413d100219f18200f1e0a Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 23 Jul 2014 16:39:13 +0200 Subject: Squish: Revive WELP02 for Squish 5.1.1+ Change-Id: I432494320cbbd4f19e0386a19183d0b9476054ed Reviewed-by: Robert Loehning --- tests/system/objects.map | 4 +- tests/system/suite_WELP/tst_WELP02/test.py | 70 ++++++++++++++++-------------- 2 files changed, 40 insertions(+), 34 deletions(-) diff --git a/tests/system/objects.map b/tests/system/objects.map index 8bb268b6fd..37429e2a03 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -55,7 +55,7 @@ :Compiler:_QLabel {container=':qt_tabwidget_stackedwidget_QWidget' text='Compiler:' type='QLabel' unnamed='1' visible='1'} :Core__Internal__GeneralSettings.User Interface_QGroupBox {container=':qt_tabwidget_stackedwidget.Core__Internal__GeneralSettings_QWidget' name='interfaceBox' title='User Interface' type='QGroupBox' visible='1'} :CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox {container=':qt_tabwidget_stackedwidget.CppTools__Internal__CompletionSettingsPage_QWidget' name='groupBox' title='Behavior' type='QGroupBox' visible='1'} -:CreateProject_QStyleItem {clip='false' container=':Qt Creator_QDeclarativeView' enabled='true' text='Create Project' type='LinkedText' unnamed='1' visible='true'} +:CreateProject_QStyleItem {clip='false' container=':WelcomePage.scrollView_ScrollView' enabled='true' text='New Project' type='Button' unnamed='1' visible='true'} :DebugModeWidget.Breakpoints_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name='Debugger.Docks.Break' type='QDockWidget' visible='1' windowTitle='Breakpoints'} :DebugModeWidget.Debugger Log_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name='Debugger.Docks.Output' type='QDockWidget' visible='1' windowTitle='Debugger Log'} :DebugModeWidget.Debugger Toolbar_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name='Debugger Toolbar' type='QDockWidget' visible='1' windowTitle='Debugger Toolbar'} @@ -115,7 +115,7 @@ :Open File.File name:_QLabel {name='fileNameLabel' text='File name:' type='QLabel' visible='1' window=':Open File_QFileDialog'} :Open File_QFileDialog {name='QFileDialog' type='QFileDialog' visible='1' windowTitle='Open File'} :OpenDocuments_Widget {type='Core::Internal::OpenEditorsWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Open Documents'} -:OpenProject_QStyleItem {clip='false' container=':Qt Creator_QDeclarativeView' enabled='true' text='Open Project' type='LinkedText' unnamed='1' visible='true'} +:OpenProject_QStyleItem {clip='false' container=':WelcomePage.scrollView_ScrollView' enabled='true' text='Open Project' type='Button' unnamed='1' visible='true'} :Options.Cancel_QPushButton {text='Cancel' type='QPushButton' unnamed='1' visible='1' window=':Options_Core::Internal::SettingsDialog'} :Options.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Options_Core::Internal::SettingsDialog'} :Options.qt_tabwidget_stackedwidget_QStackedWidget {name='qt_tabwidget_stackedwidget' type='QStackedWidget' visible='1' window=':Options_Core::Internal::SettingsDialog'} diff --git a/tests/system/suite_WELP/tst_WELP02/test.py b/tests/system/suite_WELP/tst_WELP02/test.py index 2eb82568e9..e04fdb3163 100644 --- a/tests/system/suite_WELP/tst_WELP02/test.py +++ b/tests/system/suite_WELP/tst_WELP02/test.py @@ -30,9 +30,16 @@ source("../../shared/qtcreator.py") source("../../shared/suites_qtta.py") +def checkTypeAndProperties(typePropertiesDetails): + for (qType, props, detail) in typePropertiesDetails: + test.verify(checkIfObjectExists(getQmlItem(qType, ":WelcomePage.scrollView_ScrollView", + False, props)), + "Verifying: Qt Creator displays %s." % detail) + def main(): - test.log("Welcome mode is not scriptable at the moment") - return + if isQt4Build or not canTestEmbeddedQtQuick(): + test.log("Welcome mode is not available or not scriptable with this Squish version") + return # prepare example project sourceExample = os.path.join(sdkPath, "Examples", "4.7", "declarative", "animation", "basics", "property-animation") @@ -42,47 +49,46 @@ def main(): startApplication("qtcreator" + SettingsPath) if not startedWithoutPluginError(): return - if not test.verify(checkIfObjectExists(getQmlItem("Text", ":Qt Creator_QDeclarativeView", False, - "text='Getting Started'")), - "Verifying: Qt Creator displays Welcome Page with Getting Started."): - mouseClick(waitForObject(getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False, - "text='Getting Started'")), 5, 5, 0, Qt.LeftButton) - # select "Develop" topic - mouseClick(waitForObject(getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False, - "text='Develop'")), 5, 5, 0, Qt.LeftButton) - sessionsText = getQmlItem("Text", ":Qt Creator_QDeclarativeView", False, "text='Sessions'") - recentProjText = getQmlItem("Text", ":Qt Creator_QDeclarativeView", False, - "text='Recent Projects'") - test.verify(checkIfObjectExists(sessionsText) and checkIfObjectExists(recentProjText), - "Verifying: 'Develop' with 'Recently used sessions' and " - "'Recently used Projects' is being opened.") - # select "Create Project" and try to create a new project. - # create Qt Quick application from "Welcome" page -> "Develop" tab + + typePropDet = (("Button", "text='Get Started Now' id='gettingStartedButton'", + "Get Started Now button"), + ("Text", "text='Sessions' id='sessionsTitle'", "Sessions section"), + ("Text", "text='default' id='text'", "default session listed"), + ("Text", "text='Recent Projects' id='recentProjectsTitle'", "Projects section"), + ) + checkTypeAndProperties(typePropDet) + + # select "Create Project" and try to create a new project createNewQtQuickApplication(tempDir(), "SampleApp", fromWelcome = True) test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'" " text~='SampleApp( \(.*\))?' type='QModelIndex'}"), "Verifying: The project is opened in 'Edit' mode after configuring.") - # go to "Welcome page" -> "Develop" topic again. + # go to "Welcome page" again and verify updated information switchViewTo(ViewConstants.WELCOME) - test.verify(checkIfObjectExists(sessionsText) and checkIfObjectExists(recentProjText), - "Verifying: 'Develop' with 'Sessions' and 'Recent Projects' is opened.") - # select "Open project" and select any project. - # copy example project to temp directory + typePropDet = (("Text", "text='Sessions' id='sessionsTitle'", "Sessions section"), + ("Text", "text='default (current session)' id='text'", + "default session as current listed"), + ("Text", "text='Recent Projects' id='recentProjectsTitle'", "Projects section"), + ("LinkedText", "text='SampleApp' id='projectNameText'", + "current project listed in projects section") + ) + checkTypeAndProperties(typePropDet) + + # select "Open project" and select a project examplePath = os.path.join(prepareTemplate(sourceExample), "propertyanimation.pro") - # open example project from "Welcome" page -> "Develop" tab openQmakeProject(examplePath, fromWelcome = True) progressBarWait(30000) test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'" " text~='propertyanimation( \(.*\))?' type='QModelIndex'}"), "Verifying: The project is opened in 'Edit' mode after configuring.") - # go to "Welcome page" -> "Develop" again and check if there is an information about - # recent projects in "Recent Projects". + # go to "Welcome page" again and check if there is an information about recent projects switchViewTo(ViewConstants.WELCOME) - test.verify(checkIfObjectExists(getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False, - "text='propertyanimation'")) and - checkIfObjectExists(getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False, - "text='SampleApp'")), - "Verifying: 'Develop' is opened and the recently created and " - "opened project can be seen in 'Recent Projects'.") + test.verify(checkIfObjectExists(getQmlItem("LinkedText", ":WelcomePage.scrollView_ScrollView", + False, + "text='propertyanimation' id='projectNameText'")) and + checkIfObjectExists(getQmlItem("LinkedText", ":WelcomePage.scrollView_ScrollView", + False, "text='SampleApp' id='projectNameText'")), + "Verifying: 'Welcome page' displays information about recently created and " + "opened projects.") # exit Qt Creator invokeMenuItem("File", "Exit") -- cgit v1.2.1 From d7551d0cc20b405409e1b7d17f66dc2047596efc Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Tue, 29 Jul 2014 18:14:35 +0200 Subject: CustomExecutableRunConfigurationWidget: Make different use cases explicit Change-Id: I435ce0fe59d9e5d937e5ed3ed06ddbf4a54f967d Reviewed-by: Tobias Hunger --- .../customexecutableconfigurationwidget.cpp | 51 +++++++++++++++++----- .../customexecutableconfigurationwidget.h | 8 +++- .../qtsupport/customexecutablerunconfiguration.cpp | 21 ++++++--- 3 files changed, 63 insertions(+), 17 deletions(-) diff --git a/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp b/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp index 7202a7b650..be0a4c5e2a 100644 --- a/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp +++ b/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp @@ -47,7 +47,7 @@ namespace QtSupport { namespace Internal { -CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomExecutableRunConfiguration *rc) +CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomExecutableRunConfiguration *rc, ApplyMode mode) : m_ignoreChange(false), m_runConfiguration(rc) { QFormLayout *layout = new QFormLayout; @@ -86,14 +86,25 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE changed(); - connect(m_executableChooser, SIGNAL(changed(QString)), - this, SLOT(executableEdited())); - connect(m_commandLineArgumentsLineEdit, SIGNAL(textEdited(QString)), - this, SLOT(argumentsEdited(QString))); - connect(m_workingDirectory, SIGNAL(changed(QString)), - this, SLOT(workingDirectoryEdited())); - connect(m_useTerminalCheck, SIGNAL(toggled(bool)), - this, SLOT(termToggled(bool))); + if (mode == InstantApply) { + connect(m_executableChooser, SIGNAL(changed(QString)), + this, SLOT(executableEdited())); + connect(m_commandLineArgumentsLineEdit, SIGNAL(textEdited(QString)), + this, SLOT(argumentsEdited(QString))); + connect(m_workingDirectory, SIGNAL(changed(QString)), + this, SLOT(workingDirectoryEdited())); + connect(m_useTerminalCheck, SIGNAL(toggled(bool)), + this, SLOT(termToggled(bool))); + } else { + connect(m_executableChooser, SIGNAL(changed(QString)), + this, SIGNAL(validChanged())); + connect(m_commandLineArgumentsLineEdit, SIGNAL(textEdited(QString)), + this, SIGNAL(validChanged())); + connect(m_workingDirectory, SIGNAL(changed(QString)), + this, SIGNAL(validChanged())); + connect(m_useTerminalCheck, SIGNAL(toggled(bool)), + this, SIGNAL(validChanged())); + } ProjectExplorer::EnvironmentAspect *aspect = rc->extraAspect(); if (aspect) { @@ -101,7 +112,11 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE environmentWasChanged(); } - connect(m_runConfiguration, SIGNAL(changed()), this, SLOT(changed())); + // If we are in mode InstantApply, we keep us in sync with the rc + // otherwise we ignore changes to the rc and override them on apply, + // or keep them on cancel + if (mode == InstantApply) + connect(m_runConfiguration, SIGNAL(changed()), this, SLOT(changed())); } void CustomExecutableConfigurationWidget::environmentWasChanged() @@ -153,5 +168,21 @@ void CustomExecutableConfigurationWidget::changed() == ProjectExplorer::ApplicationLauncher::Console); } +void CustomExecutableConfigurationWidget::apply() +{ + m_ignoreChange = true; + m_runConfiguration->setExecutable(m_executableChooser->rawPath()); + m_runConfiguration->setCommandLineArguments(m_commandLineArgumentsLineEdit->text()); + m_runConfiguration->setBaseWorkingDirectory(m_workingDirectory->rawPath()); + m_runConfiguration->setRunMode(m_useTerminalCheck->isChecked() ? ProjectExplorer::ApplicationLauncher::Console + : ProjectExplorer::ApplicationLauncher::Gui); + m_ignoreChange = false; +} + +bool CustomExecutableConfigurationWidget::isValid() const +{ + return !m_executableChooser->rawPath().isEmpty(); +} + } // namespace Internal } // namespace QtSupport diff --git a/src/plugins/qtsupport/customexecutableconfigurationwidget.h b/src/plugins/qtsupport/customexecutableconfigurationwidget.h index b0990a1e8b..568a13852d 100644 --- a/src/plugins/qtsupport/customexecutableconfigurationwidget.h +++ b/src/plugins/qtsupport/customexecutableconfigurationwidget.h @@ -55,7 +55,13 @@ class CustomExecutableConfigurationWidget : public QWidget Q_OBJECT public: - CustomExecutableConfigurationWidget(CustomExecutableRunConfiguration *rc); + enum ApplyMode { InstantApply, DelayedApply}; + CustomExecutableConfigurationWidget(CustomExecutableRunConfiguration *rc, ApplyMode mode); + void apply(); // only used for DelayedApply + + bool isValid() const; +signals: + void validChanged(); private slots: void changed(); diff --git a/src/plugins/qtsupport/customexecutablerunconfiguration.cpp b/src/plugins/qtsupport/customexecutablerunconfiguration.cpp index f6f63034ce..da6652ad69 100644 --- a/src/plugins/qtsupport/customexecutablerunconfiguration.cpp +++ b/src/plugins/qtsupport/customexecutablerunconfiguration.cpp @@ -104,10 +104,12 @@ class CustomExecutableDialog : public QDialog public: explicit CustomExecutableDialog(CustomExecutableRunConfiguration *rc, QWidget *parent = 0); + void accept(); + private slots: void changed() { - setOkButtonEnabled(m_runConfiguration->isConfigured()); + setOkButtonEnabled(m_widget->isValid()); } private: @@ -117,6 +119,7 @@ private: } QDialogButtonBox *m_dialogButtonBox; + CustomExecutableConfigurationWidget *m_widget; CustomExecutableRunConfiguration *m_runConfiguration; }; @@ -125,15 +128,15 @@ CustomExecutableDialog::CustomExecutableDialog(CustomExecutableRunConfiguration , m_dialogButtonBox(new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel)) , m_runConfiguration(rc) { - connect(rc, SIGNAL(changed()), this, SLOT(changed())); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); QVBoxLayout *layout = new QVBoxLayout(this); QLabel *label = new QLabel(tr("Could not find the executable, please specify one.")); label->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); layout->addWidget(label); - QWidget *configWidget = rc->createConfigurationWidget(); - configWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - layout->addWidget(configWidget); + m_widget = new CustomExecutableConfigurationWidget(rc, CustomExecutableConfigurationWidget::DelayedApply); + m_widget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + connect(m_widget, SIGNAL(validChanged()), this, SLOT(changed())); + layout->addWidget(m_widget); setOkButtonEnabled(false); connect(m_dialogButtonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(m_dialogButtonBox, SIGNAL(rejected()), this, SLOT(reject())); @@ -141,6 +144,12 @@ CustomExecutableDialog::CustomExecutableDialog(CustomExecutableRunConfiguration layout->setSizeConstraint(QLayout::SetMinAndMaxSize); } +void CustomExecutableDialog::accept() +{ + m_widget->apply(); + QDialog::accept(); +} + bool CustomExecutableRunConfiguration::ensureConfigured(QString *errorMessage) { if (isConfigured()) @@ -301,7 +310,7 @@ void CustomExecutableRunConfiguration::setRunMode(ApplicationLauncher::Mode runM QWidget *CustomExecutableRunConfiguration::createConfigurationWidget() { - return new CustomExecutableConfigurationWidget(this); + return new CustomExecutableConfigurationWidget(this, CustomExecutableConfigurationWidget::InstantApply); } Abi CustomExecutableRunConfiguration::abi() const -- cgit v1.2.1 From 1076e879f12e1c4c9c169902b59e51903af88b9b Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 30 Jul 2014 14:33:33 +0200 Subject: QmlDesigner.Rewriter: Blacklist a couple of imports Some imports are known to create trouble in the designer. There is no reason to allow adding imports using the designer, that will just create issues. Change-Id: I95437f39c02fd06650285a5184a77669ae32b705 Reviewed-by: Tim Jenssen --- src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp index 3908507115..17971b192d 100644 --- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp +++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp @@ -749,6 +749,10 @@ static bool isBlacklistImport(const ImportKey &importKey) || importPathFirst == QStringLiteral("QtQml") || (importPathFirst == QStringLiteral("QtQuick") && importPathLast == QStringLiteral("PrivateWidgets")) || importPathLast == QStringLiteral("Private") + || importKey.libraryQualifiedPath() == QStringLiteral("QtQuick.Particles") //Unsupported + || importKey.libraryQualifiedPath() == QStringLiteral("QtQuick.Dialogs") //Unsupported + || importKey.libraryQualifiedPath() == QStringLiteral("QtQuick.Controls.Styles") //Unsupported + || importKey.libraryQualifiedPath().contains(QStringLiteral("Qt.labs")) //No support for labs plugins || (importKey.splitPath.count() == 1 && importPathFirst == QStringLiteral("QtQuick")); // Don't show Quick X.X imports } -- cgit v1.2.1 From b2682fee2282149b0f557e918cd48690fc5cf2ce Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Fri, 1 Aug 2014 13:26:42 +0200 Subject: Squish: Remove workaround Just doing as the great wise frog tells me. Change-Id: I73c07142cd902ac3b89f8c00597087d7d550a2ee Reviewed-by: Christian Stenger --- tests/system/shared/qtcreator.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/system/shared/qtcreator.py b/tests/system/shared/qtcreator.py index 218c59049f..086aa9411e 100644 --- a/tests/system/shared/qtcreator.py +++ b/tests/system/shared/qtcreator.py @@ -121,10 +121,6 @@ def waitForCleanShutdown(timeOut=10): break def checkForStillRunningQmlExecutable(possibleNames): - if JIRA.isBugStillOpen(12644): - possibleNames.append('WerFault.exe') - else: - test.warning("Remove temporary workaround for QTCREATORBUG-12644!") for qmlHelper in possibleNames: tasks = subprocess.Popen("tasklist /FI \"IMAGENAME eq %s\"" % qmlHelper, shell=True, stdout=subprocess.PIPE) -- cgit v1.2.1 From 49e6e153846afb5a9b2e8e34e71c7fc5b9ab5c66 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Thu, 31 Jul 2014 16:10:50 +0200 Subject: Doc: remove or hide docs for unsupported QML types Flipable, StatusBar, and ToolBar are no longer visible in the Library pane. Change-Id: I5258ff950e83a49c90b5246d5957d8c9e6382657 Reviewed-by: Thomas Hartmann --- doc/src/qtquick/qtquick-screens.qdoc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/src/qtquick/qtquick-screens.qdoc b/doc/src/qtquick/qtquick-screens.qdoc index e5fcee617e..0f7ce685fd 100644 --- a/doc/src/qtquick/qtquick-screens.qdoc +++ b/doc/src/qtquick/qtquick-screens.qdoc @@ -347,10 +347,6 @@ \li \l{Flickable} items can be flicked horizontally or vertically. - \li \l{Flipable} - items can be flipped between their front and back sides by using - rotation, state, and transition. - \li FocusScope assists in keyboard focus handling when building reusable QML components. @@ -394,18 +390,24 @@ down buttons, by pressing up or down on the keyboard, or by entering a value in the box. + \omit + Not visible in the item library in 3.2. \li StatusBar contains status information in your application. It does not provide a layout of its own, but requires you to position its contents, for instance by creating a \gui {Row Layout}. + \endomit \li TextArea displays multiple lines of editable formatted text. \li TextField displays a single line of editable plain text. + \omit + Not visible in the item library in 3.2. \li ToolBar provides styling for ToolButton as well as other controls that it can contain. However, it does not provide a layout of its own, but requires you to position its contents, for instance by creating a \gui {Row Layout}. + \endomit \li ToolButton provides a button that is functionally similar to \gui Button, but that looks more suitable on a \gui {Tool Bar}. -- cgit v1.2.1 From f488c10c5a978bd5caf1ccacc90a67f7c66c5701 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 1 Aug 2014 15:45:05 +0200 Subject: QbsProjectManager: Fix project node operations. The qbsProjectData() member function always returned the top-level project data, which messed up a couple of things, for instance "build sub-projects" and the node tree updates. Instead, return the project data corresponding to the node. Change-Id: If40c441c62334f0069a5fe3cb4873cf973baf135 Reviewed-by: Joerg Bornemann --- src/plugins/qbsprojectmanager/qbsnodes.cpp | 6 +----- src/plugins/qbsprojectmanager/qbsnodes.h | 3 ++- src/plugins/qbsprojectmanager/qbsproject.cpp | 2 ++ 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsnodes.cpp b/src/plugins/qbsprojectmanager/qbsnodes.cpp index 833f23135f..4a47acfdc2 100644 --- a/src/plugins/qbsprojectmanager/qbsnodes.cpp +++ b/src/plugins/qbsprojectmanager/qbsnodes.cpp @@ -752,6 +752,7 @@ void QbsProjectNode::update(const qbs::ProjectData &prjData) removeProjectNodes(toRemove); addProjectNodes(toAdd); + m_projectData = prjData; } QbsProject *QbsProjectNode::project() const @@ -764,11 +765,6 @@ const qbs::Project QbsProjectNode::qbsProject() const return project()->qbsProject(); } -const qbs::ProjectData QbsProjectNode::qbsProjectData() const -{ - return project()->qbsProjectData(); -} - bool QbsProjectNode::showInSimpleTree() const { return true; diff --git a/src/plugins/qbsprojectmanager/qbsnodes.h b/src/plugins/qbsprojectmanager/qbsnodes.h index 92dfde80a7..d2d9cb8f39 100644 --- a/src/plugins/qbsprojectmanager/qbsnodes.h +++ b/src/plugins/qbsprojectmanager/qbsnodes.h @@ -168,7 +168,7 @@ public: virtual QbsProject *project() const; const qbs::Project qbsProject() const; - const qbs::ProjectData qbsProjectData() const; + const qbs::ProjectData qbsProjectData() const { return m_projectData; } bool showInSimpleTree() const; @@ -182,6 +182,7 @@ private: QbsProjectNode *findProjectNode(const QString &name); static QIcon m_projectIcon; + qbs::ProjectData m_projectData; }; // -------------------------------------------------------------------- diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index 4a449d6766..2d137cb64b 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -243,6 +243,7 @@ bool QbsProject::addFilesToProduct(QbsBaseProjectNode *node, const QStringList & if (notAdded->count() != filePaths.count()) { m_projectData = m_qbsProject.projectData(); QbsGroupNode::setupFiles(node, allPaths, QFileInfo(productFilePath).absolutePath(), true); + m_rootProjectNode->update(); } return notAdded->isEmpty(); } @@ -268,6 +269,7 @@ bool QbsProject::removeFilesFromProduct(QbsBaseProjectNode *node, const QStringL if (notRemoved->count() != filePaths.count()) { m_projectData = m_qbsProject.projectData(); QbsGroupNode::setupFiles(node, allPaths, QFileInfo(productFilePath).absolutePath(), true); + m_rootProjectNode->update(); } return notRemoved->isEmpty(); } -- cgit v1.2.1 From ba31ab454df171ee5ffc5f088e0711b2e2c16cba Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 1 Aug 2014 12:08:12 +0200 Subject: QbsProjectManager: Do not enable "check timestamp" option by default. This is a workaround for user mistakes and should not be generally done. It can result in e.g. redundant relinking. Change-Id: Ia14854c9d260f5d7a8175d105b9bce896fcdeebf Reviewed-by: Joerg Bornemann --- src/plugins/qbsprojectmanager/qbsbuildstep.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index 92bfb71fac..1ee5ca17ec 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -199,7 +199,7 @@ bool QbsBuildStep::fromMap(const QVariantMap &map) setQbsConfiguration(map.value(QLatin1String(QBS_CONFIG)).toMap()); m_qbsBuildOptions.setDryRun(map.value(QLatin1String(QBS_DRY_RUN)).toBool()); m_qbsBuildOptions.setKeepGoing(map.value(QLatin1String(QBS_KEEP_GOING)).toBool()); - m_qbsBuildOptions.setForceTimestampCheck(map.value(QLatin1String(QBS_CHECK_TIMESTAMPS), true).toBool()); + m_qbsBuildOptions.setForceTimestampCheck(map.value(QLatin1String(QBS_CHECK_TIMESTAMPS)).toBool()); m_qbsBuildOptions.setMaxJobCount(map.value(QLatin1String(QBS_MAXJOBCOUNT)).toInt()); return true; } -- cgit v1.2.1 From 5996c1c3003a4e59a945c773afecdafa103c8bf3 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 1 Aug 2014 16:35:56 +0200 Subject: Update qbs submodule. To HEAD of 1.3 branch. Change-Id: I203255543abb2170c256c8df38c37b956ea84a47 Reviewed-by: Joerg Bornemann --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index 59aed7c423..48225ceaa6 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 59aed7c423ab1ff8e19d34736619cb128cc8b49a +Subproject commit 48225ceaa6d7f51281cdff871acf3dce1b80e942 -- cgit v1.2.1 From ef4057e7b2038b1f5a6e25a25de73388a79fd687 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 1 Aug 2014 17:36:17 +0200 Subject: WinRt: remove superfluous includes Change-Id: I4385cf9ec71d85e70984fb2225b772743991e418 Reviewed-by: Joerg Bornemann --- src/plugins/winrt/winrtrunfactories.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/plugins/winrt/winrtrunfactories.cpp b/src/plugins/winrt/winrtrunfactories.cpp index c49f41b0b3..8758669e77 100644 --- a/src/plugins/winrt/winrtrunfactories.cpp +++ b/src/plugins/winrt/winrtrunfactories.cpp @@ -37,18 +37,8 @@ #include #include #include -#include - -#include -#include -#include -#include - #include -#include -#include - using namespace ProjectExplorer; namespace WinRt { -- cgit v1.2.1 From db5a4ac447b0e3ac73da0a662d9faaefd1d67815 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Fri, 1 Aug 2014 11:59:19 +0200 Subject: QmlDesigner.PropertyEditor: Fix left padding for SpinBox We use left padding instead of a prefix. Task-number: QTCREATORBUG-12781 Change-Id: I0c89e3592ad0ca9c498d33930ef2742ec970f8bb Reviewed-by: Tim Jenssen --- .../propertyEditorQmlSources/HelperWidgets/CustomSpinBoxStyle.qml | 1 + .../qmldesigner/propertyEditorQmlSources/HelperWidgets/SpinBox.qml | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/CustomSpinBoxStyle.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/CustomSpinBoxStyle.qml index 2fbca27961..9bfcd2eba6 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/CustomSpinBoxStyle.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/CustomSpinBoxStyle.qml @@ -39,6 +39,7 @@ SpinBoxStyle { padding.top: 3 padding.bottom: 1 padding.right: 18 + padding.left: 12 incrementControl: Item { implicitWidth: 14 diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/SpinBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/SpinBox.qml index 241897fe96..6fd1c09eaf 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/SpinBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/SpinBox.qml @@ -37,7 +37,6 @@ Controls.SpinBox { property color highlightColor: "orange" property color textColor: colorLogic.textColor property variant backendValue; - prefix: " " ExtendedFunctionButton { x: 2 -- cgit v1.2.1 From 117436a65af2958a9b513c668491b139cfad3e6c Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 28 Jul 2014 22:25:27 +0300 Subject: DiffEditor: Use explicit DirectConnection for context menu The menu is expected to be populated after the signal is emitted. Change-Id: Ibcb9eaf3742942801ad79b98000d48cb93d5ae31 Reviewed-by: Jarek Kobus --- src/plugins/diffeditor/sidebysidediffeditorwidget.cpp | 6 ++++-- src/plugins/git/gitclient.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp b/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp index a8086227f6..935270719d 100644 --- a/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp +++ b/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp @@ -779,7 +779,8 @@ SideBySideDiffEditorWidget::SideBySideDiffEditorWidget(QWidget *parent) connect(m_leftEditor, SIGNAL(jumpToOriginalFileRequested(int,int,int)), this, SLOT(slotLeftJumpToOriginalFileRequested(int,int,int))); connect(m_leftEditor, SIGNAL(contextMenuRequested(QMenu*,int,int)), - this, SLOT(slotLeftContextMenuRequested(QMenu*,int,int))); + this, SLOT(slotLeftContextMenuRequested(QMenu*,int,int)), + Qt::DirectConnection); m_rightEditor = new SideDiffEditorWidget(this); m_rightEditor->setReadOnly(true); @@ -791,7 +792,8 @@ SideBySideDiffEditorWidget::SideBySideDiffEditorWidget(QWidget *parent) connect(m_rightEditor, SIGNAL(jumpToOriginalFileRequested(int,int,int)), this, SLOT(slotRightJumpToOriginalFileRequested(int,int,int))); connect(m_rightEditor, SIGNAL(contextMenuRequested(QMenu*,int,int)), - this, SLOT(slotRightContextMenuRequested(QMenu*,int,int))); + this, SLOT(slotRightContextMenuRequested(QMenu*,int,int)), + Qt::DirectConnection); connect(TextEditorSettings::instance(), SIGNAL(fontSettingsChanged(TextEditor::FontSettings)), diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 5e1909f061..fa195f2c79 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -783,7 +783,7 @@ DiffEditor::DiffEditorDocument *GitClient::createDiffEditor(const QString &docum VcsBasePlugin::setSource(diffEditorDocument, source); connect(diffEditorDocument->controller(), SIGNAL(chunkActionsRequested(QMenu*,int,int)), - this, SLOT(slotChunkActionsRequested(QMenu*,int,int))); + this, SLOT(slotChunkActionsRequested(QMenu*,int,int)), Qt::DirectConnection); return diffEditorDocument; } -- cgit v1.2.1 From 42bbae26a3e179e5a75684a8ca52f0c30f078a8e Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sun, 3 Aug 2014 11:49:51 +0300 Subject: Git: Do not suggest tag name for local branch This causes unnecessary name ambiguity. Change-Id: Id27060edb19b4902f2a93da042eb8389754b8e04 Reviewed-by: Friedemann Kleint --- src/plugins/git/branchdialog.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/plugins/git/branchdialog.cpp b/src/plugins/git/branchdialog.cpp index 2531867dcb..d3eceed608 100644 --- a/src/plugins/git/branchdialog.cpp +++ b/src/plugins/git/branchdialog.cpp @@ -152,12 +152,16 @@ void BranchDialog::add() QStringList localNames = m_model->localBranchNames(); - QString suggestedNameBase = trackedBranch.mid(trackedBranch.lastIndexOf(QLatin1Char('/')) + 1); - QString suggestedName = suggestedNameBase; - int i = 2; - while (localNames.contains(suggestedName)) { - suggestedName = suggestedNameBase + QString::number(i); - ++i; + QString suggestedName; + if (!isTag) { + QString suggestedNameBase; + suggestedNameBase = trackedBranch.mid(trackedBranch.lastIndexOf(QLatin1Char('/')) + 1); + suggestedName = suggestedNameBase; + int i = 2; + while (localNames.contains(suggestedName)) { + suggestedName = suggestedNameBase + QString::number(i); + ++i; + } } BranchAddDialog branchAddDialog(localNames, true, this); -- cgit v1.2.1 From 5751f7117cbe9e11c2e089349fbc97045ec50f32 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Wed, 30 Jul 2014 17:31:49 +0200 Subject: CustomExecutableRunConfiguration: Remove nested event loop Nested event loops are dangerous and in this case lead to a crash. So change the api of ensureConfigured to not use a nested event loop. The CustomExecutableRunConfiguration then has to manage the dialog more explicitly. Also this makes the dialog non modal, since it should then cope with every situation. Task-number: QTCREATORBUG-11416 Change-Id: I2af782915c148f8dff1b0df54fdb64aa83f684d2 Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/projectexplorer.cpp | 36 +++++++++++-- src/plugins/projectexplorer/projectexplorer.h | 1 + src/plugins/projectexplorer/runconfiguration.cpp | 6 +-- src/plugins/projectexplorer/runconfiguration.h | 6 ++- .../qtsupport/customexecutablerunconfiguration.cpp | 61 +++++++++++++--------- .../qtsupport/customexecutablerunconfiguration.h | 5 +- .../remotelinuxcustomrunconfiguration.cpp | 7 +-- .../remotelinuxcustomrunconfiguration.h | 2 +- 8 files changed, 86 insertions(+), 38 deletions(-) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index e57a9643f4..2c4d8eb102 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -248,6 +248,7 @@ struct ProjectExplorerPluginPrivate { QString m_lastOpenDirectory; QPointer m_delayedRunConfiguration; + QList> m_delayedRunConfigurationForRun; bool m_shouldHaveRunConfiguration; RunMode m_runMode; QString m_projectFilterString; @@ -1753,14 +1754,25 @@ void ProjectExplorerPlugin::buildStateChanged(Project * pro) void ProjectExplorerPlugin::executeRunConfiguration(RunConfiguration *runConfiguration, RunMode runMode) { - QString errorMessage; - if (!runConfiguration->ensureConfigured(&errorMessage)) { - showRunErrorMessage(errorMessage); - return; + if (!runConfiguration->isConfigured()) { + QString errorMessage; + RunConfiguration::ConfigurationState state = runConfiguration->ensureConfigured(&errorMessage); + + if (state == RunConfiguration::UnConfigured) { + showRunErrorMessage(errorMessage); + return; + } else if (state == RunConfiguration::Waiting) { + connect(runConfiguration, SIGNAL(configurationFinished()), + this, SLOT(runConfigurationConfigurationFinished())); + d->m_delayedRunConfigurationForRun.append(qMakePair(runConfiguration, runMode)); + return; + } } + if (IRunControlFactory *runControlFactory = findRunControlFactory(runConfiguration, runMode)) { emit aboutToExecuteProject(runConfiguration->target()->project(), runMode); + QString errorMessage; RunControl *control = runControlFactory->create(runConfiguration, runMode, &errorMessage); if (!control) { showRunErrorMessage(errorMessage); @@ -1877,6 +1889,22 @@ void ProjectExplorerPlugin::updateContext() ICore::updateAdditionalContexts(oldContext, newContext); } +void ProjectExplorerPlugin::runConfigurationConfigurationFinished() +{ + RunConfiguration *rc = qobject_cast(sender()); + ProjectExplorer::RunMode runMode = ProjectExplorer::NoRunMode; + for (int i = 0; i < d->m_delayedRunConfigurationForRun.size(); ++i) { + if (d->m_delayedRunConfigurationForRun.at(i).first == rc) { + runMode = d->m_delayedRunConfigurationForRun.at(i).second; + d->m_delayedRunConfigurationForRun.removeAt(i); + break; + } + } + if (runMode != ProjectExplorer::NoRunMode + && rc->isConfigured()) + executeRunConfiguration(rc, runMode); +} + void ProjectExplorerPlugin::setCurrent(Project *project, QString filePath, Node *node) { if (debug) diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h index 731a1723eb..b655f2219e 100644 --- a/src/plugins/projectexplorer/projectexplorer.h +++ b/src/plugins/projectexplorer/projectexplorer.h @@ -232,6 +232,7 @@ private slots: void updateExternalFileWarning(); void updateContext(); + void runConfigurationConfigurationFinished(); #ifdef WITH_TESTS void testAnsiFilterOutputParser_data(); diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 4c848bd9f1..a7b84d3090 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -273,13 +273,13 @@ bool RunConfiguration::isConfigured() const return true; } -bool RunConfiguration::ensureConfigured(QString *errorMessage) +RunConfiguration::ConfigurationState RunConfiguration::ensureConfigured(QString *errorMessage) { if (isConfigured()) - return true; + return Configured; if (errorMessage) *errorMessage = tr("Unknown error."); - return false; + return UnConfigured; } diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index eb74613f6b..f8f9e990ce 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -163,9 +163,12 @@ public: virtual bool isEnabled() const; virtual QString disabledReason() const; virtual QWidget *createConfigurationWidget() = 0; + virtual bool isConfigured() const; // Pop up configuration dialog in case for example the executable is missing. - virtual bool ensureConfigured(QString *errorMessage = 0); + enum ConfigurationState { Configured, UnConfigured, Waiting }; + // TODO rename function + virtual ConfigurationState ensureConfigured(QString *errorMessage = 0); Target *target() const; @@ -194,6 +197,7 @@ public: signals: void enabledChanged(); void requestRunActionsUpdate(); + void configurationFinished(); protected: RunConfiguration(Target *parent, Core::Id id); diff --git a/src/plugins/qtsupport/customexecutablerunconfiguration.cpp b/src/plugins/qtsupport/customexecutablerunconfiguration.cpp index da6652ad69..a5c1b6d3df 100644 --- a/src/plugins/qtsupport/customexecutablerunconfiguration.cpp +++ b/src/plugins/qtsupport/customexecutablerunconfiguration.cpp @@ -71,7 +71,8 @@ void CustomExecutableRunConfiguration::ctor() CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *parent) : LocalApplicationRunConfiguration(parent, Core::Id(CUSTOM_EXECUTABLE_ID)), m_workingDirectory(QLatin1String(Constants::DEFAULT_WORKING_DIR)), - m_runMode(ProjectExplorer::ApplicationLauncher::Gui) + m_runMode(ProjectExplorer::ApplicationLauncher::Gui), + m_dialog(0) { addExtraAspect(new LocalEnvironmentAspect(this)); @@ -86,7 +87,8 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *paren m_executable(source->m_executable), m_workingDirectory(source->m_workingDirectory), m_cmdArguments(source->m_cmdArguments), - m_runMode(source->m_runMode) + m_runMode(source->m_runMode), + m_dialog(0) { ctor(); } @@ -94,6 +96,12 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *paren // Note: Qt4Project deletes all empty customexecrunconfigs for which isConfigured() == false. CustomExecutableRunConfiguration::~CustomExecutableRunConfiguration() { + if (m_dialog) { + emit configurationFinished(); + disconnect(m_dialog, SIGNAL(finished(int)), + this, SLOT(configurationDialogFinished())); + delete m_dialog; + } } // Dialog embedding the CustomExecutableConfigurationWidget @@ -150,30 +158,33 @@ void CustomExecutableDialog::accept() QDialog::accept(); } -bool CustomExecutableRunConfiguration::ensureConfigured(QString *errorMessage) -{ - if (isConfigured()) - return validateExecutable(0, errorMessage); - CustomExecutableDialog dialog(this, Core::ICore::mainWindow()); - dialog.setWindowTitle(displayName()); - const QString oldExecutable = m_executable; - const QString oldWorkingDirectory = m_workingDirectory; - const QString oldCmdArguments = m_cmdArguments; - if (dialog.exec() == QDialog::Accepted) - return validateExecutable(0, errorMessage); - // User canceled: Hack: Silence the error dialog. - if (errorMessage) - *errorMessage = QLatin1String(""); - // Restore values changed by the configuration widget. - if (m_executable != oldExecutable - || m_workingDirectory != oldWorkingDirectory - || m_cmdArguments != oldCmdArguments) { - m_executable = oldExecutable; - m_workingDirectory = oldWorkingDirectory; - m_cmdArguments = oldCmdArguments; - emit changed(); +// CustomExecutableRunConfiguration + +RunConfiguration::ConfigurationState CustomExecutableRunConfiguration::ensureConfigured(QString *errorMessage) +{ + Q_UNUSED(errorMessage) + if (m_dialog) {// uhm already shown + *errorMessage = QLatin1String(""); // no error dialog + m_dialog->activateWindow(); + m_dialog->raise(); + return UnConfigured; } - return false; + + m_dialog = new CustomExecutableDialog(this, Core::ICore::mainWindow()); + connect(m_dialog, SIGNAL(finished(int)), + this, SLOT(configurationDialogFinished())); + m_dialog->setWindowTitle(displayName()); // pretty pointless + m_dialog->show(); + return Waiting; +} + +void CustomExecutableRunConfiguration::configurationDialogFinished() +{ + disconnect(m_dialog, SIGNAL(finished(int)), + this, SLOT(configurationDialogFinished())); + m_dialog->deleteLater(); + m_dialog = 0; + emit configurationFinished(); } // Search the executable in the path. diff --git a/src/plugins/qtsupport/customexecutablerunconfiguration.h b/src/plugins/qtsupport/customexecutablerunconfiguration.h index 38c5f2efeb..314291f1eb 100644 --- a/src/plugins/qtsupport/customexecutablerunconfiguration.h +++ b/src/plugins/qtsupport/customexecutablerunconfiguration.h @@ -74,7 +74,7 @@ public: QVariantMap toMap() const; - bool ensureConfigured(QString *errorMessage); + ConfigurationState ensureConfigured(QString *errorMessage); signals: void changed(); @@ -85,6 +85,8 @@ protected: virtual bool fromMap(const QVariantMap &map); QString defaultDisplayName() const; +private slots: + void configurationDialogFinished(); private: void ctor(); @@ -102,6 +104,7 @@ private: QString m_workingDirectory; QString m_cmdArguments; ProjectExplorer::ApplicationLauncher::Mode m_runMode; + QWidget *m_dialog; }; class CustomExecutableRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory diff --git a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp index e046be1986..2d49f4f36b 100644 --- a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp @@ -119,16 +119,17 @@ bool RemoteLinuxCustomRunConfiguration::isConfigured() const return !m_remoteExecutable.isEmpty(); } -bool RemoteLinuxCustomRunConfiguration::ensureConfigured(QString *errorMessage) +ProjectExplorer::RunConfiguration::ConfigurationState +RemoteLinuxCustomRunConfiguration::ensureConfigured(QString *errorMessage) { if (!isConfigured()) { if (errorMessage) { *errorMessage = tr("The remote executable must be set " "in order to run a custom remote run configuration."); } - return false; + return UnConfigured; } - return true; + return Configured; } QWidget *RemoteLinuxCustomRunConfiguration::createConfigurationWidget() diff --git a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.h b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.h index 97867ad871..87c18b0026 100644 --- a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.h +++ b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.h @@ -48,7 +48,7 @@ public: bool isEnabled() const { return true; } bool isConfigured() const; - bool ensureConfigured(QString *errorMessage); + ConfigurationState ensureConfigured(QString *errorMessage); QWidget *createConfigurationWidget(); Utils::OutputFormatter *createOutputFormatter() const; -- cgit v1.2.1 From ac33df0d7abae5e3dbf1f69c70911ed6c4a87954 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 4 Aug 2014 09:37:51 +0300 Subject: SDKTool: Change DeviceType from QByteArray to QString Change-Id: I224b6723891df4a8073fae327def13c0b41e8541 Reviewed-by: Tobias Hunger --- src/tools/sdktool/addkitoperation.cpp | 24 ++++++++++++------------ src/tools/sdktool/addkitoperation.h | 4 ++-- src/tools/sdktool/rmkitoperation.cpp | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/tools/sdktool/addkitoperation.cpp b/src/tools/sdktool/addkitoperation.cpp index 110be9951b..cd395674cf 100644 --- a/src/tools/sdktool/addkitoperation.cpp +++ b/src/tools/sdktool/addkitoperation.cpp @@ -247,7 +247,7 @@ int AddKitOperation::execute() const map = initializeKits(); QVariantMap result = addKit(map, m_id, m_displayName, m_icon, m_debuggerId, m_debuggerEngine, - m_debugger, m_deviceType.toUtf8(), m_device, m_sysRoot, m_tc, m_qt, + m_debugger, m_deviceType, m_device, m_sysRoot, m_tc, m_qt, m_mkspec, m_extra); if (result.isEmpty() || map == result) @@ -295,7 +295,7 @@ bool AddKitOperation::test() const QVariantMap empty = addKit(map, tcMap, qtMap, devMap, QLatin1String("testId"), QLatin1String("Test Kit"), QLatin1String("/tmp/icon.png"), QString(), 1, QLatin1String("/usr/bin/gdb-test"), - QByteArray("Desktop"), QLatin1String("{dev-id}"), QString(), + QLatin1String("Desktop"), QLatin1String("{dev-id}"), QString(), QLatin1String("{tcXX-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"), KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); if (!empty.isEmpty()) @@ -304,7 +304,7 @@ bool AddKitOperation::test() const empty = addKit(map, tcMap, qtMap, devMap, QLatin1String("testId"), QLatin1String("Test Kit"), QLatin1String("/tmp/icon.png"), QString(), 1, QLatin1String("/usr/bin/gdb-test"), - QByteArray("Desktop"), QLatin1String("{dev-id}"), QString(), + QLatin1String("Desktop"), QLatin1String("{dev-id}"), QString(), QLatin1String("x86-linux-generic-elf-64bit"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"), KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); if (empty.isEmpty()) @@ -313,7 +313,7 @@ bool AddKitOperation::test() const empty = addKit(map, tcMap, qtMap, devMap, QLatin1String("testId"), QLatin1String("Test Kit"), QLatin1String("/tmp/icon.png"), QString(), 1, QLatin1String("/usr/bin/gdb-test"), - QByteArray("Desktop"), QLatin1String("{dev-id}"), QString(), + QLatin1String("Desktop"), QLatin1String("{dev-id}"), QString(), QLatin1String("x86-macos-generic-mach_o-64bit"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"), KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); if (empty.isEmpty()) @@ -323,7 +323,7 @@ bool AddKitOperation::test() const empty = addKit(map, tcMap, qtMap, devMap, QLatin1String("testId"), QLatin1String("Test Kit"), QLatin1String("/tmp/icon.png"), QString(), 1, QLatin1String("/usr/bin/gdb-test"), - QByteArray("Desktop"), QLatin1String("{dev-id}"), QString(), + QLatin1String("Desktop"), QLatin1String("{dev-id}"), QString(), QLatin1String("{tc-id}"), QLatin1String("{qtXX-id}"), QLatin1String("unsupported/mkspec"), KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); if (!empty.isEmpty()) @@ -332,7 +332,7 @@ bool AddKitOperation::test() const empty = addKit(map, tcMap, qtMap, devMap, QLatin1String("testId"), QLatin1String("Test Kit"), QLatin1String("/tmp/icon.png"), QString(), 1, QLatin1String("/usr/bin/gdb-test"), - QByteArray("Desktop"), QLatin1String("{devXX-id}"), QString(), + QLatin1String("Desktop"), QLatin1String("{devXX-id}"), QString(), QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"), KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); if (!empty.isEmpty()) @@ -341,7 +341,7 @@ bool AddKitOperation::test() const map = addKit(map, tcMap, qtMap, devMap, QLatin1String("testId"), QLatin1String("Test Kit"), QLatin1String("/tmp/icon.png"), QString(), 1, QLatin1String("/usr/bin/gdb-test"), - QByteArray("Desktop"), QString(), QString(), + QLatin1String("Desktop"), QString(), QString(), QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"), KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); @@ -391,7 +391,7 @@ bool AddKitOperation::test() const QVariantMap result = addKit(map, tcMap, qtMap, devMap, QLatin1String("testId"), QLatin1String("Test Qt Version X"), QLatin1String("/tmp/icon3.png"), QString(), 1, QLatin1String("/usr/bin/gdb-test3"), - QByteArray("Desktop"), QString(), QString(), + QLatin1String("Desktop"), QString(), QString(), QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"), KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); if (!result.isEmpty()) @@ -401,7 +401,7 @@ bool AddKitOperation::test() const map = addKit(map, tcMap, qtMap, devMap, QLatin1String("testId2"), QLatin1String("Test Kit2"), QLatin1String("/tmp/icon2.png"), QString(), 1, QLatin1String("/usr/bin/gdb-test2"), - QByteArray("Desktop"), QLatin1String("{dev-id}"), QLatin1String("/sys/root\\\\"), + QLatin1String("Desktop"), QLatin1String("{dev-id}"), QLatin1String("/sys/root\\\\"), QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"), KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); if (map.count() != 5 @@ -457,7 +457,7 @@ bool AddKitOperation::test() const map = addKit(map, tcMap, qtMap, devMap, QLatin1String("test with debugger Id"), QLatin1String("Test debugger Id"), QLatin1String("/tmp/icon2.png"), QString::fromLatin1("debugger Id"), 0, QString(), - QByteArray("Desktop"), QString(), QString(), + QLatin1String("Desktop"), QString(), QString(), QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"), KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); if (map.count() != 6 @@ -506,7 +506,7 @@ QVariantMap AddKitOperation::addKit(const QVariantMap &map, const QString &id, const QString &displayName, const QString &icon, const QString &debuggerId, const quint32 &debuggerType, const QString &debugger, - const QByteArray &deviceType, const QString &device, + const QString &deviceType, const QString &device, const QString &sysRoot, const QString &tc, const QString &qt, const QString &mkspec, const KeyValuePairList &extra) { @@ -523,7 +523,7 @@ QVariantMap AddKitOperation::addKit(const QVariantMap &map, const QVariantMap &t const QString &id, const QString &displayName, const QString &icon, const QString &debuggerId, const quint32 &debuggerType, const QString &debugger, - const QByteArray &deviceType, const QString &device, + const QString &deviceType, const QString &device, const QString &sysRoot, const QString &tc, const QString &qt, const QString &mkspec, const KeyValuePairList &extra) { diff --git a/src/tools/sdktool/addkitoperation.h b/src/tools/sdktool/addkitoperation.h index f5f6256920..57d4b0e298 100644 --- a/src/tools/sdktool/addkitoperation.h +++ b/src/tools/sdktool/addkitoperation.h @@ -54,7 +54,7 @@ public: static QVariantMap addKit(const QVariantMap &map, const QString &id, const QString &displayName, const QString &icon, const QString &debuggerId, const quint32 &debuggerType, const QString &debugger, - const QByteArray &deviceType, const QString &device, + const QString &deviceType, const QString &device, const QString &sysRoot, const QString &tc, const QString &qt, const QString &mkspec, const KeyValuePairList &extra); @@ -66,7 +66,7 @@ public: const QString &id, const QString &displayName, const QString &icon, const QString &debuggerId, const quint32 &debuggerType, const QString &debugger, - const QByteArray &deviceType, const QString &device, + const QString &deviceType, const QString &device, const QString &sysRoot, const QString &tc, const QString &qt, const QString &mkspec, const KeyValuePairList &extra); diff --git a/src/tools/sdktool/rmkitoperation.cpp b/src/tools/sdktool/rmkitoperation.cpp index 5243939739..df788a34e4 100644 --- a/src/tools/sdktool/rmkitoperation.cpp +++ b/src/tools/sdktool/rmkitoperation.cpp @@ -127,7 +127,7 @@ bool RmKitOperation::test() const QLatin1String("testId"), QLatin1String("Test Qt Version"), QLatin1String("/tmp/icon.png"), QString(), 1, QLatin1String("/usr/bin/gdb-test"), - QByteArray("Desktop"), QString(), QString(), + QLatin1String("Desktop"), QString(), QString(), QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"), KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); @@ -136,7 +136,7 @@ bool RmKitOperation::test() const QLatin1String("testId2"), QLatin1String("Test Qt Version"), QLatin1String("/tmp/icon2.png"), QString(), 1, QLatin1String("/usr/bin/gdb-test2"), - QByteArray("Desktop"), QString(), QString(), + QLatin1String("Desktop"), QString(), QString(), QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec2"), KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue2")))); -- cgit v1.2.1 From ea675821e3033db3afe9422f4b5f9552ee24b3ae Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 4 Aug 2014 10:43:49 +0200 Subject: QmlPuppet: Fix linking on MacOSX Change-Id: Ib38b0059c24b9bddb2aa79ba45347e00f8972c77 Reviewed-by: Tim Jenssen --- share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri b/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri index 6b9a19bfd6..7792021049 100644 --- a/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri +++ b/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri @@ -22,7 +22,7 @@ SOURCES += $$PWD/qmlpuppetmain.cpp RESOURCES += $$PWD/../qmlpuppet.qrc DEFINES -= QT_NO_CAST_FROM_ASCII -unix:!osx:LIBS += -lrt # posix shared memory +unix:!macx:LIBS += -lrt # posix shared memory OTHER_FILES += Info.plist macx { -- cgit v1.2.1 From d6e0df1c74045936c5db030e15b094a61de068d2 Mon Sep 17 00:00:00 2001 From: jkobus Date: Fri, 11 Jul 2014 10:34:22 +0200 Subject: Fix reading of git format-patch output Task-number: QTCREATORBUG-12627 Change-Id: I7df1fe27f6502895ab9c82178084d2b631468c5d Reviewed-by: Friedemann Kleint Reviewed-by: Orgad Shaneh --- src/plugins/diffeditor/diffutils.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/plugins/diffeditor/diffutils.cpp b/src/plugins/diffeditor/diffutils.cpp index af787f72ff..c483eb3b89 100644 --- a/src/plugins/diffeditor/diffutils.cpp +++ b/src/plugins/diffeditor/diffutils.cpp @@ -821,7 +821,7 @@ static QList readDiffPatch(const QString &patch, QList fileDataList; int pos = diffRegExp.indexIn(patch, 0); - if (pos == 0) { // git style patch + if (pos >= 0) { // git style patch readOk = true; int lastPos = -1; do { @@ -1045,7 +1045,7 @@ static QList readGitPatch(const QString &patch, bool ignoreWhitespace, simpleGitMatched = (pos == simpleGitPos); } - if (pos == 0) { // git style patch + if (pos >= 0) { // git style patch readOk = true; int endOfLastHeader = 0; QString lastLeftFileName; @@ -1159,9 +1159,16 @@ QList DiffUtils::readPatch(const QString &patch, bool ignoreWhitespace QList fileDataList; - fileDataList = readGitPatch(patch, ignoreWhitespace, &readOk); + QString croppedPatch = patch; + // Crop e.g. "-- \n1.9.4.msysgit.0\n\n" at end of file + const QRegExp formatPatchEndingRegExp(QLatin1String("(\\n-- \\n\\S*\\n\\n$)")); + const int pos = formatPatchEndingRegExp.indexIn(patch, 0); + if (pos != -1) + croppedPatch = patch.left(pos + 1); // crop the ending for git format-patch + + fileDataList = readGitPatch(croppedPatch, ignoreWhitespace, &readOk); if (!readOk) - fileDataList = readDiffPatch(patch, ignoreWhitespace, &readOk); + fileDataList = readDiffPatch(croppedPatch, ignoreWhitespace, &readOk); if (ok) *ok = readOk; -- cgit v1.2.1 From d4a32cdba9a3a2692f44e5b76ebaa8a72bd83a80 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 1 Aug 2014 17:40:21 +0200 Subject: WinRt: fix run control for SUBDIRS projects Winrtrunner was called with the executable file path for the top-level .pro file, which happens to be the empty string. We now store (and use) the right .pro file path. Change-Id: I7d71e6b99393e863f3ba0df2d2902f29d75a9583 Reviewed-by: Christian Kandeler Reviewed-by: Daniel Teske --- src/plugins/winrt/winrt.qbs | 1 + src/plugins/winrt/winrt_dependencies.pri | 1 + src/plugins/winrt/winrtconstants.h | 5 +++- src/plugins/winrt/winrtrunconfiguration.cpp | 7 +++++ src/plugins/winrt/winrtrunconfiguration.h | 2 ++ src/plugins/winrt/winrtrunfactories.cpp | 40 +++++++++++++++++++++-------- src/plugins/winrt/winrtrunfactories.h | 1 + src/plugins/winrt/winrtrunnerhelper.cpp | 3 +-- 8 files changed, 46 insertions(+), 14 deletions(-) diff --git a/src/plugins/winrt/winrt.qbs b/src/plugins/winrt/winrt.qbs index c3168b2b2b..67b8e0e4bf 100644 --- a/src/plugins/winrt/winrt.qbs +++ b/src/plugins/winrt/winrt.qbs @@ -10,6 +10,7 @@ QtcPlugin { Depends { name: "Debugger" } Depends { name: "ProjectExplorer" } Depends { name: "QtSupport" } + Depends { name: "QmakeProjectManager" } Depends { name: "Qt.gui" } files: [ diff --git a/src/plugins/winrt/winrt_dependencies.pri b/src/plugins/winrt/winrt_dependencies.pri index 8ba3491bc2..de1f7ec435 100644 --- a/src/plugins/winrt/winrt_dependencies.pri +++ b/src/plugins/winrt/winrt_dependencies.pri @@ -3,4 +3,5 @@ QTC_PLUGIN_DEPENDS += \ coreplugin \ debugger \ projectexplorer \ + qmakeprojectmanager \ qtsupport diff --git a/src/plugins/winrt/winrtconstants.h b/src/plugins/winrt/winrtconstants.h index 3704603cff..b7b09daa6a 100644 --- a/src/plugins/winrt/winrtconstants.h +++ b/src/plugins/winrt/winrtconstants.h @@ -33,6 +33,7 @@ namespace WinRt { namespace Internal { namespace Constants { + const char WINRT_DEVICE_TYPE_LOCAL[] = "WinRt.Device.Local"; const char WINRT_DEVICE_TYPE_EMULATOR[] = "WinRt.Device.Emulator"; const char WINRT_DEVICE_TYPE_PHONE[] = "WinRt.Device.Phone"; @@ -43,7 +44,9 @@ const char WINRT_WINPHONEQT[] = "WinRt.QtVersion.WindowsPhone"; const char WINRT_QTMAP_SUBKEYNAME[] = "WinRt"; const char WINRT_QTMAP_OSFLAVOR[] = "OsFlavor"; const char WINRT_MANIFEST_EDITOR_ID[] = "WinRTManifestEditorID"; -} +const char WINRT_RC_PREFIX[] = "WinRt.WinRtRunConfiguration:"; + +} // Constants } // Internal } // WinRt diff --git a/src/plugins/winrt/winrtrunconfiguration.cpp b/src/plugins/winrt/winrtrunconfiguration.cpp index 2fb121ecc7..3cec89026f 100644 --- a/src/plugins/winrt/winrtrunconfiguration.cpp +++ b/src/plugins/winrt/winrtrunconfiguration.cpp @@ -29,6 +29,7 @@ #include "winrtrunconfiguration.h" #include "winrtrunconfigurationwidget.h" +#include "winrtconstants.h" #include #include @@ -40,8 +41,14 @@ namespace Internal { static const char argumentsIdC[] = "WinRtRunConfigurationArgumentsId"; static const char uninstallAfterStopIdC[] = "WinRtRunConfigurationUninstallAfterStopId"; +static QString pathFromId(Core::Id id) +{ + return id.suffixAfter(Constants::WINRT_RC_PREFIX); +} + WinRtRunConfiguration::WinRtRunConfiguration(ProjectExplorer::Target *parent, Core::Id id) : RunConfiguration(parent, id) + , m_proFilePath(pathFromId(id)) , m_uninstallAfterStop(false) { setDisplayName(tr("Run App Package")); diff --git a/src/plugins/winrt/winrtrunconfiguration.h b/src/plugins/winrt/winrtrunconfiguration.h index af2e1850d5..f010580f29 100644 --- a/src/plugins/winrt/winrtrunconfiguration.h +++ b/src/plugins/winrt/winrtrunconfiguration.h @@ -47,6 +47,7 @@ public: QVariantMap toMap() const; bool fromMap(const QVariantMap &map); + const QString &proFilePath() const { return m_proFilePath; } const QString &arguments() const { return m_arguments; } bool uninstallAfterStop() const { return m_uninstallAfterStop; } @@ -59,6 +60,7 @@ public slots: void setUninstallAfterStop(bool b); private: + QString m_proFilePath; QString m_arguments; bool m_uninstallAfterStop; }; diff --git a/src/plugins/winrt/winrtrunfactories.cpp b/src/plugins/winrt/winrtrunfactories.cpp index 8758669e77..fda57eb5b2 100644 --- a/src/plugins/winrt/winrtrunfactories.cpp +++ b/src/plugins/winrt/winrtrunfactories.cpp @@ -37,15 +37,16 @@ #include #include #include +#include #include using namespace ProjectExplorer; +using QmakeProjectManager::QmakeProject; +using QmakeProjectManager::QmakeProFileNode; namespace WinRt { namespace Internal { -static const char winrtConfigurationIdC[] = "WinRTConfigurationID"; - static bool isKitCompatible(Kit *kit) { IDevice::ConstPtr device = DeviceKitInformation::device(kit); @@ -62,13 +63,17 @@ WinRtRunConfigurationFactory::WinRtRunConfigurationFactory() { } -QList WinRtRunConfigurationFactory::availableCreationIds(Target *parent, CreationMode mode) const +QList WinRtRunConfigurationFactory::availableCreationIds(Target *parent, + CreationMode mode) const { - Q_UNUSED(mode) - QList result; - if (isKitCompatible(parent->kit())) - result.append(Core::Id(winrtConfigurationIdC)); - return result; + if (!canHandle(parent)) + return QList(); + + QmakeProject *project = static_cast(parent->project()); + QList nodes = project->applicationProFiles(); + if (mode == AutoCreate) + nodes = QmakeProject::nodesWithQtcRunnable(nodes); + return QmakeProject::idsForNodes(Core::Id(Constants::WINRT_RC_PREFIX), nodes); } QString WinRtRunConfigurationFactory::displayNameForId(Core::Id id) const @@ -79,7 +84,8 @@ QString WinRtRunConfigurationFactory::displayNameForId(Core::Id id) const bool WinRtRunConfigurationFactory::canCreate(Target *parent, Core::Id id) const { - return id == winrtConfigurationIdC && isKitCompatible(parent->kit()); + Q_UNUSED(id); + return canHandle(parent); } RunConfiguration *WinRtRunConfigurationFactory::doCreate(Target *parent, Core::Id id) @@ -89,12 +95,15 @@ RunConfiguration *WinRtRunConfigurationFactory::doCreate(Target *parent, Core::I bool WinRtRunConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const { - return ProjectExplorer::idFromMap(map) == winrtConfigurationIdC && isKitCompatible(parent->kit()); + if (!canHandle(parent)) + return false; + + return idFromMap(map).toString().startsWith(QLatin1String(Constants::WINRT_RC_PREFIX)); } RunConfiguration *WinRtRunConfigurationFactory::doRestore(Target *parent, const QVariantMap &map) { - RunConfiguration *config = new WinRtRunConfiguration(parent, winrtConfigurationIdC); + RunConfiguration *config = new WinRtRunConfiguration(parent, idFromMap(map)); config->fromMap(map); return config; } @@ -113,6 +122,15 @@ RunConfiguration *WinRtRunConfigurationFactory::clone(Target *parent, RunConfigu return 0; } +bool WinRtRunConfigurationFactory::canHandle(Target *parent) const +{ + if (!isKitCompatible(parent->kit())) + return false; + if (!qobject_cast(parent->project())) + return false; + return true; +} + WinRtRunControlFactory::WinRtRunControlFactory() { } diff --git a/src/plugins/winrt/winrtrunfactories.h b/src/plugins/winrt/winrtrunfactories.h index 2df07f6e7f..be4b26e334 100644 --- a/src/plugins/winrt/winrtrunfactories.h +++ b/src/plugins/winrt/winrtrunfactories.h @@ -52,6 +52,7 @@ public: ProjectExplorer::RunConfiguration *product); private: + bool canHandle(ProjectExplorer::Target *parent) const; virtual ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, Core::Id id); virtual ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent, const QVariantMap &map); }; diff --git a/src/plugins/winrt/winrtrunnerhelper.cpp b/src/plugins/winrt/winrtrunnerhelper.cpp index d9919fa821..19f935d0ce 100644 --- a/src/plugins/winrt/winrtrunnerhelper.cpp +++ b/src/plugins/winrt/winrtrunnerhelper.cpp @@ -90,8 +90,7 @@ bool WinRtRunnerHelper::init(WinRtRunConfiguration *runConfiguration, QString *e return false; } - const Utils::FileName proFile = Utils::FileName::fromString( - target->project()->document()->filePath()); + const QString &proFile = m_runConfiguration->proFilePath(); m_executableFilePath = target->applicationTargets().targetForProject(proFile).toString() + QStringLiteral(".exe"); // ### we should not need to append ".exe" here. -- cgit v1.2.1 From 516b5793d9143ce0f37d53f06dc1c4fffe0d697b Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 4 Aug 2014 16:19:01 +0300 Subject: ProjectExplorer: Cleanup triplet tests * Avoid duplication * Avoid unnecessary casting Change-Id: Idb1426e4a128044091fb52450b5662ff54012f59 Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/abi.cpp | 74 ++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index dcb846138f..56c3f8caa4 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -988,92 +988,90 @@ void ProjectExplorer::ProjectExplorerPlugin::testFlavorForOs() void ProjectExplorer::ProjectExplorerPlugin::testAbiFromTargetTriplet_data() { - QTest::addColumn("targetTriplet"); QTest::addColumn("architecture"); QTest::addColumn("os"); QTest::addColumn("osFlavor"); QTest::addColumn("binaryFormat"); - QTest::addColumn("wordWidth"); + QTest::addColumn("wordWidth"); - QTest::newRow("x86_64-apple-darwin") << "x86_64-apple-darwin" << int(Abi::X86Architecture) + QTest::newRow("x86_64-apple-darwin") << int(Abi::X86Architecture) << int(Abi::MacOS) << int(Abi::GenericMacFlavor) - << int(Abi::MachOFormat) << (unsigned char) 64; + << int(Abi::MachOFormat) << 64; - QTest::newRow("x86_64-apple-darwin12.5.0") << "x86_64-apple-darwin12.5.0" << int(Abi::X86Architecture) + QTest::newRow("x86_64-apple-darwin12.5.0") << int(Abi::X86Architecture) << int(Abi::MacOS) << int(Abi::GenericMacFlavor) - << int(Abi::MachOFormat) << (unsigned char) 64; + << int(Abi::MachOFormat) << 64; - QTest::newRow("x86_64-linux-gnu") << "x86_64-linux-gnu" << int(Abi::X86Architecture) + QTest::newRow("x86_64-linux-gnu") << int(Abi::X86Architecture) << int(Abi::LinuxOS) << int(Abi::GenericLinuxFlavor) - << int(Abi::ElfFormat) << (unsigned char) 64; + << int(Abi::ElfFormat) << 64; - QTest::newRow("x86_64-pc-mingw32msvc") << "x86_64-pc-mingw32msvc" << int(Abi::X86Architecture) + QTest::newRow("x86_64-pc-mingw32msvc") << int(Abi::X86Architecture) << int(Abi::WindowsOS) << int(Abi::WindowsMSysFlavor) - << int(Abi::PEFormat) << (unsigned char) 64; + << int(Abi::PEFormat) << 64; - QTest::newRow("i586-pc-mingw32msvc") << "i586-pc-mingw32msvc" << int(Abi::X86Architecture) + QTest::newRow("i586-pc-mingw32msvc") << int(Abi::X86Architecture) << int(Abi::WindowsOS) << int(Abi::WindowsMSysFlavor) - << int(Abi::PEFormat) << (unsigned char) 0; + << int(Abi::PEFormat) << 0; - QTest::newRow("i686-linux-gnu") << "i686-linux-gnu" << int(Abi::X86Architecture) + QTest::newRow("i686-linux-gnu") << int(Abi::X86Architecture) << int(Abi::LinuxOS) << int(Abi::GenericLinuxFlavor) - << int(Abi::ElfFormat) << (unsigned char) 0; + << int(Abi::ElfFormat) << 0; - QTest::newRow("i686-linux-android") << "i686-linux-android" << int(Abi::X86Architecture) + QTest::newRow("i686-linux-android") << int(Abi::X86Architecture) << int(Abi::LinuxOS) << int(Abi::AndroidLinuxFlavor) - << int(Abi::ElfFormat) << (unsigned char) 0; + << int(Abi::ElfFormat) << 0; - QTest::newRow("i686-pc-linux-android") << "i686-pc-linux-android" << int(Abi::X86Architecture) + QTest::newRow("i686-pc-linux-android") << int(Abi::X86Architecture) << int(Abi::LinuxOS) << int(Abi::AndroidLinuxFlavor) - << int(Abi::ElfFormat) << (unsigned char) 0; + << int(Abi::ElfFormat) << 0; - QTest::newRow("i686-pc-mingw32") << "i686-pc-mingw32" << int(Abi::X86Architecture) + QTest::newRow("i686-pc-mingw32") << int(Abi::X86Architecture) << int(Abi::WindowsOS) << int(Abi::WindowsMSysFlavor) - << int(Abi::PEFormat) << (unsigned char) 0; + << int(Abi::PEFormat) << 0; - QTest::newRow("i686-w64-mingw32") << "i686-w64-mingw32" << int(Abi::X86Architecture) + QTest::newRow("i686-w64-mingw32") << int(Abi::X86Architecture) << int(Abi::WindowsOS) << int(Abi::WindowsMSysFlavor) - << int(Abi::PEFormat) << (unsigned char) 0; + << int(Abi::PEFormat) << 0; - QTest::newRow("mingw32") << "mingw32" << int(Abi::X86Architecture) + QTest::newRow("mingw32") << int(Abi::X86Architecture) << int(Abi::WindowsOS) << int(Abi::WindowsMSysFlavor) - << int(Abi::PEFormat) << (unsigned char) 0; + << int(Abi::PEFormat) << 0; - QTest::newRow("arm-linux-android") << "arm-linux-android" << int(Abi::ArmArchitecture) + QTest::newRow("arm-linux-android") << int(Abi::ArmArchitecture) << int(Abi::LinuxOS) << int(Abi::AndroidLinuxFlavor) - << int(Abi::ElfFormat) << (unsigned char) 32; + << int(Abi::ElfFormat) << 32; - QTest::newRow("arm-linux-androideabi") << "arm-linux-androideabi" << int(Abi::ArmArchitecture) + QTest::newRow("arm-linux-androideabi") << int(Abi::ArmArchitecture) << int(Abi::LinuxOS) << int(Abi::AndroidLinuxFlavor) - << int(Abi::ElfFormat) << (unsigned char) 32; + << int(Abi::ElfFormat) << 32; - QTest::newRow("arm-none-linux-gnueabi") << "arm-none-linux-gnueabi" << int(Abi::ArmArchitecture) + QTest::newRow("arm-none-linux-gnueabi") << int(Abi::ArmArchitecture) << int(Abi::LinuxOS) << int(Abi::GenericLinuxFlavor) - << int(Abi::ElfFormat) << (unsigned char) 32; + << int(Abi::ElfFormat) << 32; - QTest::newRow("mipsel-linux-android") << "mipsel-linux-android" << int(Abi::MipsArchitecture) + QTest::newRow("mipsel-linux-android") << int(Abi::MipsArchitecture) << int(Abi::LinuxOS) << int(Abi::AndroidLinuxFlavor) - << int(Abi::ElfFormat) << (unsigned char) 32; + << int(Abi::ElfFormat) << 32; - QTest::newRow("mipsel-unknown-linux-android") << "mipsel-unknown-linux-android" << int(Abi::MipsArchitecture) + QTest::newRow("mipsel-unknown-linux-android") << int(Abi::MipsArchitecture) << int(Abi::LinuxOS) << int(Abi::AndroidLinuxFlavor) - << int(Abi::ElfFormat) << (unsigned char) 32; + << int(Abi::ElfFormat) << 32; } void ProjectExplorer::ProjectExplorerPlugin::testAbiFromTargetTriplet() { - QFETCH(QString, targetTriplet); QFETCH(int, architecture); QFETCH(int, os); QFETCH(int, osFlavor); QFETCH(int, binaryFormat); - QFETCH(unsigned char, wordWidth); + QFETCH(int, wordWidth); const Abi expectedAbi = Abi(Abi::Architecture(architecture), Abi::OS(os), Abi::OSFlavor(osFlavor), - Abi::BinaryFormat(binaryFormat), wordWidth); + Abi::BinaryFormat(binaryFormat), unsigned char(wordWidth)); - QCOMPARE(Abi::abiFromTargetTriplet(targetTriplet), expectedAbi); + QCOMPARE(Abi::abiFromTargetTriplet(QLatin1String(QTest::currentDataTag())), expectedAbi); } #endif -- cgit v1.2.1 From 4dd200259f28e608b845e3c063251b5157042397 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 4 Aug 2014 12:45:46 +0300 Subject: ProjectExplorer: Improve detection of MIPS variants Detect also "mips" and "mips64" as mips Change-Id: Ia2259bc4c1144834d20f6bd1c7c91f359e1a67d8 Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/abi.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index 56c3f8caa4..f6fe084a5b 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -469,9 +469,9 @@ Abi Abi::abiFromTargetTriplet(const QString &triple) } else if (p.startsWith(QLatin1String("arm"))) { arch = Abi::ArmArchitecture; width = 32; - } else if (p == QLatin1String("mipsel")) { + } else if (p.startsWith(QLatin1String("mips"))) { arch = Abi::MipsArchitecture; - width = 32; + width = p.endsWith(QLatin1String("64")) ? 64 : 32; } else if (p == QLatin1String("x86_64") || p == QLatin1String("amd64")) { arch = Abi::X86Architecture; width = 64; @@ -1057,6 +1057,14 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiFromTargetTriplet_data() QTest::newRow("mipsel-unknown-linux-android") << int(Abi::MipsArchitecture) << int(Abi::LinuxOS) << int(Abi::AndroidLinuxFlavor) << int(Abi::ElfFormat) << 32; + + QTest::newRow("mips-linux-gnu") << int(Abi::MipsArchitecture) + << int(Abi::LinuxOS) << int(Abi::GenericLinuxFlavor) + << int(Abi::ElfFormat) << 32; + + QTest::newRow("mips64-linux-octeon-gnu") << int(Abi::MipsArchitecture) + << int(Abi::LinuxOS) << int(Abi::GenericLinuxFlavor) + << int(Abi::ElfFormat) << 64; } void ProjectExplorer::ProjectExplorerPlugin::testAbiFromTargetTriplet() -- cgit v1.2.1 From ed02e7f3c51210a47a769568d5eeb4e5b26f7246 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 4 Aug 2014 15:59:25 +0300 Subject: Git: Fix crash when returning to commit editor from diff The crash happens on Linux/Xming. 2 subsequents calls to slotRefreshCommitData occur, m_commitDataFetcher is released when the first one is handled, and the second call dereferences NULL. Change-Id: Ibc06fe5dd89b790ac84544f6842cbf345d118703 Reviewed-by: Tobias Hunger --- src/plugins/git/gitsubmiteditor.cpp | 9 +++++---- src/plugins/vcsbase/submiteditorwidget.cpp | 5 +++++ src/plugins/vcsbase/submiteditorwidget.h | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/plugins/git/gitsubmiteditor.cpp b/src/plugins/git/gitsubmiteditor.cpp index d7844723b3..703ef82795 100644 --- a/src/plugins/git/gitsubmiteditor.cpp +++ b/src/plugins/git/gitsubmiteditor.cpp @@ -229,9 +229,10 @@ void GitSubmitEditor::updateFileModel() m_firstUpdate = false; return; } - if (m_workingDirectory.isEmpty()) + GitSubmitEditorWidget *w = submitEditorWidget(); + if (w->updateInProgress() || m_workingDirectory.isEmpty()) return; - submitEditorWidget()->setUpdateInProgress(true); + w->setUpdateInProgress(true); resetCommitDataFetcher(); m_commitDataFetcher = new CommitDataFetcher(m_commitType, m_workingDirectory); connect(m_commitDataFetcher, SIGNAL(finished(bool)), this, SLOT(commitDataRetrieved(bool))); @@ -244,10 +245,9 @@ void GitSubmitEditor::updateFileModel() void GitSubmitEditor::commitDataRetrieved(bool success) { GitSubmitEditorWidget *w = submitEditorWidget(); - w->setUpdateInProgress(false); if (success) { setCommitData(m_commitDataFetcher->commitData()); - submitEditorWidget()->refreshLog(m_workingDirectory); + w->refreshLog(m_workingDirectory); w->setEnabled(true); } else { // Nothing to commit left! @@ -257,6 +257,7 @@ void GitSubmitEditor::commitDataRetrieved(bool success) } m_commitDataFetcher->deleteLater(); m_commitDataFetcher = 0; + w->setUpdateInProgress(false); } GitSubmitEditorPanelData GitSubmitEditor::panelData() const diff --git a/src/plugins/vcsbase/submiteditorwidget.cpp b/src/plugins/vcsbase/submiteditorwidget.cpp index efbc5d40c0..2568c4f532 100644 --- a/src/plugins/vcsbase/submiteditorwidget.cpp +++ b/src/plugins/vcsbase/submiteditorwidget.cpp @@ -583,6 +583,11 @@ void SubmitEditorWidget::setUpdateInProgress(bool value) updateSubmitAction(); } +bool SubmitEditorWidget::updateInProgress() const +{ + return d->m_updateInProgress; +} + QString SubmitEditorWidget::commitName() const { return tr("&Commit"); diff --git a/src/plugins/vcsbase/submiteditorwidget.h b/src/plugins/vcsbase/submiteditorwidget.h index 6d84197735..06a5a54a50 100644 --- a/src/plugins/vcsbase/submiteditorwidget.h +++ b/src/plugins/vcsbase/submiteditorwidget.h @@ -105,6 +105,7 @@ public: virtual bool canSubmit() const; void setUpdateInProgress(bool value); + bool updateInProgress() const; signals: void diffSelected(const QList &); -- cgit v1.2.1 From 80a39815f041b37af0df0a3c6696f322f2427416 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Mon, 4 Aug 2014 12:35:20 +0200 Subject: QmlDesigner: Limit native key to 31 letter OS X is only supporting a maximum of 31 letters for shared memory names. Change-Id: I61351228decaa3fa7ec19a6035620ab932cf5386 Reviewed-by: Tim Jenssen --- share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp b/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp index d249e5e49a..d356dd31ef 100644 --- a/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp +++ b/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp @@ -101,12 +101,13 @@ static QByteArray makePlatformSafeKey(const QString &key) if (key.isEmpty()) return QByteArray(); QByteArray data(QCryptographicHash::hash(key.toLatin1(), QCryptographicHash::Sha1).toBase64()); - QString notBase64UrlChars(QStringLiteral("[=+/]")); - QByteArray normalizedData; - normalizedData = QString(data).replace(QRegExp(notBase64UrlChars), QStringLiteral("_")).toLatin1(); + data = data.replace('+', '-'); + data = data.replace('/', '_'); - return normalizedData; + data.truncate(31); // OS X is only supporting 31 byte long names + + return data; } -- cgit v1.2.1 From a158ed44ba399a533e64eeaeeebc1b5906952dd2 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 4 Aug 2014 14:16:56 +0200 Subject: QmlDesigner.PropertyEditor: Add Q_DISABLE_COPY to PropertyEditorQmlBackend Change-Id: Ib9af721d195291886a78fc300e24691827f56ade Reviewed-by: Tobias Hunger Reviewed-by: Tim Jenssen --- .../components/propertyeditor/propertyeditorqmlbackend.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h index acc7571cac..7c355707c7 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h @@ -46,7 +46,12 @@ namespace QmlDesigner { class PropertyEditorTransaction; class PropertyEditorView; -class PropertyEditorQmlBackend { +class PropertyEditorQmlBackend +{ + + Q_DISABLE_COPY(PropertyEditorQmlBackend) + + public: PropertyEditorQmlBackend(PropertyEditorView *propertyEditor); ~PropertyEditorQmlBackend(); -- cgit v1.2.1 From a21a55b59be551b3acd57c4fc014f5cf99ce2f7d Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 4 Aug 2014 14:19:07 +0200 Subject: QmlDesigner.ShortcutManager: Fix CLANG static analysis warnings Change-Id: I9600439e1236c52b347c667bac6b6d79e2335375 Reviewed-by: Tobias Hunger Reviewed-by: Tim Jenssen --- src/plugins/qmldesigner/shortcutmanager.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/qmldesigner/shortcutmanager.cpp b/src/plugins/qmldesigner/shortcutmanager.cpp index f562bee2c3..a5852a4f84 100644 --- a/src/plugins/qmldesigner/shortcutmanager.cpp +++ b/src/plugins/qmldesigner/shortcutmanager.cpp @@ -115,36 +115,36 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex //Edit Menu - command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_BACKSPACE, qmlDesignerFormEditorContext); + Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_BACKSPACE, qmlDesignerFormEditorContext); command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_BACKSPACE, qmlDesignerNavigatorContext); command->setDefaultKeySequence(QKeySequence(Qt::Key_Backspace)); command->setAttribute(Core::Command::CA_Hide); // don't show delete in other modes if (Utils::HostOsInfo::isMacHost()) editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE); - command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_DELETE, qmlDesignerFormEditorContext); + Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_DELETE, qmlDesignerFormEditorContext); command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_DELETE, qmlDesignerNavigatorContext); command->setDefaultKeySequence(QKeySequence::Delete); command->setAttribute(Core::Command::CA_Hide); // don't show delete in other modes if (!Utils::HostOsInfo::isMacHost()) editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE); - command = Core::ActionManager::registerAction(&m_cutAction, Core::Constants::CUT, qmlDesignerFormEditorContext); + Core::ActionManager::registerAction(&m_cutAction, Core::Constants::CUT, qmlDesignerFormEditorContext); command = Core::ActionManager::registerAction(&m_cutAction, Core::Constants::CUT, qmlDesignerNavigatorContext); command->setDefaultKeySequence(QKeySequence::Cut); editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE); - command = Core::ActionManager::registerAction(&m_copyAction, Core::Constants::COPY, qmlDesignerFormEditorContext); + Core::ActionManager::registerAction(&m_copyAction, Core::Constants::COPY, qmlDesignerFormEditorContext); command = Core::ActionManager::registerAction(&m_copyAction, Core::Constants::COPY, qmlDesignerNavigatorContext); command->setDefaultKeySequence(QKeySequence::Copy); editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE); - command = Core::ActionManager::registerAction(&m_pasteAction, Core::Constants::PASTE, qmlDesignerFormEditorContext); + Core::ActionManager::registerAction(&m_pasteAction, Core::Constants::PASTE, qmlDesignerFormEditorContext); command = Core::ActionManager::registerAction(&m_pasteAction, Core::Constants::PASTE, qmlDesignerNavigatorContext); command->setDefaultKeySequence(QKeySequence::Paste); editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE); - command = Core::ActionManager::registerAction(&m_selectAllAction, Core::Constants::SELECTALL, qmlDesignerFormEditorContext); + Core::ActionManager::registerAction(&m_selectAllAction, Core::Constants::SELECTALL, qmlDesignerFormEditorContext); command = Core::ActionManager::registerAction(&m_selectAllAction, Core::Constants::SELECTALL, qmlDesignerNavigatorContext); command->setDefaultKeySequence(QKeySequence::SelectAll); @@ -166,7 +166,7 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex command->setAttribute(Core::Command::CA_Hide); viewsMenu->addAction(command); - command = Core::ActionManager::registerAction(&m_hideSidebarsAction, Core::Constants::TOGGLE_SIDEBAR, qmlDesignerMainContext); + Core::ActionManager::registerAction(&m_hideSidebarsAction, Core::Constants::TOGGLE_SIDEBAR, qmlDesignerMainContext); } void ShortCutManager::updateActions(Core::IEditor* currentEditor) -- cgit v1.2.1 From f4a56fce407db51d7da9a5ed1186d8fc07ee3b6f Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 1 Aug 2014 17:53:28 +0200 Subject: WinRt: remove unused using directive Change-Id: Ie8857eb180109fff3fb8e1eb14a493b38f2133a7 Reviewed-by: Christian Kandeler --- src/plugins/winrt/winrtruncontrol.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/winrt/winrtruncontrol.cpp b/src/plugins/winrt/winrtruncontrol.cpp index ae0635ae93..af066f3171 100644 --- a/src/plugins/winrt/winrtruncontrol.cpp +++ b/src/plugins/winrt/winrtruncontrol.cpp @@ -49,7 +49,6 @@ using ProjectExplorer::IDevice; using ProjectExplorer::RunControl; using ProjectExplorer::RunMode; using ProjectExplorer::Target; -using Utils::QtcProcess; namespace WinRt { namespace Internal { -- cgit v1.2.1 From 798af5d70eafcb93630fe7c132ecf82887e2967a Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Thu, 26 Jun 2014 18:15:19 +0200 Subject: QmlDesigner.AddingTabs: Anchor the root item of the tab content Change-Id: Ia59098be3ca25753f03f31f964c6fb824bae677a Reviewed-by: Tim Jenssen --- src/plugins/qmldesigner/componentsplugin/addtabdesigneraction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/componentsplugin/addtabdesigneraction.cpp b/src/plugins/qmldesigner/componentsplugin/addtabdesigneraction.cpp index 742ddcd9d8..f607c37e87 100644 --- a/src/plugins/qmldesigner/componentsplugin/addtabdesigneraction.cpp +++ b/src/plugins/qmldesigner/componentsplugin/addtabdesigneraction.cpp @@ -116,7 +116,8 @@ void AddTabDesignerAction::addNewTab() if (QFileInfo(newFilePath).exists()) { QMessageBox::warning(Core::ICore::mainWindow(), tr("Naming Error"), tr("Component already exists.")); } else { - bool fileCreated = DocumentManager::createFile(newFilePath, QStringLiteral("import QtQuick 2.1\nimport QtQuick.Controls 1.0\n\nItem {\n\n}")); + const QString sourceString = QStringLiteral("import QtQuick 2.1\nimport QtQuick.Controls 1.0\n\nItem {\n anchors.fill: parent\n}"); + bool fileCreated = DocumentManager::createFile(newFilePath, sourceString); if (fileCreated) { DocumentManager::addFileToVersionControl(directoryPath, newFilePath); -- cgit v1.2.1 From 316bfcaee14fff0b58e1a8cd8cbdb46776359aa6 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 4 Aug 2014 14:00:01 +0200 Subject: QmlDesigner.Model: Fix isComponent for Loader Loader was also interpreted as a component, but the handling of component and sourceComponent was incorrect. Change-Id: I5cd691ece1a29c77b52dc74785013f08d589b2eb Reviewed-by: Tim Jenssen --- .../qmldesigner/designercore/model/modelnode.cpp | 24 +++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/plugins/qmldesigner/designercore/model/modelnode.cpp b/src/plugins/qmldesigner/designercore/model/modelnode.cpp index 533b879b04..88d38d083d 100644 --- a/src/plugins/qmldesigner/designercore/model/modelnode.cpp +++ b/src/plugins/qmldesigner/designercore/model/modelnode.cpp @@ -1061,9 +1061,27 @@ bool ModelNode::isComponent() const } if (metaInfo().isSubclassOf("QtQuick.Loader", -1 , -1)) { - if (hasNodeProperty("component") - && nodeProperty("component").modelNode().nodeSourceType() == ModelNode::NodeWithComponentSource) - return true; + + if (hasNodeListProperty("component")) { + + /* + * The component property should be a NodeProperty, but currently is a NodeListProperty, because + * the default property is always implcitly a NodeListProperty. This is something that has to be fixed. + */ + + ModelNode componentNode = nodeListProperty("component").toModelNodeList().first(); + if (componentNode.nodeSourceType() == ModelNode::NodeWithComponentSource) + return true; + if (componentNode.metaInfo().isFileComponent()) + return true; + } + + if (hasNodeProperty("sourceComponent")) { + if (nodeProperty("sourceComponent").modelNode().nodeSourceType() == ModelNode::NodeWithComponentSource) + return true; + if (nodeProperty("sourceComponent").modelNode().metaInfo().isFileComponent()) + return true; + } if (hasVariantProperty("source")) return true; -- cgit v1.2.1 From 0b74df58a5f657b68480e393f3f9528c1d7a0707 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 4 Aug 2014 14:01:04 +0200 Subject: QmlDesigner.DocumentManager: Fix goIntoComponent for Loader We have have to check and handle sourceComponent and component (Tab). Change-Id: I736648fc09fe4ee3333c4524666e3acea500804a Reviewed-by: Tim Jenssen --- src/plugins/qmldesigner/documentmanager.cpp | 47 +++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/plugins/qmldesigner/documentmanager.cpp b/src/plugins/qmldesigner/documentmanager.cpp index 88ab5a4556..0ba3dfa90e 100644 --- a/src/plugins/qmldesigner/documentmanager.cpp +++ b/src/plugins/qmldesigner/documentmanager.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -120,6 +121,34 @@ static void openFileComponentForDelegate(const ModelNode &modelNode) openFileComponent(modelNode.nodeProperty("delegate").modelNode()); } +static void openComponentSourcePropertyOfLoader(const ModelNode &modelNode) +{ + QmlDesignerPlugin::instance()->viewManager().nextFileIsCalledInternally(); + + QHash propertyHash; + + getProperties(modelNode, propertyHash); + + ModelNode componentModelNode; + + if (modelNode.hasNodeProperty("sourceComponent")) { + componentModelNode = modelNode.nodeProperty("sourceComponent").modelNode(); + } else if (modelNode.hasNodeListProperty("component")) { + + /* + * The component property should be a NodeProperty, but currently is a NodeListProperty, because + * the default property is always implcitly a NodeListProperty. This is something that has to be fixed. + */ + + componentModelNode = modelNode.nodeListProperty("component").toModelNodeList().first(); + } + + Core::EditorManager::openEditor(componentModelNode.metaInfo().componentFileName(), Core::Id(), Core::EditorManager::DoNotMakeVisible); + + ModelNode rootModelNode = currentDesignDocument()->rewriterView()->rootModelNode(); + applyProperties(rootModelNode, propertyHash); +} + static void openSourcePropertyOfLoader(const ModelNode &modelNode) { QmlDesignerPlugin::instance()->viewManager().nextFileIsCalledInternally(); @@ -202,6 +231,22 @@ static bool hasDelegateWithFileComponent(const ModelNode &node) return false; } +static bool isLoaderWithSourceComponent(const ModelNode &modelNode) +{ + if (modelNode.isValid() + && modelNode.metaInfo().isValid() + && modelNode.metaInfo().isSubclassOf("QtQuick.Loader", -1, -1)) { + + if (modelNode.hasNodeProperty("sourceComponent")) + return true; + if (modelNode.hasNodeListProperty("component")) + return true; + } + + return false; + +} + static bool hasSourceWithFileComponent(const ModelNode &modelNode) { if (modelNode.isValid() @@ -265,6 +310,8 @@ void DocumentManager::goIntoComponent(const ModelNode &modelNode) openFileComponentForDelegate(modelNode); else if (hasSourceWithFileComponent(modelNode)) openSourcePropertyOfLoader(modelNode); + else if (isLoaderWithSourceComponent(modelNode)) + openComponentSourcePropertyOfLoader(modelNode); else openInlineComponent(modelNode); } -- cgit v1.2.1 From b525addb104517bb59061ba355530df0d0a4c3b2 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 5 Aug 2014 06:34:00 +0300 Subject: ProjectExplorer: Fix compilation with GCC Change-Id: I981df3a89dcd7aacd19f7c5eb8c15b027bdd16e4 Reviewed-by: Orgad Shaneh --- src/plugins/projectexplorer/abi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index f6fe084a5b..f8fb18ed76 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -1077,7 +1077,7 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiFromTargetTriplet() const Abi expectedAbi = Abi(Abi::Architecture(architecture), Abi::OS(os), Abi::OSFlavor(osFlavor), - Abi::BinaryFormat(binaryFormat), unsigned char(wordWidth)); + Abi::BinaryFormat(binaryFormat), (unsigned char)wordWidth); QCOMPARE(Abi::abiFromTargetTriplet(QLatin1String(QTest::currentDataTag())), expectedAbi); } -- cgit v1.2.1 From 31df04c5ae389e6468914a0b40dea4fe0b40d7d1 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Mon, 4 Aug 2014 16:40:14 +0200 Subject: QmlDesigner: fix a crash when moving to subcomponent Change-Id: Ib8fd13a3688447dcb7eeaca811f3abfefa4b5089 Reviewed-by: Thomas Hartmann --- src/plugins/qmldesigner/components/formeditor/selectiontool.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/qmldesigner/components/formeditor/selectiontool.cpp b/src/plugins/qmldesigner/components/formeditor/selectiontool.cpp index 847879e8b7..3805fe07c9 100644 --- a/src/plugins/qmldesigner/components/formeditor/selectiontool.cpp +++ b/src/plugins/qmldesigner/components/formeditor/selectiontool.cpp @@ -251,6 +251,7 @@ void SelectionTool::clear() m_resizeIndicator.clear(); m_anchorIndicator.clear(); m_bindingIndicator.clear(); + m_contentNotEditableIndicator.clear(); AbstractFormEditorTool::clear(); } -- cgit v1.2.1 From b2ac3fd90ccfc21cf4c5bce353d8e08208961eeb Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 5 Aug 2014 12:28:10 +0200 Subject: QmlDesigner.PuppetCreator: Set qmlpuppet dir as working dir Before the working directory was the working directory of Qt Creator. If the working direcotry was the bin diredtory of Qt Creator the puppet picked up the qt.conf from Qt Creator and could not load the platform plugin. Change-Id: Iab22267c578fc837b1b52bded850f0033618811c Reviewed-by: Tim Jenssen --- src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp | 5 +++++ src/plugins/qmldesigner/designercore/instances/puppetcreator.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp b/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp index 48249a07ba..fa98d5c97b 100644 --- a/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp +++ b/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp @@ -132,7 +132,10 @@ QProcess *PuppetCreator::createPuppetProcess(PuppetCreator::QmlPuppetVersion pup else puppetPath = qml2PuppetPath(m_availablePuppetType); + const QString workingDirectory = qmlPuppetDirectory(m_availablePuppetType); + return puppetProcess(puppetPath, + workingDirectory, puppetMode, socketToken, handlerObject, @@ -142,6 +145,7 @@ QProcess *PuppetCreator::createPuppetProcess(PuppetCreator::QmlPuppetVersion pup QProcess *PuppetCreator::puppetProcess(const QString &puppetPath, + const QString &workingDirectory, const QString &puppetMode, const QString &socketToken, QObject *handlerObject, @@ -158,6 +162,7 @@ QProcess *PuppetCreator::puppetProcess(const QString &puppetPath, puppetProcess->setProcessChannelMode(QProcess::MergedChannels); QObject::connect(puppetProcess, SIGNAL(readyRead()), handlerObject, outputSlot); } + puppetProcess->setWorkingDirectory(workingDirectory); puppetProcess->start(puppetPath, QStringList() << socketToken << puppetMode << "-graphicssystem raster"); if (!qgetenv("DEBUG_QML_PUPPET").isEmpty()) diff --git a/src/plugins/qmldesigner/designercore/instances/puppetcreator.h b/src/plugins/qmldesigner/designercore/instances/puppetcreator.h index 31bc499c43..4c9b8c337b 100644 --- a/src/plugins/qmldesigner/designercore/instances/puppetcreator.h +++ b/src/plugins/qmldesigner/designercore/instances/puppetcreator.h @@ -94,6 +94,7 @@ protected: bool qtIsSupported() const; static bool checkPuppetVersion(const QString &qmlPuppetPath); QProcess *puppetProcess(const QString &puppetPath, + const QString &workingDirectory, const QString &puppetMode, const QString &socketToken, QObject *handlerObject, -- cgit v1.2.1