diff --git a/bin/gdbmacros/gdbmacros.cpp b/bin/gdbmacros/gdbmacros.cpp index 2af0e4b2301..7a304607b6c 100644 --- a/bin/gdbmacros/gdbmacros.cpp +++ b/bin/gdbmacros/gdbmacros.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/doc/api/qtcreator-api.qdoc b/doc/api/qtcreator-api.qdoc index 5ac78d98069..1cf030faaca 100644 --- a/doc/api/qtcreator-api.qdoc +++ b/doc/api/qtcreator-api.qdoc @@ -4,6 +4,10 @@ Qt Creator is Qt Software's crossplatform IDE. The core of Qt Creator is basically only a \l{ExtensionSystem}{plugin loader}. + All functionality is implemented in plugins, the basis of Qt Creator is + implemented in the \l{Core} {Core} Plugin. The plugin manager provides + simple means for plugin cooperation that allow plugins to provide + hooks for other plugin's extensions. \section1 Core Libraries @@ -75,8 +79,3 @@ \generatelist functionindex */ -/*! - \group qtc - - \title Core Plugin -*/ diff --git a/doc/api/qtcreator-api.qdocconf b/doc/api/qtcreator-api.qdocconf index 92c40b8a388..476c8e6a4df 100644 --- a/doc/api/qtcreator-api.qdocconf +++ b/doc/api/qtcreator-api.qdocconf @@ -6,14 +6,14 @@ language = Cpp headerdirs = . \ ../../src/libs/aggregation \ ../../src/libs/extensionsystem \ - ../../src/plugins/core \ - ../../src/plugins/core/actionmanager + ../../src/plugins/coreplugin \ + ../../src/plugins/coreplugin/actionmanager sourcedirs = . \ ../../src/libs/aggregation \ ../../src/libs/extensionsystem \ - ../../src/plugins/core \ - ../../src/plugins/core/actionmanager + ../../src/plugins/coreplugin \ + ../../src/plugins/coreplugin/actionmanager headers.fileextesnions = "*.h" sources.fileextensions = "*.cpp *.qdoc" diff --git a/doc/doc.pri b/doc/doc.pri index d8e65d4a944..e9e34fe733b 100644 --- a/doc/doc.pri +++ b/doc/doc.pri @@ -2,7 +2,7 @@ unix { QDOC = SRCDIR=$$PWD OUTDIR=$$OUT_PWD/doc/html $$(QTDIR)/tools/qdoc3/qdoc3 HELPGENERATOR = $$(QTDIR)/bin/qhelpgenerator } else { - QDOC = $$(QTDIR)\tools\qdoc3\release\qdoc3.exe + QDOC = set SRCDIR=$$PWD&& set OUTDIR=$$OUT_PWD/doc/html&& $$(QTDIR)\tools\qdoc3\release\qdoc3.exe HELPGENERATOR = $$(QTDIR)\bin\qhelpgenerator.exe } diff --git a/doc/example/textfinder/main.cpp b/doc/example/textfinder/main.cpp index 5e73ed9d91c..30fe49baf0c 100644 --- a/doc/example/textfinder/main.cpp +++ b/doc/example/textfinder/main.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/doc/example/textfinder/textfinder.cpp b/doc/example/textfinder/textfinder.cpp index c289b45e8ce..20050f603dd 100644 --- a/doc/example/textfinder/textfinder.cpp +++ b/doc/example/textfinder/textfinder.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/doc/example/textfinder/textfinder.h b/doc/example/textfinder/textfinder.h index a712a1d12d2..ebcb0fb87c3 100644 --- a/doc/example/textfinder/textfinder.h +++ b/doc/example/textfinder/textfinder.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index cb2964553ab..3c50c9d4280 100644 --- a/doc/qtcreator.qdoc +++ b/doc/qtcreator.qdoc @@ -151,6 +151,26 @@ \image qtcreator-compile-pane.png + + \section1 Session Management in Qt Creator + + ### screenshot + + In Qt Creator, a session is a collection of loaded projects, opened files, + editor settings, and so on. When you run Qt Creator, you have a default + session. You can create a new session using the \gui{Session Manager...}, + available in the \gui{File -> Session} menu. + + To switch between sessions, select \gui{File -> Session}. If you do not + create and select any session, Qt Creator will always use the default + session. + +\omit + session management can also store project dependencies, thorbjorn is + currently working on it +\endomit + + \section1 Qt Help Integration Qt Creator comes fully integrated with all of Qt's documentation and diff --git a/examples/scripting/demo.js b/examples/scripting/demo.js index b823995fa66..804a87d0c2e 100644 --- a/examples/scripting/demo.js +++ b/examples/scripting/demo.js @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cpaster/cgi.cpp b/shared/cpaster/cgi.cpp index eeeea1ac855..fddbbc18a28 100644 --- a/shared/cpaster/cgi.cpp +++ b/shared/cpaster/cgi.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cpaster/cgi.h b/shared/cpaster/cgi.h index d1b904348e6..b615ee79fe1 100644 --- a/shared/cpaster/cgi.h +++ b/shared/cpaster/cgi.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cpaster/fetcher.cpp b/shared/cpaster/fetcher.cpp index 39995d899f4..11cfb9d24e8 100644 --- a/shared/cpaster/fetcher.cpp +++ b/shared/cpaster/fetcher.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cpaster/fetcher.h b/shared/cpaster/fetcher.h index d188412f76a..e532d88a1e8 100644 --- a/shared/cpaster/fetcher.h +++ b/shared/cpaster/fetcher.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cpaster/poster.cpp b/shared/cpaster/poster.cpp index 5c20cc44c5e..b55cb8e8505 100644 --- a/shared/cpaster/poster.cpp +++ b/shared/cpaster/poster.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cpaster/poster.h b/shared/cpaster/poster.h index f60896dbd0b..fb1121b6d60 100644 --- a/shared/cpaster/poster.h +++ b/shared/cpaster/poster.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cpaster/splitter.cpp b/shared/cpaster/splitter.cpp index 490108136f3..3b79d0153a0 100644 --- a/shared/cpaster/splitter.cpp +++ b/shared/cpaster/splitter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cpaster/splitter.h b/shared/cpaster/splitter.h index 9b333c19e0f..57fb3349405 100644 --- a/shared/cpaster/splitter.h +++ b/shared/cpaster/splitter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cpaster/view.cpp b/shared/cpaster/view.cpp index f1fd664b794..a38c5763506 100644 --- a/shared/cpaster/view.cpp +++ b/shared/cpaster/view.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cpaster/view.h b/shared/cpaster/view.h index f5eb4113323..79485b5dbe8 100644 --- a/shared/cpaster/view.h +++ b/shared/cpaster/view.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/AST.cpp b/shared/cplusplus/AST.cpp index 11be99ea48a..3d710db3669 100644 --- a/shared/cplusplus/AST.cpp +++ b/shared/cplusplus/AST.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -117,6 +117,9 @@ CatchClauseAST *AST::asCatchClause() ClassSpecifierAST *AST::asClassSpecifier() { return dynamic_cast(this); } +CompoundLiteralAST *AST::asCompoundLiteral() +{ return dynamic_cast(this); } + CompoundStatementAST *AST::asCompoundStatement() { return dynamic_cast(this); } @@ -774,6 +777,42 @@ unsigned BoolLiteralAST::lastToken() const return token + 1; } +CompoundLiteralAST *CompoundLiteralAST::clone(MemoryPool *pool) const +{ + CompoundLiteralAST *ast = new (pool) CompoundLiteralAST; + ast->lparen_token = lparen_token; + if (type_id) + ast->type_id = type_id->clone(pool); + ast->rparen_token = rparen_token; + if (initializer) + ast->initializer = initializer->clone(pool); + return ast; +} + +void CompoundLiteralAST::accept0(ASTVisitor *visitor) +{ + if (visitor->visit(this)) { + accept(type_id, visitor); + accept(initializer, visitor); + } +} + +unsigned CompoundLiteralAST::firstToken() const +{ + return lparen_token; +} + +unsigned CompoundLiteralAST::lastToken() const +{ + if (initializer) + return initializer->lastToken(); + else if (rparen_token) + return rparen_token + 1; + else if (type_id) + return type_id->lastToken(); + return lparen_token + 1; +} + BreakStatementAST *BreakStatementAST::clone(MemoryPool *pool) const { BreakStatementAST *ast = new (pool) BreakStatementAST; diff --git a/shared/cplusplus/AST.h b/shared/cplusplus/AST.h index 6607e76805b..d7f346c5b0c 100644 --- a/shared/cplusplus/AST.h +++ b/shared/cplusplus/AST.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -94,6 +94,7 @@ public: CastExpressionAST *asCastExpression(); CatchClauseAST *asCatchClause(); ClassSpecifierAST *asClassSpecifier(); + CompoundLiteralAST *asCompoundLiteral(); CompoundStatementAST *asCompoundStatement(); ConditionAST *asCondition(); ConditionalExpressionAST *asConditionalExpression(); @@ -429,6 +430,24 @@ protected: virtual void accept0(ASTVisitor *visitor); }; +class CPLUSPLUS_EXPORT CompoundLiteralAST: public ExpressionAST +{ +public: + unsigned lparen_token; + ExpressionAST *type_id; + unsigned rparen_token; + ExpressionAST *initializer; + +public: + virtual unsigned firstToken() const; + virtual unsigned lastToken() const; + + virtual CompoundLiteralAST *clone(MemoryPool *pool) const; + +protected: + virtual void accept0(ASTVisitor *visitor); +}; + class CPLUSPLUS_EXPORT QtMethodAST: public ExpressionAST { public: diff --git a/shared/cplusplus/ASTVisitor.cpp b/shared/cplusplus/ASTVisitor.cpp index 9fbf242700e..7b9ca1ed7fa 100644 --- a/shared/cplusplus/ASTVisitor.cpp +++ b/shared/cplusplus/ASTVisitor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/ASTVisitor.h b/shared/cplusplus/ASTVisitor.h index 28097c14f70..f8d2d6790ee 100644 --- a/shared/cplusplus/ASTVisitor.h +++ b/shared/cplusplus/ASTVisitor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -104,6 +104,7 @@ public: virtual bool visit(CastExpressionAST *) { return true; } virtual bool visit(CatchClauseAST *) { return true; } virtual bool visit(ClassSpecifierAST *) { return true; } + virtual bool visit(CompoundLiteralAST *) { return true; } virtual bool visit(CompoundStatementAST *) { return true; } virtual bool visit(ConditionAST *) { return true; } virtual bool visit(ConditionalExpressionAST *) { return true; } diff --git a/shared/cplusplus/ASTfwd.h b/shared/cplusplus/ASTfwd.h index 79f794f629e..b4f5283a748 100644 --- a/shared/cplusplus/ASTfwd.h +++ b/shared/cplusplus/ASTfwd.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -77,6 +77,7 @@ class CaseStatementAST; class CastExpressionAST; class CatchClauseAST; class ClassSpecifierAST; +class CompoundLiteralAST; class CompoundStatementAST; class ConditionAST; class ConditionalExpressionAST; diff --git a/shared/cplusplus/Array.cpp b/shared/cplusplus/Array.cpp index e6b9c9f4fe1..7159008fd42 100644 --- a/shared/cplusplus/Array.cpp +++ b/shared/cplusplus/Array.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Array.h b/shared/cplusplus/Array.h index 08618fce03a..c639affc89f 100644 --- a/shared/cplusplus/Array.h +++ b/shared/cplusplus/Array.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/CPlusPlusForwardDeclarations.h b/shared/cplusplus/CPlusPlusForwardDeclarations.h index 78f06e647d3..31b01bfd815 100644 --- a/shared/cplusplus/CPlusPlusForwardDeclarations.h +++ b/shared/cplusplus/CPlusPlusForwardDeclarations.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/CheckDeclaration.cpp b/shared/cplusplus/CheckDeclaration.cpp index bb83b6a6706..610d57626f4 100644 --- a/shared/cplusplus/CheckDeclaration.cpp +++ b/shared/cplusplus/CheckDeclaration.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/CheckDeclaration.h b/shared/cplusplus/CheckDeclaration.h index 6c6148ce6a5..6e82678fa01 100644 --- a/shared/cplusplus/CheckDeclaration.h +++ b/shared/cplusplus/CheckDeclaration.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/CheckDeclarator.cpp b/shared/cplusplus/CheckDeclarator.cpp index d21f14cecf0..13120fec589 100644 --- a/shared/cplusplus/CheckDeclarator.cpp +++ b/shared/cplusplus/CheckDeclarator.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/CheckDeclarator.h b/shared/cplusplus/CheckDeclarator.h index 11f14c5e501..b1de623b00e 100644 --- a/shared/cplusplus/CheckDeclarator.h +++ b/shared/cplusplus/CheckDeclarator.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/CheckExpression.cpp b/shared/cplusplus/CheckExpression.cpp index 9976cbf500e..e546a99a539 100644 --- a/shared/cplusplus/CheckExpression.cpp +++ b/shared/cplusplus/CheckExpression.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -333,6 +333,13 @@ bool CheckExpression::visit(QtMethodAST *ast) return false; } +bool CheckExpression::visit(CompoundLiteralAST *ast) +{ + /*FullySpecifiedType exprTy = */ semantic()->check(ast->type_id, _scope); + /*FullySpecifiedType initTy = */ semantic()->check(ast->initializer, _scope); + return false; +} + bool CheckExpression::visit(CallAST *ast) { for (ExpressionListAST *it = ast->expression_list; it; it = it->next) { diff --git a/shared/cplusplus/CheckExpression.h b/shared/cplusplus/CheckExpression.h index e018e7dc89b..5b5ae884b77 100644 --- a/shared/cplusplus/CheckExpression.h +++ b/shared/cplusplus/CheckExpression.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -98,6 +98,7 @@ protected: virtual bool visit(TypeIdAST *ast); virtual bool visit(UnaryExpressionAST *ast); virtual bool visit(QtMethodAST *ast); + virtual bool visit(CompoundLiteralAST *ast); //names virtual bool visit(QualifiedNameAST *ast); diff --git a/shared/cplusplus/CheckName.cpp b/shared/cplusplus/CheckName.cpp index c2976a9aa38..09b90f3cb80 100644 --- a/shared/cplusplus/CheckName.cpp +++ b/shared/cplusplus/CheckName.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/CheckName.h b/shared/cplusplus/CheckName.h index 98caed462d8..4b0631b0025 100644 --- a/shared/cplusplus/CheckName.h +++ b/shared/cplusplus/CheckName.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/CheckSpecifier.cpp b/shared/cplusplus/CheckSpecifier.cpp index dabb4f4bd21..eeb59eebcc0 100644 --- a/shared/cplusplus/CheckSpecifier.cpp +++ b/shared/cplusplus/CheckSpecifier.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/CheckSpecifier.h b/shared/cplusplus/CheckSpecifier.h index d93c8db4808..3e6ddc57bae 100644 --- a/shared/cplusplus/CheckSpecifier.h +++ b/shared/cplusplus/CheckSpecifier.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/CheckStatement.cpp b/shared/cplusplus/CheckStatement.cpp index 7758bd0381f..67902ff252b 100644 --- a/shared/cplusplus/CheckStatement.cpp +++ b/shared/cplusplus/CheckStatement.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/CheckStatement.h b/shared/cplusplus/CheckStatement.h index a6f02fe3916..856f64be8f8 100644 --- a/shared/cplusplus/CheckStatement.h +++ b/shared/cplusplus/CheckStatement.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Control.cpp b/shared/cplusplus/Control.cpp index f6b4e229c21..e44d84a1aee 100644 --- a/shared/cplusplus/Control.cpp +++ b/shared/cplusplus/Control.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Control.h b/shared/cplusplus/Control.h index 87015c20e80..98c1bacdd29 100644 --- a/shared/cplusplus/Control.h +++ b/shared/cplusplus/Control.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/CoreTypes.cpp b/shared/cplusplus/CoreTypes.cpp index b9184b48d5c..cf5a3ca4fb7 100644 --- a/shared/cplusplus/CoreTypes.cpp +++ b/shared/cplusplus/CoreTypes.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/CoreTypes.h b/shared/cplusplus/CoreTypes.h index b05bd96e4fe..c3c04618385 100644 --- a/shared/cplusplus/CoreTypes.h +++ b/shared/cplusplus/CoreTypes.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/DiagnosticClient.cpp b/shared/cplusplus/DiagnosticClient.cpp index 32ade8a066c..12670adef93 100644 --- a/shared/cplusplus/DiagnosticClient.cpp +++ b/shared/cplusplus/DiagnosticClient.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/DiagnosticClient.h b/shared/cplusplus/DiagnosticClient.h index de60b120c4e..6fa06887c6c 100644 --- a/shared/cplusplus/DiagnosticClient.h +++ b/shared/cplusplus/DiagnosticClient.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/FullySpecifiedType.cpp b/shared/cplusplus/FullySpecifiedType.cpp index 18b556c0099..71dec2934bc 100644 --- a/shared/cplusplus/FullySpecifiedType.cpp +++ b/shared/cplusplus/FullySpecifiedType.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/FullySpecifiedType.h b/shared/cplusplus/FullySpecifiedType.h index c484b943edf..d156fff5ab6 100644 --- a/shared/cplusplus/FullySpecifiedType.h +++ b/shared/cplusplus/FullySpecifiedType.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Keywords.cpp b/shared/cplusplus/Keywords.cpp index 8cf8dbbd103..180feb341db 100644 --- a/shared/cplusplus/Keywords.cpp +++ b/shared/cplusplus/Keywords.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Lexer.cpp b/shared/cplusplus/Lexer.cpp index 1f4a0f51751..73c12524d79 100644 --- a/shared/cplusplus/Lexer.cpp +++ b/shared/cplusplus/Lexer.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Lexer.h b/shared/cplusplus/Lexer.h index b6e361d3da7..4cb62493db8 100644 --- a/shared/cplusplus/Lexer.h +++ b/shared/cplusplus/Lexer.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/LiteralTable.cpp b/shared/cplusplus/LiteralTable.cpp index e448330ef8a..21e3b2d8dd7 100644 --- a/shared/cplusplus/LiteralTable.cpp +++ b/shared/cplusplus/LiteralTable.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/LiteralTable.h b/shared/cplusplus/LiteralTable.h index 23de104dd8d..35744fe3601 100644 --- a/shared/cplusplus/LiteralTable.h +++ b/shared/cplusplus/LiteralTable.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Literals.cpp b/shared/cplusplus/Literals.cpp index a2d517d8b61..f7ac69f568a 100644 --- a/shared/cplusplus/Literals.cpp +++ b/shared/cplusplus/Literals.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Literals.h b/shared/cplusplus/Literals.h index 53e5c0dbef3..f55978b270e 100644 --- a/shared/cplusplus/Literals.h +++ b/shared/cplusplus/Literals.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/MemoryPool.cpp b/shared/cplusplus/MemoryPool.cpp index a7c04691449..880c6bb8846 100644 --- a/shared/cplusplus/MemoryPool.cpp +++ b/shared/cplusplus/MemoryPool.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/MemoryPool.h b/shared/cplusplus/MemoryPool.h index 9647b673a6e..13c61c9d248 100644 --- a/shared/cplusplus/MemoryPool.h +++ b/shared/cplusplus/MemoryPool.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Name.cpp b/shared/cplusplus/Name.cpp index 8fc1d82c01c..89e875a93cb 100644 --- a/shared/cplusplus/Name.cpp +++ b/shared/cplusplus/Name.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Name.h b/shared/cplusplus/Name.h index ba7a359fae8..1f30a285166 100644 --- a/shared/cplusplus/Name.h +++ b/shared/cplusplus/Name.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/NameVisitor.cpp b/shared/cplusplus/NameVisitor.cpp index 8573759be4a..d4f1af6575f 100644 --- a/shared/cplusplus/NameVisitor.cpp +++ b/shared/cplusplus/NameVisitor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/NameVisitor.h b/shared/cplusplus/NameVisitor.h index 3f8ece38859..5cea38b9f88 100644 --- a/shared/cplusplus/NameVisitor.h +++ b/shared/cplusplus/NameVisitor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Names.cpp b/shared/cplusplus/Names.cpp index 186dfa9e17b..35bb84b44c2 100644 --- a/shared/cplusplus/Names.cpp +++ b/shared/cplusplus/Names.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Names.h b/shared/cplusplus/Names.h index 18b21f14d3e..86e6813c6c2 100644 --- a/shared/cplusplus/Names.h +++ b/shared/cplusplus/Names.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Parser.cpp b/shared/cplusplus/Parser.cpp index 407cbc36fd8..ae9f39469a0 100644 --- a/shared/cplusplus/Parser.cpp +++ b/shared/cplusplus/Parser.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -57,6 +57,7 @@ #include "AST.h" #include "Literals.h" #include +#include #include CPLUSPLUS_BEGIN_NAMESPACE @@ -1621,8 +1622,7 @@ bool Parser::parseInitializerClause(ExpressionAST *&node) ArrayInitializerAST *ast = new (_pool) ArrayInitializerAST; ast->lbrace_token = consumeToken(); parseInitializerList(ast->expression_list); - if (LA() == T_RBRACE) - ast->rbrace_token = consumeToken(); + match(T_RBRACE, &ast->rbrace_token); node = ast; return true; } @@ -2702,8 +2702,30 @@ bool Parser::parseCorePostfixExpression(ExpressionAST *&node) return true; } } - blockErrors(blocked); rewind(start); + + // look for compound literals + if (LA() == T_LPAREN) { + unsigned lparen_token = consumeToken(); + ExpressionAST *type_id = 0; + if (parseTypeId(type_id) && LA() == T_RPAREN) { + unsigned rparen_token = consumeToken(); + if (LA() == T_LBRACE) { + blockErrors(blocked); + + CompoundLiteralAST *ast = new (_pool) CompoundLiteralAST; + ast->lparen_token = lparen_token; + ast->type_id = type_id; + ast->rparen_token = rparen_token; + parseInitializerClause(ast->initializer); + node = ast; + return true; + } + } + rewind(start); + } + + blockErrors(blocked); return parsePrimaryExpression(node); } } @@ -3552,6 +3574,9 @@ bool Parser::parseObjClassInstanceVariables() bool Parser::parseObjCInterfaceMemberDeclaration() { switch (LA()) { + case T_AT_END: + return false; + case T_AT_REQUIRED: case T_AT_OPTIONAL: consumeToken(); @@ -3570,9 +3595,20 @@ bool Parser::parseObjCInterfaceMemberDeclaration() case T_MINUS: return parseObjCMethodPrototype(); - default: - return false; + case T_ENUM: + case T_CLASS: + case T_STRUCT: + case T_UNION: { + DeclarationAST *declaration = 0; + return parseSimpleDeclaration(declaration, /*accept struct declarators */ true); } + + default: { + DeclarationAST *declaration = 0; + return parseSimpleDeclaration(declaration, /*accept struct declarators */ true); + } // default + + } // switch } // objc-instance-variable-declaration ::= objc-visibility-specifier @@ -3589,7 +3625,7 @@ bool Parser::parseObjCInstanceVariableDeclaration(DeclarationAST *&node) return true; default: - return parseBlockDeclaration(node); + return parseSimpleDeclaration(node, true); } } @@ -3612,7 +3648,7 @@ bool Parser::parseObjCPropertyDeclaration(DeclarationAST *&, SpecifierAST *) } DeclarationAST *simple_declaration = 0; - parseSimpleDeclaration(simple_declaration, /*accept-struct-declarators = */ false); + parseSimpleDeclaration(simple_declaration, /*accept-struct-declarators = */ true); return true; } @@ -3736,6 +3772,19 @@ bool Parser::parseObjCKeywordDeclaration() bool Parser::parseObjCTypeQualifiers() { + if (LA() != T_IDENTIFIER) + return false; + + Identifier *id = tok().identifier; + if (! strcmp("in", id->chars()) || + ! strcmp("out", id->chars()) || + ! strcmp("inout", id->chars()) || + ! strcmp("bycopy", id->chars()) || + ! strcmp("byref", id->chars()) || + ! strcmp("oneway", id->chars())) { + consumeToken(); + return true; + } return false; } diff --git a/shared/cplusplus/Parser.h b/shared/cplusplus/Parser.h index 84bf03e74e6..75fad457fad 100644 --- a/shared/cplusplus/Parser.h +++ b/shared/cplusplus/Parser.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/PrettyPrinter.cpp b/shared/cplusplus/PrettyPrinter.cpp index 72338576b6b..6acb109dcfb 100644 --- a/shared/cplusplus/PrettyPrinter.cpp +++ b/shared/cplusplus/PrettyPrinter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -1281,3 +1281,13 @@ bool PrettyPrinter::visit(QtMethodAST *ast) out << ')'; return false; } + +bool PrettyPrinter::visit(CompoundLiteralAST *ast) +{ + out << '('; + accept(ast->type_id); + out << ')'; + out << ' '; + accept(ast->initializer); + return false; +} diff --git a/shared/cplusplus/PrettyPrinter.h b/shared/cplusplus/PrettyPrinter.h index 966ebacd0e6..c69ea2cf544 100644 --- a/shared/cplusplus/PrettyPrinter.h +++ b/shared/cplusplus/PrettyPrinter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -66,6 +66,7 @@ protected: virtual bool visit(CastExpressionAST *ast); virtual bool visit(CatchClauseAST *ast); virtual bool visit(ClassSpecifierAST *ast); + virtual bool visit(CompoundLiteralAST *ast); virtual bool visit(CompoundStatementAST *ast); virtual bool visit(ConditionAST *ast); virtual bool visit(ConditionalExpressionAST *ast); diff --git a/shared/cplusplus/Scope.cpp b/shared/cplusplus/Scope.cpp index e6a6add9e0f..bdca9f8536d 100644 --- a/shared/cplusplus/Scope.cpp +++ b/shared/cplusplus/Scope.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Scope.h b/shared/cplusplus/Scope.h index 8d5dd29c753..44387718ff3 100644 --- a/shared/cplusplus/Scope.h +++ b/shared/cplusplus/Scope.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Semantic.cpp b/shared/cplusplus/Semantic.cpp index 79da36b891c..41716eb5aad 100644 --- a/shared/cplusplus/Semantic.cpp +++ b/shared/cplusplus/Semantic.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Semantic.h b/shared/cplusplus/Semantic.h index 113b373024c..ac7b1b8c86f 100644 --- a/shared/cplusplus/Semantic.h +++ b/shared/cplusplus/Semantic.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/SemanticCheck.cpp b/shared/cplusplus/SemanticCheck.cpp index 979c7f69a35..27b1a56429c 100644 --- a/shared/cplusplus/SemanticCheck.cpp +++ b/shared/cplusplus/SemanticCheck.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/SemanticCheck.h b/shared/cplusplus/SemanticCheck.h index 453e517b2a6..0ecdeac6035 100644 --- a/shared/cplusplus/SemanticCheck.h +++ b/shared/cplusplus/SemanticCheck.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Symbol.cpp b/shared/cplusplus/Symbol.cpp index 5d392f38263..cdcd3891188 100644 --- a/shared/cplusplus/Symbol.cpp +++ b/shared/cplusplus/Symbol.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Symbol.h b/shared/cplusplus/Symbol.h index fe274339a5d..e9d150e8d5e 100644 --- a/shared/cplusplus/Symbol.h +++ b/shared/cplusplus/Symbol.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/SymbolVisitor.cpp b/shared/cplusplus/SymbolVisitor.cpp index 6a066175962..95cab998ed5 100644 --- a/shared/cplusplus/SymbolVisitor.cpp +++ b/shared/cplusplus/SymbolVisitor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/SymbolVisitor.h b/shared/cplusplus/SymbolVisitor.h index a09924d0172..f0f4738de7f 100644 --- a/shared/cplusplus/SymbolVisitor.h +++ b/shared/cplusplus/SymbolVisitor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Symbols.cpp b/shared/cplusplus/Symbols.cpp index 7dd497426d8..a7ed4682ffe 100644 --- a/shared/cplusplus/Symbols.cpp +++ b/shared/cplusplus/Symbols.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Symbols.h b/shared/cplusplus/Symbols.h index 3bedf3e8882..c69483a2519 100644 --- a/shared/cplusplus/Symbols.h +++ b/shared/cplusplus/Symbols.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Token.cpp b/shared/cplusplus/Token.cpp index 5ebd873dce2..eb672958cd6 100644 --- a/shared/cplusplus/Token.cpp +++ b/shared/cplusplus/Token.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Token.h b/shared/cplusplus/Token.h index fdc3298202f..f48654aa773 100644 --- a/shared/cplusplus/Token.h +++ b/shared/cplusplus/Token.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/TranslationUnit.cpp b/shared/cplusplus/TranslationUnit.cpp index caaa9c7d4e7..40a95c0f05d 100644 --- a/shared/cplusplus/TranslationUnit.cpp +++ b/shared/cplusplus/TranslationUnit.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/TranslationUnit.h b/shared/cplusplus/TranslationUnit.h index ada079ff484..aa490701ef9 100644 --- a/shared/cplusplus/TranslationUnit.h +++ b/shared/cplusplus/TranslationUnit.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Type.cpp b/shared/cplusplus/Type.cpp index e5d70e088ad..98ccd3c893f 100644 --- a/shared/cplusplus/Type.cpp +++ b/shared/cplusplus/Type.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/Type.h b/shared/cplusplus/Type.h index e6d360bc4fd..7cc347d5532 100644 --- a/shared/cplusplus/Type.h +++ b/shared/cplusplus/Type.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/TypeVisitor.cpp b/shared/cplusplus/TypeVisitor.cpp index 1428addedc7..937080e5a5f 100644 --- a/shared/cplusplus/TypeVisitor.cpp +++ b/shared/cplusplus/TypeVisitor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/cplusplus/TypeVisitor.h b/shared/cplusplus/TypeVisitor.h index 2bd6fb15c92..16fb37c4ad0 100644 --- a/shared/cplusplus/TypeVisitor.h +++ b/shared/cplusplus/TypeVisitor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/designerintegrationv2/formresizer.cpp b/shared/designerintegrationv2/formresizer.cpp index 9e1816a9668..29326f69895 100644 --- a/shared/designerintegrationv2/formresizer.cpp +++ b/shared/designerintegrationv2/formresizer.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/designerintegrationv2/formresizer.h b/shared/designerintegrationv2/formresizer.h index c88619b8049..c76c644a73e 100644 --- a/shared/designerintegrationv2/formresizer.h +++ b/shared/designerintegrationv2/formresizer.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/designerintegrationv2/sizehandlerect.cpp b/shared/designerintegrationv2/sizehandlerect.cpp index f5c67a47e6f..7d6c21407ef 100644 --- a/shared/designerintegrationv2/sizehandlerect.cpp +++ b/shared/designerintegrationv2/sizehandlerect.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/designerintegrationv2/sizehandlerect.h b/shared/designerintegrationv2/sizehandlerect.h index 2438781227c..1800f29f50d 100644 --- a/shared/designerintegrationv2/sizehandlerect.h +++ b/shared/designerintegrationv2/sizehandlerect.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/designerintegrationv2/widgethost.cpp b/shared/designerintegrationv2/widgethost.cpp index cdda8e3a1a8..bc5d6336e0d 100644 --- a/shared/designerintegrationv2/widgethost.cpp +++ b/shared/designerintegrationv2/widgethost.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/designerintegrationv2/widgethost.h b/shared/designerintegrationv2/widgethost.h index 8aaf1d781d8..c8500aff908 100644 --- a/shared/designerintegrationv2/widgethost.h +++ b/shared/designerintegrationv2/widgethost.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/designerintegrationv2/widgethostconstants.h b/shared/designerintegrationv2/widgethostconstants.h index e71b3a2dd1f..f42f1851ac2 100644 --- a/shared/designerintegrationv2/widgethostconstants.h +++ b/shared/designerintegrationv2/widgethostconstants.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/help/bookmarkmanager.cpp b/shared/help/bookmarkmanager.cpp index bb223eb2068..dfe4b7f9d5f 100644 --- a/shared/help/bookmarkmanager.cpp +++ b/shared/help/bookmarkmanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/help/bookmarkmanager.h b/shared/help/bookmarkmanager.h index 892c74b77c4..a1b5e7171ae 100644 --- a/shared/help/bookmarkmanager.h +++ b/shared/help/bookmarkmanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/help/contentwindow.cpp b/shared/help/contentwindow.cpp index 768a1223ed9..464f5839472 100644 --- a/shared/help/contentwindow.cpp +++ b/shared/help/contentwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/help/contentwindow.h b/shared/help/contentwindow.h index bbd4a26a3d3..f61f5e1e72a 100644 --- a/shared/help/contentwindow.h +++ b/shared/help/contentwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/help/filternamedialog.cpp b/shared/help/filternamedialog.cpp index 197bf290f79..74d1b001879 100644 --- a/shared/help/filternamedialog.cpp +++ b/shared/help/filternamedialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/help/filternamedialog.h b/shared/help/filternamedialog.h index f5b90279893..00aa1eb485c 100644 --- a/shared/help/filternamedialog.h +++ b/shared/help/filternamedialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/help/helpviewer.cpp b/shared/help/helpviewer.cpp index 59c6df629a4..9b86d8e1cf3 100644 --- a/shared/help/helpviewer.cpp +++ b/shared/help/helpviewer.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/help/helpviewer.h b/shared/help/helpviewer.h index 75659da5633..b268fa260cb 100644 --- a/shared/help/helpviewer.h +++ b/shared/help/helpviewer.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/help/indexwindow.cpp b/shared/help/indexwindow.cpp index 3879dfc8c2f..f55148c91d5 100644 --- a/shared/help/indexwindow.cpp +++ b/shared/help/indexwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/help/indexwindow.h b/shared/help/indexwindow.h index 7f9ddff0998..19cbca8b24a 100644 --- a/shared/help/indexwindow.h +++ b/shared/help/indexwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/help/topicchooser.cpp b/shared/help/topicchooser.cpp index 31b8d52c05e..df9fbf9897c 100644 --- a/shared/help/topicchooser.cpp +++ b/shared/help/topicchooser.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/help/topicchooser.h b/shared/help/topicchooser.h index e29a9aae7e1..37fb3ab14c8 100644 --- a/shared/help/topicchooser.h +++ b/shared/help/topicchooser.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/indenter/constants.cpp b/shared/indenter/constants.cpp index 9c66b8d2606..ec6b743a3ae 100644 --- a/shared/indenter/constants.cpp +++ b/shared/indenter/constants.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/indenter/indenter.h b/shared/indenter/indenter.h index ea078a2c80c..03fb705a7ce 100644 --- a/shared/indenter/indenter.h +++ b/shared/indenter/indenter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/indenter/indenter_impl.h b/shared/indenter/indenter_impl.h index 135cbc41092..b09685e44d2 100644 --- a/shared/indenter/indenter_impl.h +++ b/shared/indenter/indenter_impl.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/indenter/test/main.cpp b/shared/indenter/test/main.cpp index 26ffbdc4e3c..9adca6a3ee2 100644 --- a/shared/indenter/test/main.cpp +++ b/shared/indenter/test/main.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/namespace_global.h b/shared/namespace_global.h index 1eb8fed086b..9a63debfde5 100644 --- a/shared/namespace_global.h +++ b/shared/namespace_global.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/proparser/abstractproitemvisitor.h b/shared/proparser/abstractproitemvisitor.h index 340e7a00b5b..adc224ff707 100644 --- a/shared/proparser/abstractproitemvisitor.h +++ b/shared/proparser/abstractproitemvisitor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/proparser/procommandmanager.cpp b/shared/proparser/procommandmanager.cpp index fa0df436983..2be4ad69f43 100644 --- a/shared/proparser/procommandmanager.cpp +++ b/shared/proparser/procommandmanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/proparser/procommandmanager.h b/shared/proparser/procommandmanager.h index 5d0dbb93787..2c493bac033 100644 --- a/shared/proparser/procommandmanager.h +++ b/shared/proparser/procommandmanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/proparser/proeditor.cpp b/shared/proparser/proeditor.cpp index 63215a9f295..23eef39c77c 100644 --- a/shared/proparser/proeditor.cpp +++ b/shared/proparser/proeditor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/proparser/proeditor.h b/shared/proparser/proeditor.h index bef371c27b1..6469245f5e5 100644 --- a/shared/proparser/proeditor.h +++ b/shared/proparser/proeditor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/proparser/proeditormodel.cpp b/shared/proparser/proeditormodel.cpp index 7708c991eaf..787ea76410f 100644 --- a/shared/proparser/proeditormodel.cpp +++ b/shared/proparser/proeditormodel.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/proparser/proeditormodel.h b/shared/proparser/proeditormodel.h index ab5bafae13e..22f6c87e3de 100644 --- a/shared/proparser/proeditormodel.h +++ b/shared/proparser/proeditormodel.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/proparser/profileevaluator.cpp b/shared/proparser/profileevaluator.cpp index 7f029f00185..790edab4571 100644 --- a/shared/proparser/profileevaluator.cpp +++ b/shared/proparser/profileevaluator.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/proparser/profileevaluator.h b/shared/proparser/profileevaluator.h index 9b7b77fb0c7..a0b860dba0a 100644 --- a/shared/proparser/profileevaluator.h +++ b/shared/proparser/profileevaluator.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/proparser/proiteminfo.cpp b/shared/proparser/proiteminfo.cpp index 5905acfb0ad..7ada47a301a 100644 --- a/shared/proparser/proiteminfo.cpp +++ b/shared/proparser/proiteminfo.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/proparser/proiteminfo.h b/shared/proparser/proiteminfo.h index 9d7e1bac8ad..01be6a4f83b 100644 --- a/shared/proparser/proiteminfo.h +++ b/shared/proparser/proiteminfo.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/proparser/proitems.cpp b/shared/proparser/proitems.cpp index 1e686c5578b..60c5b29b71b 100644 --- a/shared/proparser/proitems.cpp +++ b/shared/proparser/proitems.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/proparser/proitems.h b/shared/proparser/proitems.h index 01ecf0f0f2d..9e531479346 100644 --- a/shared/proparser/proitems.h +++ b/shared/proparser/proitems.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/proparser/proparserutils.h b/shared/proparser/proparserutils.h index 6705ffad39f..7c751c9c273 100644 --- a/shared/proparser/proparserutils.h +++ b/shared/proparser/proparserutils.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/proparser/prowriter.cpp b/shared/proparser/prowriter.cpp index e1e28eb4c51..d5558e9b8c0 100644 --- a/shared/proparser/prowriter.cpp +++ b/shared/proparser/prowriter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/proparser/prowriter.h b/shared/proparser/prowriter.h index 664ab6db151..a2282b357e1 100644 --- a/shared/proparser/prowriter.h +++ b/shared/proparser/prowriter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/proparser/proxml.cpp b/shared/proparser/proxml.cpp index f3d1edb31a4..96091436ee5 100644 --- a/shared/proparser/proxml.cpp +++ b/shared/proparser/proxml.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/proparser/proxml.h b/shared/proparser/proxml.h index 059d90f7e91..f343c703cf5 100644 --- a/shared/proparser/proxml.h +++ b/shared/proparser/proxml.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/proparser/valueeditor.cpp b/shared/proparser/valueeditor.cpp index aafbddbf73c..b85d70cf2a4 100644 --- a/shared/proparser/valueeditor.cpp +++ b/shared/proparser/valueeditor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/proparser/valueeditor.h b/shared/proparser/valueeditor.h index f3fd2f9c87d..5ed6cbea2bc 100644 --- a/shared/proparser/valueeditor.h +++ b/shared/proparser/valueeditor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qrceditor/qrceditor.cpp b/shared/qrceditor/qrceditor.cpp index 741ac12f63e..e4f04c9762e 100644 --- a/shared/qrceditor/qrceditor.cpp +++ b/shared/qrceditor/qrceditor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qrceditor/qrceditor.h b/shared/qrceditor/qrceditor.h index 3c4f3a2497e..44eab566230 100644 --- a/shared/qrceditor/qrceditor.h +++ b/shared/qrceditor/qrceditor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qrceditor/resourcefile.cpp b/shared/qrceditor/resourcefile.cpp index a0b7117c2cf..b88444c6e16 100644 --- a/shared/qrceditor/resourcefile.cpp +++ b/shared/qrceditor/resourcefile.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qrceditor/resourcefile_p.h b/shared/qrceditor/resourcefile_p.h index 28c01745416..61b6c594b64 100644 --- a/shared/qrceditor/resourcefile_p.h +++ b/shared/qrceditor/resourcefile_p.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qrceditor/resourceview.cpp b/shared/qrceditor/resourceview.cpp index 95caef48201..ee9c507337f 100644 --- a/shared/qrceditor/resourceview.cpp +++ b/shared/qrceditor/resourceview.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qrceditor/resourceview.h b/shared/qrceditor/resourceview.h index e3ac2f1c4e0..ae11b2db93d 100644 --- a/shared/qrceditor/resourceview.h +++ b/shared/qrceditor/resourceview.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qrceditor/test/main.cpp b/shared/qrceditor/test/main.cpp index 01fb1f9e7d9..481a3b09e78 100644 --- a/shared/qrceditor/test/main.cpp +++ b/shared/qrceditor/test/main.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qrceditor/test/mainwindow.cpp b/shared/qrceditor/test/mainwindow.cpp index e737efc52ef..22941ca59a4 100644 --- a/shared/qrceditor/test/mainwindow.cpp +++ b/shared/qrceditor/test/mainwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qrceditor/test/mainwindow.h b/shared/qrceditor/test/mainwindow.h index cb33eebab85..fec9d01402b 100644 --- a/shared/qrceditor/test/mainwindow.h +++ b/shared/qrceditor/test/mainwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qrceditor/undocommands.cpp b/shared/qrceditor/undocommands.cpp index a6d23a21287..171fffafa72 100644 --- a/shared/qrceditor/undocommands.cpp +++ b/shared/qrceditor/undocommands.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qrceditor/undocommands_p.h b/shared/qrceditor/undocommands_p.h index 5e277f59e8a..5a6f5af9a2d 100644 --- a/shared/qrceditor/undocommands_p.h +++ b/shared/qrceditor/undocommands_p.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qscripthighlighter/qscripthighlighter.cpp b/shared/qscripthighlighter/qscripthighlighter.cpp index 776d9ca7432..390e3ca4664 100644 --- a/shared/qscripthighlighter/qscripthighlighter.cpp +++ b/shared/qscripthighlighter/qscripthighlighter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qscripthighlighter/qscripthighlighter.h b/shared/qscripthighlighter/qscripthighlighter.h index bdb59ec49f7..332026c77c8 100644 --- a/shared/qscripthighlighter/qscripthighlighter.h +++ b/shared/qscripthighlighter/qscripthighlighter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qscripthighlighter/test/main.cpp b/shared/qscripthighlighter/test/main.cpp index cf914d0d59d..9bfdf22d286 100644 --- a/shared/qscripthighlighter/test/main.cpp +++ b/shared/qscripthighlighter/test/main.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qtextended_integration.h b/shared/qtextended_integration.h index f02012c23d2..fe2bf5ad672 100644 --- a/shared/qtextended_integration.h +++ b/shared/qtextended_integration.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qtlockedfile/qtlockedfile.cpp b/shared/qtlockedfile/qtlockedfile.cpp index a530f72f388..fe2acfd612f 100644 --- a/shared/qtlockedfile/qtlockedfile.cpp +++ b/shared/qtlockedfile/qtlockedfile.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qtlockedfile/qtlockedfile.h b/shared/qtlockedfile/qtlockedfile.h index 8dfbbb14c2a..abf44fa4520 100644 --- a/shared/qtlockedfile/qtlockedfile.h +++ b/shared/qtlockedfile/qtlockedfile.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qtlockedfile/qtlockedfile_unix.cpp b/shared/qtlockedfile/qtlockedfile_unix.cpp index 499198053b8..10ae8f69c31 100644 --- a/shared/qtlockedfile/qtlockedfile_unix.cpp +++ b/shared/qtlockedfile/qtlockedfile_unix.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qtlockedfile/qtlockedfile_win.cpp b/shared/qtlockedfile/qtlockedfile_win.cpp index cc156b03644..f1d74e30fc5 100644 --- a/shared/qtlockedfile/qtlockedfile_win.cpp +++ b/shared/qtlockedfile/qtlockedfile_win.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qtsingleapplication/qtlocalpeer.cpp b/shared/qtsingleapplication/qtlocalpeer.cpp index dbc6d3a6830..4b68c67c3dd 100644 --- a/shared/qtsingleapplication/qtlocalpeer.cpp +++ b/shared/qtsingleapplication/qtlocalpeer.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qtsingleapplication/qtlocalpeer.h b/shared/qtsingleapplication/qtlocalpeer.h index b0d78005c90..e4021c9b121 100644 --- a/shared/qtsingleapplication/qtlocalpeer.h +++ b/shared/qtsingleapplication/qtlocalpeer.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qtsingleapplication/qtsingleapplication.cpp b/shared/qtsingleapplication/qtsingleapplication.cpp index 90bd9cd35e8..8505d5b49c3 100644 --- a/shared/qtsingleapplication/qtsingleapplication.cpp +++ b/shared/qtsingleapplication/qtsingleapplication.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qtsingleapplication/qtsingleapplication.h b/shared/qtsingleapplication/qtsingleapplication.h index f3a41c044be..7e023ab981c 100644 --- a/shared/qtsingleapplication/qtsingleapplication.h +++ b/shared/qtsingleapplication/qtsingleapplication.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qtsingleapplication/qtsinglecoreapplication.cpp b/shared/qtsingleapplication/qtsinglecoreapplication.cpp index 1bb8d14f482..c244459afb8 100644 --- a/shared/qtsingleapplication/qtsinglecoreapplication.cpp +++ b/shared/qtsingleapplication/qtsinglecoreapplication.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/qtsingleapplication/qtsinglecoreapplication.h b/shared/qtsingleapplication/qtsinglecoreapplication.h index 9b712fe6201..a765c7d0703 100644 --- a/shared/qtsingleapplication/qtsinglecoreapplication.h +++ b/shared/qtsingleapplication/qtsinglecoreapplication.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/scriptwrapper/interface_wrap_helpers.h b/shared/scriptwrapper/interface_wrap_helpers.h index e8dadffb99f..0ead88f90fc 100644 --- a/shared/scriptwrapper/interface_wrap_helpers.h +++ b/shared/scriptwrapper/interface_wrap_helpers.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/shared/scriptwrapper/wrap_helpers.h b/shared/scriptwrapper/wrap_helpers.h index 961b1fef6d0..bba83728b90 100644 --- a/shared/scriptwrapper/wrap_helpers.h +++ b/shared/scriptwrapper/wrap_helpers.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/app/main.cpp b/src/app/main.cpp index 2efc04f1451..479ef576c3b 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/aggregation/aggregate.cpp b/src/libs/aggregation/aggregate.cpp index 1dd6ce03392..d0429076ad1 100644 --- a/src/libs/aggregation/aggregate.cpp +++ b/src/libs/aggregation/aggregate.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/aggregation/aggregate.h b/src/libs/aggregation/aggregate.h index 98b1693dd51..c4af87e579e 100644 --- a/src/libs/aggregation/aggregate.h +++ b/src/libs/aggregation/aggregate.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/aggregation/aggregation_global.h b/src/libs/aggregation/aggregation_global.h index 324a2493950..5cd24f26aef 100644 --- a/src/libs/aggregation/aggregation_global.h +++ b/src/libs/aggregation/aggregation_global.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/aggregation/examples/text/main.cpp b/src/libs/aggregation/examples/text/main.cpp index 87bfe784e28..b638067a99c 100644 --- a/src/libs/aggregation/examples/text/main.cpp +++ b/src/libs/aggregation/examples/text/main.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/aggregation/examples/text/main.h b/src/libs/aggregation/examples/text/main.h index 69e6f1caf8e..4f68c01fd05 100644 --- a/src/libs/aggregation/examples/text/main.h +++ b/src/libs/aggregation/examples/text/main.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/aggregation/examples/text/myinterfaces.h b/src/libs/aggregation/examples/text/myinterfaces.h index 78c78f05e1a..2996aed6f2d 100644 --- a/src/libs/aggregation/examples/text/myinterfaces.h +++ b/src/libs/aggregation/examples/text/myinterfaces.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/aggregation/test/tst_aggregate.cpp b/src/libs/aggregation/test/tst_aggregate.cpp index 1a26dc01253..84ef50c4b92 100644 --- a/src/libs/aggregation/test/tst_aggregate.cpp +++ b/src/libs/aggregation/test/tst_aggregate.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index 453f3367af4..1f4621e9703 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/CppDocument.h b/src/libs/cplusplus/CppDocument.h index d872dd3a1af..73bae23679c 100644 --- a/src/libs/cplusplus/CppDocument.h +++ b/src/libs/cplusplus/CppDocument.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/ExpressionUnderCursor.cpp b/src/libs/cplusplus/ExpressionUnderCursor.cpp index d55a19e8859..03702840a95 100644 --- a/src/libs/cplusplus/ExpressionUnderCursor.cpp +++ b/src/libs/cplusplus/ExpressionUnderCursor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/ExpressionUnderCursor.h b/src/libs/cplusplus/ExpressionUnderCursor.h index c979c103e2a..45bf92e56c9 100644 --- a/src/libs/cplusplus/ExpressionUnderCursor.h +++ b/src/libs/cplusplus/ExpressionUnderCursor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/Icons.cpp b/src/libs/cplusplus/Icons.cpp index 447db104bcf..e0b50903c39 100644 --- a/src/libs/cplusplus/Icons.cpp +++ b/src/libs/cplusplus/Icons.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/Icons.h b/src/libs/cplusplus/Icons.h index eb31a07dcf4..b16576cd550 100644 --- a/src/libs/cplusplus/Icons.h +++ b/src/libs/cplusplus/Icons.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp index bf5df8b499b..2941489e01c 100644 --- a/src/libs/cplusplus/LookupContext.cpp +++ b/src/libs/cplusplus/LookupContext.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -143,19 +143,59 @@ Identifier *LookupContext::identifier(Name *name) const return 0; } +bool LookupContext::maybeValidSymbol(Symbol *symbol, + ResolveMode mode, + const QList &candidates) +{ + if (((mode & ResolveNamespace) && symbol->isNamespace()) || + ((mode & ResolveClass) && symbol->isClass()) || + (mode & ResolveSymbol)) { + return ! candidates.contains(symbol); + } + + return false; +} + QList LookupContext::resolve(Name *name, const QList &visibleScopes, ResolveMode mode) const { if (QualifiedNameId *q = name->asQualifiedNameId()) { + QList candidates; QList scopes = visibleScopes; + Identifier *id = identifier(name); + + foreach (Scope *scope, visibleScopes) { + Symbol *symbol = scope->lookat(id); + for (; symbol; symbol = symbol->next()) { + if (! symbol->name()) + continue; + else if (! maybeValidSymbol(symbol, mode, candidates)) + continue; + QualifiedNameId *qq = symbol->name()->asQualifiedNameId(); + if (! qq) + continue; + if (q->nameCount() > qq->nameCount()) + continue; + + for (int i = q->nameCount() - 1; i != -1; --i) { + Name *a = q->nameAt(i); + Name *b = qq->nameAt(i); + + if (! a->isEqualTo(b)) + break; + else if (i == 0) + candidates.append(symbol); + } + } + } + for (unsigned i = 0; i < q->nameCount(); ++i) { Name *name = q->nameAt(i); - QList candidates; if (i + 1 == q->nameCount()) - candidates = resolve(name, scopes, mode); + candidates += resolve(name, scopes, mode); else - candidates = resolveClassOrNamespace(name, scopes); + candidates += resolveClassOrNamespace(name, scopes); if (candidates.isEmpty() || i + 1 == q->nameCount()) return candidates; @@ -176,19 +216,41 @@ QList LookupContext::resolve(Name *name, const QList &visible for (int scopeIndex = 0; scopeIndex < visibleScopes.size(); ++scopeIndex) { Scope *scope = visibleScopes.at(scopeIndex); for (Symbol *symbol = scope->lookat(id); symbol; symbol = symbol->next()) { - if (! symbol->name()) + if (! symbol->name()) { continue; - else if (symbol->name()->isQualifiedNameId()) + } else if (! maybeValidSymbol(symbol, mode, candidates)) { continue; - else if (! isNameCompatibleWithIdentifier(symbol->name(), id)) + } else if (QualifiedNameId *q = symbol->name()->asQualifiedNameId()) { + if (! q->unqualifiedNameId()->isEqualTo(name)) + continue; + + if (q->nameCount() > 1) { + Name *classOrNamespaceName = + control()->qualifiedNameId(q->names(), + q->nameCount() - 1); + + const QList resolvedClassOrNamespace = + resolveClassOrNamespace(classOrNamespaceName, visibleScopes); + + bool good = false; + foreach (Symbol *classOrNamespace, resolvedClassOrNamespace) { + ScopedSymbol *scoped = classOrNamespace->asScopedSymbol(); + if (visibleScopes.contains(scoped->members())) { + good = true; + break; + } + } + + if (! good) + continue; + } + } else if (! isNameCompatibleWithIdentifier(symbol->name(), id)) { continue; - else if (symbol->name()->isDestructorNameId() != name->isDestructorNameId()) + } else if (symbol->name()->isDestructorNameId() != name->isDestructorNameId()) { continue; - else if ((((mode & ResolveNamespace) && symbol->isNamespace()) || - ((mode & ResolveClass) && symbol->isClass()) || - (mode & ResolveSymbol)) && ! candidates.contains(symbol)) { - candidates.append(symbol); } + + candidates.append(symbol); } } } else if (OperatorNameId *opId = name->asOperatorNameId()) { @@ -353,8 +415,8 @@ void LookupContext::expandClass(Scope *scope, } for (int j = 0; j < baseClassCandidates.size(); ++j) { - Class *baseClassSymbol = baseClassCandidates.at(j)->asClass(); - expand(baseClassSymbol->members(), visibleScopes, expandedScopes); + if (Class *baseClassSymbol = baseClassCandidates.at(j)->asClass()) + expand(baseClassSymbol->members(), visibleScopes, expandedScopes); } } } diff --git a/src/libs/cplusplus/LookupContext.h b/src/libs/cplusplus/LookupContext.h index 8759a79210e..014d1be2c91 100644 --- a/src/libs/cplusplus/LookupContext.h +++ b/src/libs/cplusplus/LookupContext.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -134,6 +134,10 @@ private: QList buildVisibleScopes(); static bool isNameCompatibleWithIdentifier(Name *name, Identifier *id); + static bool maybeValidSymbol(Symbol *symbol, + ResolveMode mode, + const QList &candidates); + private: Control *_control; diff --git a/src/libs/cplusplus/Macro.cpp b/src/libs/cplusplus/Macro.cpp index d5492b983b7..1c1fecf9f2d 100644 --- a/src/libs/cplusplus/Macro.cpp +++ b/src/libs/cplusplus/Macro.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/Macro.h b/src/libs/cplusplus/Macro.h index 3957f13fab6..050c310a883 100644 --- a/src/libs/cplusplus/Macro.h +++ b/src/libs/cplusplus/Macro.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/NameOfExpression.cpp b/src/libs/cplusplus/NameOfExpression.cpp index 12690881bf8..bdb1d8ac16c 100644 --- a/src/libs/cplusplus/NameOfExpression.cpp +++ b/src/libs/cplusplus/NameOfExpression.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/NameOfExpression.h b/src/libs/cplusplus/NameOfExpression.h index 3aec6a54300..255d98ffbfd 100644 --- a/src/libs/cplusplus/NameOfExpression.h +++ b/src/libs/cplusplus/NameOfExpression.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/NamePrettyPrinter.cpp b/src/libs/cplusplus/NamePrettyPrinter.cpp index 50f12b5d979..bc2be0193ef 100644 --- a/src/libs/cplusplus/NamePrettyPrinter.cpp +++ b/src/libs/cplusplus/NamePrettyPrinter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/NamePrettyPrinter.h b/src/libs/cplusplus/NamePrettyPrinter.h index fea6e079672..9be21726ad5 100644 --- a/src/libs/cplusplus/NamePrettyPrinter.h +++ b/src/libs/cplusplus/NamePrettyPrinter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/Overview.cpp b/src/libs/cplusplus/Overview.cpp index e394415dad9..2494d11ec5e 100644 --- a/src/libs/cplusplus/Overview.cpp +++ b/src/libs/cplusplus/Overview.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/Overview.h b/src/libs/cplusplus/Overview.h index 6a4bcdc2378..fa1f3cf919f 100644 --- a/src/libs/cplusplus/Overview.h +++ b/src/libs/cplusplus/Overview.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/OverviewModel.cpp b/src/libs/cplusplus/OverviewModel.cpp index 92b20d9f733..fe78cb34332 100644 --- a/src/libs/cplusplus/OverviewModel.cpp +++ b/src/libs/cplusplus/OverviewModel.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/OverviewModel.h b/src/libs/cplusplus/OverviewModel.h index 124382e80ac..f6456d2ee5f 100644 --- a/src/libs/cplusplus/OverviewModel.h +++ b/src/libs/cplusplus/OverviewModel.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/PreprocessorClient.cpp b/src/libs/cplusplus/PreprocessorClient.cpp index 2eb5656446e..fe05ff7a971 100644 --- a/src/libs/cplusplus/PreprocessorClient.cpp +++ b/src/libs/cplusplus/PreprocessorClient.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/PreprocessorClient.h b/src/libs/cplusplus/PreprocessorClient.h index 2d37dac3e6d..f0290c04a00 100644 --- a/src/libs/cplusplus/PreprocessorClient.h +++ b/src/libs/cplusplus/PreprocessorClient.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/PreprocessorEnvironment.cpp b/src/libs/cplusplus/PreprocessorEnvironment.cpp index 693fe6160ea..930e4b3a6c7 100644 --- a/src/libs/cplusplus/PreprocessorEnvironment.cpp +++ b/src/libs/cplusplus/PreprocessorEnvironment.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/PreprocessorEnvironment.h b/src/libs/cplusplus/PreprocessorEnvironment.h index 48ee5b2715a..7f712cd49cc 100644 --- a/src/libs/cplusplus/PreprocessorEnvironment.h +++ b/src/libs/cplusplus/PreprocessorEnvironment.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/ResolveExpression.cpp b/src/libs/cplusplus/ResolveExpression.cpp index 6f8ae2ba9b9..e6d4d81adce 100644 --- a/src/libs/cplusplus/ResolveExpression.cpp +++ b/src/libs/cplusplus/ResolveExpression.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -425,6 +425,12 @@ bool ResolveExpression::visit(UnaryExpressionAST *ast) return false; } +bool ResolveExpression::visit(CompoundLiteralAST *ast) +{ + accept(ast->type_id); + return false; +} + bool ResolveExpression::visit(QualifiedNameAST *ast) { ResolveClass resolveClass; diff --git a/src/libs/cplusplus/ResolveExpression.h b/src/libs/cplusplus/ResolveExpression.h index e7cf1c0a3af..b288bc751fc 100644 --- a/src/libs/cplusplus/ResolveExpression.h +++ b/src/libs/cplusplus/ResolveExpression.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -105,6 +105,7 @@ protected: virtual bool visit(ThrowExpressionAST *ast); virtual bool visit(TypeIdAST *ast); virtual bool visit(UnaryExpressionAST *ast); + virtual bool visit(CompoundLiteralAST *ast); //names virtual bool visit(QualifiedNameAST *ast); diff --git a/src/libs/cplusplus/SimpleLexer.cpp b/src/libs/cplusplus/SimpleLexer.cpp index 440946cdb38..62ecaa174e8 100644 --- a/src/libs/cplusplus/SimpleLexer.cpp +++ b/src/libs/cplusplus/SimpleLexer.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/SimpleLexer.h b/src/libs/cplusplus/SimpleLexer.h index 3f5b736e2dd..ed48e9360bf 100644 --- a/src/libs/cplusplus/SimpleLexer.h +++ b/src/libs/cplusplus/SimpleLexer.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/TokenUnderCursor.cpp b/src/libs/cplusplus/TokenUnderCursor.cpp index af0a72284e7..d103a0307f7 100644 --- a/src/libs/cplusplus/TokenUnderCursor.cpp +++ b/src/libs/cplusplus/TokenUnderCursor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/TokenUnderCursor.h b/src/libs/cplusplus/TokenUnderCursor.h index 68638329190..c8fe792e939 100644 --- a/src/libs/cplusplus/TokenUnderCursor.h +++ b/src/libs/cplusplus/TokenUnderCursor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/TypeOfExpression.cpp b/src/libs/cplusplus/TypeOfExpression.cpp index 7f08d5874d8..90ec7837a73 100644 --- a/src/libs/cplusplus/TypeOfExpression.cpp +++ b/src/libs/cplusplus/TypeOfExpression.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -47,6 +47,11 @@ TypeOfExpression::TypeOfExpression(): { } +Snapshot TypeOfExpression::snapshot() const +{ + return m_snapshot; +} + void TypeOfExpression::setSnapshot(const Snapshot &documents) { m_snapshot = documents; diff --git a/src/libs/cplusplus/TypeOfExpression.h b/src/libs/cplusplus/TypeOfExpression.h index c0eafb2e37f..78af0346347 100644 --- a/src/libs/cplusplus/TypeOfExpression.h +++ b/src/libs/cplusplus/TypeOfExpression.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -54,6 +54,8 @@ public: public: TypeOfExpression(); + Snapshot snapshot() const; + /** * Sets the documents used to evaluate expressions. Should be set before * calling this functor. diff --git a/src/libs/cplusplus/TypePrettyPrinter.cpp b/src/libs/cplusplus/TypePrettyPrinter.cpp index f7727572308..2784d9d695a 100644 --- a/src/libs/cplusplus/TypePrettyPrinter.cpp +++ b/src/libs/cplusplus/TypePrettyPrinter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/TypePrettyPrinter.h b/src/libs/cplusplus/TypePrettyPrinter.h index e80b1d435a2..790999dc824 100644 --- a/src/libs/cplusplus/TypePrettyPrinter.h +++ b/src/libs/cplusplus/TypePrettyPrinter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/pp-cctype.h b/src/libs/cplusplus/pp-cctype.h index d55d6c2e4e9..2031b71bf78 100644 --- a/src/libs/cplusplus/pp-cctype.h +++ b/src/libs/cplusplus/pp-cctype.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp index 6c5930de182..6ed55492e50 100644 --- a/src/libs/cplusplus/pp-engine.cpp +++ b/src/libs/cplusplus/pp-engine.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/pp-engine.h b/src/libs/cplusplus/pp-engine.h index d0a573aed9c..24e1ac13de0 100644 --- a/src/libs/cplusplus/pp-engine.h +++ b/src/libs/cplusplus/pp-engine.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/pp-macro-expander.cpp b/src/libs/cplusplus/pp-macro-expander.cpp index 40bbc8090b6..e4ab03d867a 100644 --- a/src/libs/cplusplus/pp-macro-expander.cpp +++ b/src/libs/cplusplus/pp-macro-expander.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/pp-macro-expander.h b/src/libs/cplusplus/pp-macro-expander.h index 3e6217476fa..0307401d4a0 100644 --- a/src/libs/cplusplus/pp-macro-expander.h +++ b/src/libs/cplusplus/pp-macro-expander.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/pp-scanner.cpp b/src/libs/cplusplus/pp-scanner.cpp index 8f0f9bf9ae8..2c69706f0b0 100644 --- a/src/libs/cplusplus/pp-scanner.cpp +++ b/src/libs/cplusplus/pp-scanner.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/pp-scanner.h b/src/libs/cplusplus/pp-scanner.h index 71bd04476ba..481af95adfc 100644 --- a/src/libs/cplusplus/pp-scanner.h +++ b/src/libs/cplusplus/pp-scanner.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/cplusplus/pp.h b/src/libs/cplusplus/pp.h index 96c81867163..79e6e54d6eb 100644 --- a/src/libs/cplusplus/pp.h +++ b/src/libs/cplusplus/pp.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/ExtensionSystemInterfaces b/src/libs/extensionsystem/ExtensionSystemInterfaces index db175b40504..7f42b55e89a 100644 --- a/src/libs/extensionsystem/ExtensionSystemInterfaces +++ b/src/libs/extensionsystem/ExtensionSystemInterfaces @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/extensionsystem_global.h b/src/libs/extensionsystem/extensionsystem_global.h index 7ff0d1d471e..578350f8190 100644 --- a/src/libs/extensionsystem/extensionsystem_global.h +++ b/src/libs/extensionsystem/extensionsystem_global.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/iplugin.cpp b/src/libs/extensionsystem/iplugin.cpp index 0ce65bf5c0a..26adaefec38 100644 --- a/src/libs/extensionsystem/iplugin.cpp +++ b/src/libs/extensionsystem/iplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/iplugin.h b/src/libs/extensionsystem/iplugin.h index fe242b0fb78..9c811870659 100644 --- a/src/libs/extensionsystem/iplugin.h +++ b/src/libs/extensionsystem/iplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/iplugin_p.h b/src/libs/extensionsystem/iplugin_p.h index cc7e1bdae32..ac87390bf3c 100644 --- a/src/libs/extensionsystem/iplugin_p.h +++ b/src/libs/extensionsystem/iplugin_p.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/optionsparser.cpp b/src/libs/extensionsystem/optionsparser.cpp index 414895c9dec..93c159aebcc 100644 --- a/src/libs/extensionsystem/optionsparser.cpp +++ b/src/libs/extensionsystem/optionsparser.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/optionsparser.h b/src/libs/extensionsystem/optionsparser.h index 1be8531d537..8ebedec99f4 100644 --- a/src/libs/extensionsystem/optionsparser.h +++ b/src/libs/extensionsystem/optionsparser.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/plugindetailsview.cpp b/src/libs/extensionsystem/plugindetailsview.cpp index 1f3070411fe..392f8adb818 100644 --- a/src/libs/extensionsystem/plugindetailsview.cpp +++ b/src/libs/extensionsystem/plugindetailsview.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/plugindetailsview.h b/src/libs/extensionsystem/plugindetailsview.h index 9ae44dad340..19b543f93d3 100644 --- a/src/libs/extensionsystem/plugindetailsview.h +++ b/src/libs/extensionsystem/plugindetailsview.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/pluginerrorview.cpp b/src/libs/extensionsystem/pluginerrorview.cpp index dae77d0b872..f619a6c70f7 100644 --- a/src/libs/extensionsystem/pluginerrorview.cpp +++ b/src/libs/extensionsystem/pluginerrorview.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/pluginerrorview.h b/src/libs/extensionsystem/pluginerrorview.h index d6c8897931d..f53cf393b4b 100644 --- a/src/libs/extensionsystem/pluginerrorview.h +++ b/src/libs/extensionsystem/pluginerrorview.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 7dc9c4e10af..5a1c8a00e6a 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -54,8 +54,7 @@ enum { debugLeaks = 0 }; /*! \namespace ExtensionSystem - \brief The ExtensionSystem namespace provides - classes that belong to the core plugin system. + \brief The ExtensionSystem namespace provides classes that belong to the core plugin system. The basic extension system contains of the plugin manager and its supporting classes, and the IPlugin interface that must be implemented by plugin providers. diff --git a/src/libs/extensionsystem/pluginmanager.h b/src/libs/extensionsystem/pluginmanager.h index 42e3029bc5d..85dc06f4e9e 100644 --- a/src/libs/extensionsystem/pluginmanager.h +++ b/src/libs/extensionsystem/pluginmanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/pluginmanager_p.h b/src/libs/extensionsystem/pluginmanager_p.h index cfe2d6d17ad..9d03777c748 100644 --- a/src/libs/extensionsystem/pluginmanager_p.h +++ b/src/libs/extensionsystem/pluginmanager_p.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/pluginspec.cpp b/src/libs/extensionsystem/pluginspec.cpp index 0e5fa53996f..48aa88950e9 100644 --- a/src/libs/extensionsystem/pluginspec.cpp +++ b/src/libs/extensionsystem/pluginspec.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/pluginspec.h b/src/libs/extensionsystem/pluginspec.h index 6ab9d465914..5c98e551112 100644 --- a/src/libs/extensionsystem/pluginspec.h +++ b/src/libs/extensionsystem/pluginspec.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/pluginspec_p.h b/src/libs/extensionsystem/pluginspec_p.h index 436a1f44b01..66611c18b66 100644 --- a/src/libs/extensionsystem/pluginspec_p.h +++ b/src/libs/extensionsystem/pluginspec_p.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/pluginview.cpp b/src/libs/extensionsystem/pluginview.cpp index c60ae334736..716cef20d14 100644 --- a/src/libs/extensionsystem/pluginview.cpp +++ b/src/libs/extensionsystem/pluginview.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/pluginview.h b/src/libs/extensionsystem/pluginview.h index dc4c5f1c844..4e094502ff2 100644 --- a/src/libs/extensionsystem/pluginview.h +++ b/src/libs/extensionsystem/pluginview.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/pluginview_p.h b/src/libs/extensionsystem/pluginview_p.h index 77e511ba2cc..7c122a59d65 100644 --- a/src/libs/extensionsystem/pluginview_p.h +++ b/src/libs/extensionsystem/pluginview_p.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin1/plugin1.cpp b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin1/plugin1.cpp index 68332a77b3e..c720a28f570 100644 --- a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin1/plugin1.cpp +++ b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin1/plugin1.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin1/plugin1.h b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin1/plugin1.h index c15a30bf165..3ef8b8959a1 100644 --- a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin1/plugin1.h +++ b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin1/plugin1.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin2/plugin2.cpp b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin2/plugin2.cpp index fd788e4da6b..f8d7c4928de 100644 --- a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin2/plugin2.cpp +++ b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin2/plugin2.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin2/plugin2.h b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin2/plugin2.h index 431fa8201fd..f4ee2b6979a 100644 --- a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin2/plugin2.h +++ b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin2/plugin2.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin3/plugin3.cpp b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin3/plugin3.cpp index 9da1403df8b..5b95f050609 100644 --- a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin3/plugin3.cpp +++ b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin3/plugin3.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin3/plugin3.h b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin3/plugin3.h index 0878a907be8..ce14b9f92d3 100644 --- a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin3/plugin3.h +++ b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin3/plugin3.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin1/plugin1.cpp b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin1/plugin1.cpp index f67dd11e9e7..d6d3ba481c6 100644 --- a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin1/plugin1.cpp +++ b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin1/plugin1.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin1/plugin1.h b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin1/plugin1.h index 498d827dd12..b65aa19d683 100644 --- a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin1/plugin1.h +++ b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin1/plugin1.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin2/plugin2.cpp b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin2/plugin2.cpp index 4cd3a89f6d4..a8b5662dd15 100644 --- a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin2/plugin2.cpp +++ b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin2/plugin2.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin2/plugin2.h b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin2/plugin2.h index c509439800d..ff2fc32a2c3 100644 --- a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin2/plugin2.h +++ b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin2/plugin2.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin3/plugin3.cpp b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin3/plugin3.cpp index 7e170878e60..a9569bbdeeb 100644 --- a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin3/plugin3.cpp +++ b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin3/plugin3.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin3/plugin3.h b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin3/plugin3.h index 484ceace7a6..bc323afc655 100644 --- a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin3/plugin3.h +++ b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin3/plugin3.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/tst_pluginmanager.cpp b/src/libs/extensionsystem/test/auto/pluginmanager/tst_pluginmanager.cpp index ca2b00fc71a..08f64763037 100644 --- a/src/libs/extensionsystem/test/auto/pluginmanager/tst_pluginmanager.cpp +++ b/src/libs/extensionsystem/test/auto/pluginmanager/tst_pluginmanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin.cpp b/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin.cpp index eff30909c7b..e3f60a3df0b 100644 --- a/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin.cpp +++ b/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin.h b/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin.h index 1cc205c334d..353487fce5c 100644 --- a/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin.h +++ b/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin_global.h b/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin_global.h index 93b2bdb2d72..e1c00013695 100644 --- a/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin_global.h +++ b/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin_global.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/auto/pluginspec/tst_pluginspec.cpp b/src/libs/extensionsystem/test/auto/pluginspec/tst_pluginspec.cpp index 59683feb04b..5ab40b33a66 100644 --- a/src/libs/extensionsystem/test/auto/pluginspec/tst_pluginspec.cpp +++ b/src/libs/extensionsystem/test/auto/pluginspec/tst_pluginspec.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/manual/pluginview/plugindialog.cpp b/src/libs/extensionsystem/test/manual/pluginview/plugindialog.cpp index 468a06dda0e..484b755be7d 100644 --- a/src/libs/extensionsystem/test/manual/pluginview/plugindialog.cpp +++ b/src/libs/extensionsystem/test/manual/pluginview/plugindialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/manual/pluginview/plugindialog.h b/src/libs/extensionsystem/test/manual/pluginview/plugindialog.h index 7eaffeef47d..cc0400b4afb 100644 --- a/src/libs/extensionsystem/test/manual/pluginview/plugindialog.h +++ b/src/libs/extensionsystem/test/manual/pluginview/plugindialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.cpp b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.cpp index 465215ec42c..e6e5f908a25 100644 --- a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.cpp +++ b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.h b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.h index 77648b733b9..702648b57f9 100644 --- a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.h +++ b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin2/plugin2.cpp b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin2/plugin2.cpp index b74b339b237..40471cba1b7 100644 --- a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin2/plugin2.cpp +++ b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin2/plugin2.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin2/plugin2.h b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin2/plugin2.h index c13f47f925e..3c067b71d62 100644 --- a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin2/plugin2.h +++ b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin2/plugin2.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin3/plugin3.cpp b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin3/plugin3.cpp index 888e3fb662b..9538caf9a63 100644 --- a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin3/plugin3.cpp +++ b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin3/plugin3.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin3/plugin3.h b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin3/plugin3.h index c6d865b8856..c038b5e7bfc 100644 --- a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin3/plugin3.h +++ b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin3/plugin3.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/qtconcurrent/QtConcurrentTools b/src/libs/qtconcurrent/QtConcurrentTools index b618f1cb49d..a60a4cdf266 100644 --- a/src/libs/qtconcurrent/QtConcurrentTools +++ b/src/libs/qtconcurrent/QtConcurrentTools @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/qtconcurrent/multitask.h b/src/libs/qtconcurrent/multitask.h index b23c6e35804..d477d0e4ed4 100644 --- a/src/libs/qtconcurrent/multitask.h +++ b/src/libs/qtconcurrent/multitask.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/qtconcurrent/qtconcurrent_global.h b/src/libs/qtconcurrent/qtconcurrent_global.h index 6c49354ffff..c9c81d18259 100644 --- a/src/libs/qtconcurrent/qtconcurrent_global.h +++ b/src/libs/qtconcurrent/qtconcurrent_global.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/qtconcurrent/runextensions.h b/src/libs/qtconcurrent/runextensions.h index c5c2954db92..89c8d18ad67 100644 --- a/src/libs/qtconcurrent/runextensions.h +++ b/src/libs/qtconcurrent/runextensions.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/basevalidatinglineedit.cpp b/src/libs/utils/basevalidatinglineedit.cpp index 6c26d0bf4b4..c9368a757be 100644 --- a/src/libs/utils/basevalidatinglineedit.cpp +++ b/src/libs/utils/basevalidatinglineedit.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/basevalidatinglineedit.h b/src/libs/utils/basevalidatinglineedit.h index 4a9468e7148..1e57bcfd5fc 100644 --- a/src/libs/utils/basevalidatinglineedit.h +++ b/src/libs/utils/basevalidatinglineedit.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/classnamevalidatinglineedit.cpp b/src/libs/utils/classnamevalidatinglineedit.cpp index a4e55ccd813..1a2a3c6e385 100644 --- a/src/libs/utils/classnamevalidatinglineedit.cpp +++ b/src/libs/utils/classnamevalidatinglineedit.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/classnamevalidatinglineedit.h b/src/libs/utils/classnamevalidatinglineedit.h index 321bc9e34f2..86771587a4c 100644 --- a/src/libs/utils/classnamevalidatinglineedit.h +++ b/src/libs/utils/classnamevalidatinglineedit.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/codegeneration.cpp b/src/libs/utils/codegeneration.cpp index 4bfa9098cdc..892a1fc1b2f 100644 --- a/src/libs/utils/codegeneration.cpp +++ b/src/libs/utils/codegeneration.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/codegeneration.h b/src/libs/utils/codegeneration.h index e8b844784a6..839d94e2cec 100644 --- a/src/libs/utils/codegeneration.h +++ b/src/libs/utils/codegeneration.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/fancylineedit.cpp b/src/libs/utils/fancylineedit.cpp index 8e9911f8f47..e016046e8dc 100644 --- a/src/libs/utils/fancylineedit.cpp +++ b/src/libs/utils/fancylineedit.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/fancylineedit.h b/src/libs/utils/fancylineedit.h index 10b5f32129b..ae60f20618d 100644 --- a/src/libs/utils/fancylineedit.h +++ b/src/libs/utils/fancylineedit.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/filenamevalidatinglineedit.cpp b/src/libs/utils/filenamevalidatinglineedit.cpp index e11c578070d..80b4e827942 100644 --- a/src/libs/utils/filenamevalidatinglineedit.cpp +++ b/src/libs/utils/filenamevalidatinglineedit.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/filenamevalidatinglineedit.h b/src/libs/utils/filenamevalidatinglineedit.h index 95440c83f37..2f5bfe6b4b7 100644 --- a/src/libs/utils/filenamevalidatinglineedit.h +++ b/src/libs/utils/filenamevalidatinglineedit.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/filesearch.cpp b/src/libs/utils/filesearch.cpp index a04e6a42958..feb3acc2399 100644 --- a/src/libs/utils/filesearch.cpp +++ b/src/libs/utils/filesearch.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/filesearch.h b/src/libs/utils/filesearch.h index 09bef9d1bec..559d58a0ac0 100644 --- a/src/libs/utils/filesearch.h +++ b/src/libs/utils/filesearch.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/filewizarddialog.cpp b/src/libs/utils/filewizarddialog.cpp index 0e8655bf7ca..2bf7ecbcdca 100644 --- a/src/libs/utils/filewizarddialog.cpp +++ b/src/libs/utils/filewizarddialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/filewizarddialog.h b/src/libs/utils/filewizarddialog.h index 5a01a9558d6..6d483c505d0 100644 --- a/src/libs/utils/filewizarddialog.h +++ b/src/libs/utils/filewizarddialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/filewizardpage.cpp b/src/libs/utils/filewizardpage.cpp index 0e5c7b24550..7d0dd6ab0b6 100644 --- a/src/libs/utils/filewizardpage.cpp +++ b/src/libs/utils/filewizardpage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/filewizardpage.h b/src/libs/utils/filewizardpage.h index 18e89af9d04..48c32d1f30f 100644 --- a/src/libs/utils/filewizardpage.h +++ b/src/libs/utils/filewizardpage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/linecolumnlabel.cpp b/src/libs/utils/linecolumnlabel.cpp index 75e1dd27085..f651347835e 100644 --- a/src/libs/utils/linecolumnlabel.cpp +++ b/src/libs/utils/linecolumnlabel.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/linecolumnlabel.h b/src/libs/utils/linecolumnlabel.h index 1ae84ccac95..239092150ec 100644 --- a/src/libs/utils/linecolumnlabel.h +++ b/src/libs/utils/linecolumnlabel.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/listutils.h b/src/libs/utils/listutils.h index fa260e0ed75..fcb2875bcd3 100644 --- a/src/libs/utils/listutils.h +++ b/src/libs/utils/listutils.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/newclasswidget.cpp b/src/libs/utils/newclasswidget.cpp index 46db9fda71b..006cf61cbba 100644 --- a/src/libs/utils/newclasswidget.cpp +++ b/src/libs/utils/newclasswidget.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/newclasswidget.h b/src/libs/utils/newclasswidget.h index 7b141f8c370..9f8d9a80bbe 100644 --- a/src/libs/utils/newclasswidget.h +++ b/src/libs/utils/newclasswidget.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index 91504b496c9..0f83cf1c4cb 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/pathchooser.h b/src/libs/utils/pathchooser.h index 5fcc8ee228c..5a6721ac67a 100644 --- a/src/libs/utils/pathchooser.h +++ b/src/libs/utils/pathchooser.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/projectintropage.cpp b/src/libs/utils/projectintropage.cpp index 85bf22b14c5..16a06eec4ac 100644 --- a/src/libs/utils/projectintropage.cpp +++ b/src/libs/utils/projectintropage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/projectintropage.h b/src/libs/utils/projectintropage.h index 7f6b34bc886..597ace33ecf 100644 --- a/src/libs/utils/projectintropage.h +++ b/src/libs/utils/projectintropage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/projectnamevalidatinglineedit.cpp b/src/libs/utils/projectnamevalidatinglineedit.cpp index bbd8d73466d..3c5e84db60d 100644 --- a/src/libs/utils/projectnamevalidatinglineedit.cpp +++ b/src/libs/utils/projectnamevalidatinglineedit.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/projectnamevalidatinglineedit.h b/src/libs/utils/projectnamevalidatinglineedit.h index d660c1aa4a5..0ab8d92bcc3 100644 --- a/src/libs/utils/projectnamevalidatinglineedit.h +++ b/src/libs/utils/projectnamevalidatinglineedit.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/qtcassert.h b/src/libs/utils/qtcassert.h index 3206e8c38b3..db0736a64e4 100644 --- a/src/libs/utils/qtcassert.h +++ b/src/libs/utils/qtcassert.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/qtcolorbutton.cpp b/src/libs/utils/qtcolorbutton.cpp index a30b3e5f55f..8cb08e6cc73 100644 --- a/src/libs/utils/qtcolorbutton.cpp +++ b/src/libs/utils/qtcolorbutton.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/qtcolorbutton.h b/src/libs/utils/qtcolorbutton.h index 2fee344d78b..63f574087c3 100644 --- a/src/libs/utils/qtcolorbutton.h +++ b/src/libs/utils/qtcolorbutton.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/reloadpromptutils.cpp b/src/libs/utils/reloadpromptutils.cpp index 509d2417415..45160c06709 100644 --- a/src/libs/utils/reloadpromptutils.cpp +++ b/src/libs/utils/reloadpromptutils.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/reloadpromptutils.h b/src/libs/utils/reloadpromptutils.h index ec7d7b41175..d1afafb61ad 100644 --- a/src/libs/utils/reloadpromptutils.h +++ b/src/libs/utils/reloadpromptutils.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/settingsutils.cpp b/src/libs/utils/settingsutils.cpp index 5394c746d68..568fd7b4ab3 100644 --- a/src/libs/utils/settingsutils.cpp +++ b/src/libs/utils/settingsutils.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/settingsutils.h b/src/libs/utils/settingsutils.h index 3777587a406..664aa3e77b7 100644 --- a/src/libs/utils/settingsutils.h +++ b/src/libs/utils/settingsutils.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/submiteditorwidget.cpp b/src/libs/utils/submiteditorwidget.cpp index ae8eb41593d..7a084add032 100644 --- a/src/libs/utils/submiteditorwidget.cpp +++ b/src/libs/utils/submiteditorwidget.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -36,6 +36,7 @@ #include #include +#include #include @@ -70,6 +71,42 @@ void QActionPushButton::actionChanged() setEnabled(a->isEnabled()); } +// Helpers to retrieve model data +static inline bool listModelChecked(const QAbstractItemModel *model, int row, int column = 0) +{ + const QModelIndex checkableIndex = model->index(row, column, QModelIndex()); + return model->data(checkableIndex, Qt::CheckStateRole).toInt() == Qt::Checked; +} + +static inline QString listModelText(const QAbstractItemModel *model, int row, int column) +{ + const QModelIndex index = model->index(row, column, QModelIndex()); + return model->data(index, Qt::DisplayRole).toString(); +} + +// Find a check item in a model +static bool listModelContainsCheckedItem(const QAbstractItemModel *model) +{ + const int count = model->rowCount(); + for (int i = 0; i < count; i++) + if (listModelChecked(model, i, 0)) + return true; + return false; +} + +// Convenience to extract a list of selected indexes +QList selectedRows(const QAbstractItemView *view) +{ + const QModelIndexList indexList = view->selectionModel()->selectedRows(0); + if (indexList.empty()) + return QList(); + QList rc; + const QModelIndexList::const_iterator cend = indexList.constEnd(); + for (QModelIndexList::const_iterator it = indexList.constBegin(); it != cend; ++it) + rc.push_back(it->row()); + return rc; +} + // ----------- SubmitEditorWidgetPrivate struct SubmitEditorWidgetPrivate { @@ -78,11 +115,15 @@ struct SubmitEditorWidgetPrivate Ui::SubmitEditorWidget m_ui; bool m_filesSelected; bool m_filesChecked; + int m_fileNameColumn; + int m_activatedRow; }; SubmitEditorWidgetPrivate::SubmitEditorWidgetPrivate() : m_filesSelected(false), - m_filesChecked(false) + m_filesChecked(false), + m_fileNameColumn(1), + m_activatedRow(-1) { } @@ -92,10 +133,10 @@ SubmitEditorWidget::SubmitEditorWidget(QWidget *parent) : { m_d->m_ui.setupUi(this); // File List - m_d->m_ui.fileList->setSelectionMode(QAbstractItemView::ExtendedSelection); - connect(m_d->m_ui.fileList, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(triggerDiffSelected())); - connect(m_d->m_ui.fileList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(fileItemChanged(QListWidgetItem*))); - connect(m_d->m_ui.fileList, SIGNAL(itemSelectionChanged()), this, SLOT(fileSelectionChanged())); + m_d->m_ui.fileView->setSelectionMode(QAbstractItemView::ExtendedSelection); + m_d->m_ui.fileView->setRootIsDecorated(false); + connect(m_d->m_ui.fileView, SIGNAL(doubleClicked(QModelIndex)), + this, SLOT(diffActivated(QModelIndex))); // Text m_d->m_ui.description->setFont(QFont(QLatin1String("Courier"))); @@ -124,8 +165,12 @@ void SubmitEditorWidget::registerActions(QAction *editorUndoAction, QAction *ed } if (submitAction) { - if (debug) - qDebug() << submitAction << m_d->m_ui.fileList->count() << "items" << m_d->m_filesChecked; + if (debug) { + int count = 0; + if (const QAbstractItemModel *model = m_d->m_ui.fileView->model()) + count = model->rowCount(); + qDebug() << submitAction << count << "items" << m_d->m_filesChecked; + } submitAction->setEnabled(m_d->m_filesChecked); connect(this, SIGNAL(fileCheckStateChanged(bool)), submitAction, SLOT(setEnabled(bool))); m_d->m_ui.buttonLayout->addWidget(new QActionPushButton(submitAction)); @@ -161,7 +206,6 @@ void SubmitEditorWidget::unregisterActions(QAction *editorUndoAction, QAction * } } - QString SubmitEditorWidget::trimmedDescriptionText() const { // Make sure we have one terminating NL @@ -180,91 +224,80 @@ void SubmitEditorWidget::setDescriptionText(const QString &text) m_d->m_ui.description->setPlainText(text); } -QStringList SubmitEditorWidget::fileList() const +int SubmitEditorWidget::fileNameColumn() const { - QStringList rc; - const int count = m_d->m_ui.fileList->count(); - for (int i = 0; i < count; i++) - rc.push_back(m_d->m_ui.fileList->item(i)->text()); - return rc; + return m_d->m_fileNameColumn; } -void SubmitEditorWidget::addFilesUnblocked(const QStringList &list, bool checked, bool userCheckable) +void SubmitEditorWidget::setFileNameColumn(int c) { - if (debug) - qDebug() << Q_FUNC_INFO << list << checked << userCheckable; - foreach (const QString &f, list) { - QListWidgetItem *item = new QListWidgetItem(f); - item->setCheckState(checked ? Qt::Checked : Qt::Unchecked); - if (!userCheckable) - item->setFlags(item->flags() & ~Qt::ItemIsUserCheckable); - m_d->m_ui.fileList->addItem(item); + m_d->m_fileNameColumn = c; +} + +QAbstractItemView::SelectionMode SubmitEditorWidget::fileListSelectionMode() const +{ + return m_d->m_ui.fileView->selectionMode(); +} + +void SubmitEditorWidget::setFileListSelectionMode(QAbstractItemView::SelectionMode sm) +{ + m_d->m_ui.fileView->setSelectionMode(sm); +} + +void SubmitEditorWidget::setFileModel(QAbstractItemModel *model) +{ + m_d->m_ui.fileView->clearSelection(); // trigger the change signals + + m_d->m_ui.fileView->setModel(model); + + if (model->rowCount()) { + const int columnCount = model->columnCount(); + for (int c = 0; c < columnCount; c++) + m_d->m_ui.fileView->resizeColumnToContents(c); } + + connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), + this, SLOT(updateSubmitAction())); + connect(model, SIGNAL(modelReset()), + this, SLOT(updateSubmitAction())); + connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)), + this, SLOT(updateSubmitAction())); + connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)), + this, SLOT(updateSubmitAction())); + connect(m_d->m_ui.fileView->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), + this, SLOT(updateDiffAction())); + updateActions(); } -void SubmitEditorWidget::addFiles(const QStringList &list, bool checked, bool userCheckable) +QAbstractItemModel *SubmitEditorWidget::fileModel() const { - if (list.empty()) - return; - - const bool blocked = m_d->m_ui.fileList->blockSignals(true); - addFilesUnblocked(list, checked, userCheckable); - m_d->m_ui.fileList->blockSignals(blocked); - // Did we gain any checked files..update action accordingly - if (!m_d->m_filesChecked && checked) { - m_d->m_filesChecked = true; - emit fileCheckStateChanged(m_d->m_filesChecked); - } -} - -void SubmitEditorWidget::setFileList(const QStringList &list) -{ - // Trigger enabling of menu action - m_d->m_ui.fileList->clearSelection(); - - const bool blocked = m_d->m_ui.fileList->blockSignals(true); - m_d->m_ui.fileList->clear(); - if (!list.empty()) { - addFilesUnblocked(list, true, true); - // Checked files added? - if (!m_d->m_filesChecked) { - m_d->m_filesChecked = true; - emit fileCheckStateChanged(m_d->m_filesChecked); - } - } - m_d->m_ui.fileList->blockSignals(blocked); -} - -static bool containsCheckState(const QListWidget *lw, Qt::CheckState cs) -{ - const int count = lw->count(); - for (int i = 0; i < count; i++) - if (lw->item(i)->checkState() == cs) - return true; - return false; + return m_d->m_ui.fileView->model(); } QStringList SubmitEditorWidget::selectedFiles() const { + const QList selection = selectedRows(m_d->m_ui.fileView); + if (selection.empty()) + return QStringList(); + QStringList rc; - const int count = m_d->m_ui.fileList->count(); - for (int i = 0; i < count; i++) { - const QListWidgetItem *item = m_d->m_ui.fileList->item(i); - if (item->isSelected()) - rc.push_back(item->text()); - } + const QAbstractItemModel *model = m_d->m_ui.fileView->model(); + const int count = selection.size(); + for (int i = 0; i < count; i++) + rc.push_back(listModelText(model, selection.at(i), fileNameColumn())); return rc; } QStringList SubmitEditorWidget::checkedFiles() const { QStringList rc; - const int count = m_d->m_ui.fileList->count(); - for (int i = 0; i < count; i++) { - const QListWidgetItem *item = m_d->m_ui.fileList->item(i); - if (item->checkState() == Qt::Checked) - rc.push_back(item->text()); - } + const QAbstractItemModel *model = m_d->m_ui.fileView->model(); + if (!model) + return rc; + const int count = model->rowCount(); + for (int i = 0; i < count; i++) + if (listModelChecked(model, i, 0)) + rc.push_back(listModelText(model, i, fileNameColumn())); return rc; } @@ -280,44 +313,61 @@ void SubmitEditorWidget::triggerDiffSelected() emit diffSelected(sel); } -void SubmitEditorWidget::fileItemChanged(QListWidgetItem *item) +void SubmitEditorWidget::diffActivatedDelayed() { - const Qt::CheckState st = item->checkState(); - if (debug) - qDebug() << Q_FUNC_INFO << st << item->text() << m_d->m_filesChecked; - // Enable the actions according to check state - switch (st) { - case Qt::Unchecked: // Item was unchecked: Any checked items left? - if (m_d->m_filesChecked && !containsCheckState(m_d->m_ui.fileList, Qt::Checked)) { - m_d->m_filesChecked = false; - emit fileCheckStateChanged(m_d->m_filesChecked); - } - break; - case Qt::Checked: - // Item was Checked. First one? - if (!m_d->m_filesChecked) { - m_d->m_filesChecked = true; - emit fileCheckStateChanged(m_d->m_filesChecked); - } - break; - case Qt::PartiallyChecked: // Errm? - break; + const QStringList files = QStringList(listModelText(m_d->m_ui.fileView->model(), m_d->m_activatedRow, fileNameColumn())); + emit diffSelected(files); +} + +void SubmitEditorWidget::diffActivated(const QModelIndex &index) +{ + // We need to delay the signal, otherwise, the diff editor will not + // be in the foreground. + m_d->m_activatedRow = index.row(); + QTimer::singleShot(0, this, SLOT(diffActivatedDelayed())); +} + +void SubmitEditorWidget::updateActions() +{ + updateSubmitAction(); + updateDiffAction(); +} + +// Enable submit depending on having checked files +void SubmitEditorWidget::updateSubmitAction() +{ + const bool newFilesCheckedState = hasCheckedFiles(); + if (m_d->m_filesChecked != newFilesCheckedState) { + m_d->m_filesChecked = newFilesCheckedState; + emit fileCheckStateChanged(m_d->m_filesChecked); } } -void SubmitEditorWidget::fileSelectionChanged() +// Enable diff depending on selected files +void SubmitEditorWidget::updateDiffAction() { - const bool newFilesSelected = !m_d->m_ui.fileList->selectedItems().empty(); - if (debug) - qDebug() << Q_FUNC_INFO << newFilesSelected; - if (m_d->m_filesSelected != newFilesSelected) { - m_d->m_filesSelected = newFilesSelected; + const bool filesSelected = hasSelection(); + if (m_d->m_filesSelected != filesSelected) { + m_d->m_filesSelected = filesSelected; emit fileSelectionChanged(m_d->m_filesSelected); - if (debug) - qDebug() << Q_FUNC_INFO << m_d->m_filesSelected; } } +bool SubmitEditorWidget::hasSelection() const +{ + // Not present until model is set + if (const QItemSelectionModel *sm = m_d->m_ui.fileView->selectionModel()) + return sm->hasSelection(); + return false; +} + +bool SubmitEditorWidget::hasCheckedFiles() const +{ + if (const QAbstractItemModel *model = m_d->m_ui.fileView->model()) + return listModelContainsCheckedItem(model); + return false; +} + void SubmitEditorWidget::changeEvent(QEvent *e) { switch (e->type()) { diff --git a/src/libs/utils/submiteditorwidget.h b/src/libs/utils/submiteditorwidget.h index 921bb6d16dd..c24ae5e6d8a 100644 --- a/src/libs/utils/submiteditorwidget.h +++ b/src/libs/utils/submiteditorwidget.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -37,11 +37,14 @@ #include "utils_global.h" #include +#include QT_BEGIN_NAMESPACE class QPlainTextEdit; class QListWidgetItem; class QAction; +class QAbstractItemModel; +class QModelIndex; QT_END_NAMESPACE namespace Core { @@ -51,8 +54,9 @@ struct SubmitEditorWidgetPrivate; /* The submit editor presents the commit message in a text editor and an * checkable list of modified files in a list window. The user can delete - * files from the list by pressing unchecking them or diff the selection - * by doubleclicking. + * files from the list by unchecking them or diff the selection + * by doubleclicking. A list model which contains the file in a column + * specified by fileNameColumn should be set using setFileModel(). * * Additionally, standard creator actions can be registered: * Undo/redo will be set up to work with the description editor. @@ -71,7 +75,8 @@ class QWORKBENCH_UTILS_EXPORT SubmitEditorWidget : public QWidget Q_OBJECT Q_DISABLE_COPY(SubmitEditorWidget) Q_PROPERTY(QString descriptionText READ descriptionText WRITE setDescriptionText DESIGNABLE true) - Q_PROPERTY(QStringList fileList READ fileList WRITE setFileList DESIGNABLE true) + Q_PROPERTY(int fileNameColumn READ fileNameColumn WRITE setFileNameColumn DESIGNABLE false) + Q_PROPERTY(QAbstractItemView::SelectionMode fileListSelectionMode READ fileListSelectionMode WRITE setFileListSelectionMode DESIGNABLE true) public: explicit SubmitEditorWidget(QWidget *parent = 0); virtual ~SubmitEditorWidget(); @@ -86,10 +91,14 @@ public: // Should be used to normalize newlines. QString trimmedDescriptionText() const; - // The raw file list - QStringList fileList() const; - void addFiles(const QStringList&, bool checked = true, bool userCheckable = true); - void setFileList(const QStringList&); + int fileNameColumn() const; + void setFileNameColumn(int c); + + QAbstractItemView::SelectionMode fileListSelectionMode() const; + void setFileListSelectionMode(QAbstractItemView::SelectionMode sm); + + void setFileModel(QAbstractItemModel *model); + QAbstractItemModel *fileModel() const; // Files to be included in submit QStringList checkedFiles() const; @@ -110,11 +119,15 @@ protected: private slots: void triggerDiffSelected(); - void fileItemChanged(QListWidgetItem *); - void fileSelectionChanged(); + void diffActivated(const QModelIndex &index); + void diffActivatedDelayed(); + void updateActions(); + void updateSubmitAction(); + void updateDiffAction(); private: - void addFilesUnblocked(const QStringList &list, bool checked, bool userCheckable); + bool hasSelection() const; + bool hasCheckedFiles() const; SubmitEditorWidgetPrivate *m_d; }; diff --git a/src/libs/utils/submiteditorwidget.ui b/src/libs/utils/submiteditorwidget.ui index 69eed91eb32..2067cad4487 100644 --- a/src/libs/utils/submiteditorwidget.ui +++ b/src/libs/utils/submiteditorwidget.ui @@ -39,14 +39,7 @@ - - - - - - Qt::ElideNone - - + diff --git a/src/libs/utils/synchronousprocess.cpp b/src/libs/utils/synchronousprocess.cpp index a8e2979f819..852f5546be7 100644 --- a/src/libs/utils/synchronousprocess.cpp +++ b/src/libs/utils/synchronousprocess.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/synchronousprocess.h b/src/libs/utils/synchronousprocess.h index 5b51f53cd4c..e9218f43d80 100644 --- a/src/libs/utils/synchronousprocess.h +++ b/src/libs/utils/synchronousprocess.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/libs/utils/utils_global.h b/src/libs/utils/utils_global.h index 5a326faa45e..eb3a2dc615c 100644 --- a/src/libs/utils/utils_global.h +++ b/src/libs/utils/utils_global.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/bineditor/bineditor.cpp b/src/plugins/bineditor/bineditor.cpp index b7576f98030..05b064b83e4 100644 --- a/src/plugins/bineditor/bineditor.cpp +++ b/src/plugins/bineditor/bineditor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/bineditor/bineditor.h b/src/plugins/bineditor/bineditor.h index 1940434b425..804a820145b 100644 --- a/src/plugins/bineditor/bineditor.h +++ b/src/plugins/bineditor/bineditor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/bineditor/bineditorconstants.h b/src/plugins/bineditor/bineditorconstants.h index 86cdb5ea5be..9cbf40d5af3 100644 --- a/src/plugins/bineditor/bineditorconstants.h +++ b/src/plugins/bineditor/bineditorconstants.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/bineditor/bineditorplugin.cpp b/src/plugins/bineditor/bineditorplugin.cpp index ff07d5e876e..883459ba7d7 100644 --- a/src/plugins/bineditor/bineditorplugin.cpp +++ b/src/plugins/bineditor/bineditorplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/plugins/bineditor/bineditorplugin.h b/src/plugins/bineditor/bineditorplugin.h index b5bedb49aa0..51ff129dd62 100644 --- a/src/plugins/bineditor/bineditorplugin.h +++ b/src/plugins/bineditor/bineditorplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/bookmarks/bookmark.cpp b/src/plugins/bookmarks/bookmark.cpp index f622bff74b3..f12ec6dc683 100644 --- a/src/plugins/bookmarks/bookmark.cpp +++ b/src/plugins/bookmarks/bookmark.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/bookmarks/bookmark.h b/src/plugins/bookmarks/bookmark.h index 72ead1d0548..1ca4fd16f1b 100644 --- a/src/plugins/bookmarks/bookmark.h +++ b/src/plugins/bookmarks/bookmark.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp index ea59be83772..88857a81fb7 100644 --- a/src/plugins/bookmarks/bookmarkmanager.cpp +++ b/src/plugins/bookmarks/bookmarkmanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/bookmarks/bookmarkmanager.h b/src/plugins/bookmarks/bookmarkmanager.h index d0d84d50ed0..1763b4e5260 100644 --- a/src/plugins/bookmarks/bookmarkmanager.h +++ b/src/plugins/bookmarks/bookmarkmanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/bookmarks/bookmarks_global.h b/src/plugins/bookmarks/bookmarks_global.h index 59e639e6348..469c7acd325 100644 --- a/src/plugins/bookmarks/bookmarks_global.h +++ b/src/plugins/bookmarks/bookmarks_global.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/bookmarks/bookmarksplugin.cpp b/src/plugins/bookmarks/bookmarksplugin.cpp index 63fbb1c2eef..55b28ec82a3 100644 --- a/src/plugins/bookmarks/bookmarksplugin.cpp +++ b/src/plugins/bookmarks/bookmarksplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include @@ -68,7 +68,7 @@ void BookmarksPlugin::extensionsInitialized() bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *) { m_core = ExtensionSystem::PluginManager::instance()->getObject(); - Core::ActionManagerInterface *am = m_core->actionManager(); + Core::ActionManager *am = m_core->actionManager(); QList context = QList() << m_core->uniqueIDManager()-> uniqueIdentifier(Constants::BOOKMARKS_CONTEXT); @@ -77,17 +77,17 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *) uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR); globalcontext << Core::Constants::C_GLOBAL_ID; - Core::IActionContainer *mtools = + Core::ActionContainer *mtools = am->actionContainer(Core::Constants::M_TOOLS); - Core::IActionContainer *mbm = + Core::ActionContainer *mbm = am->createMenu(QLatin1String(BOOKMARKS_MENU)); mbm->menu()->setTitle(tr("&Bookmarks")); mtools->addMenu(mbm); //Toggle m_toggleAction = new QAction(tr("Toggle Bookmark"), this); - Core::ICommand *cmd = + Core::Command *cmd = am->registerAction(m_toggleAction, BOOKMARKS_TOGGLE_ACTION, textcontext); #ifndef Q_OS_MAC cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+M"))); diff --git a/src/plugins/bookmarks/bookmarksplugin.h b/src/plugins/bookmarks/bookmarksplugin.h index 9bf68c6b9bc..f4853c48cb8 100644 --- a/src/plugins/bookmarks/bookmarksplugin.h +++ b/src/plugins/bookmarks/bookmarksplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index b6e1f159b79..d98539969af 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -46,6 +46,7 @@ #include #include #include +#include using namespace CMakeProjectManager; using namespace CMakeProjectManager::Internal; @@ -61,27 +62,39 @@ using namespace CMakeProjectManager::Internal; // Who sets up the environment for cl.exe ? INCLUDEPATH and so on + CMakeProject::CMakeProject(CMakeManager *manager, const QString &fileName) : m_manager(manager), m_fileName(fileName), m_rootNode(new CMakeProjectNode(m_fileName)) { - m_file = new CMakeFile(this, fileName); QDir dir = QFileInfo(m_fileName).absoluteDir(); - QString cbpFile = findCbpFile(dir); - if (cbpFile.isEmpty()) { - createCbpFile(dir); - cbpFile = findCbpFile(dir); - } + parseCMakeLists(dir); +} + +CMakeProject::~CMakeProject() +{ + delete m_rootNode; +} + +// TODO also call this method if the CMakeLists.txt file changed, which is also called if the CMakeList.txt is updated +// TODO make this function work even if it is reparsing +void CMakeProject::parseCMakeLists(const QDir &directory) +{ + createCbpFile(directory); + + QString cbpFile = findCbpFile(directory); - //TODO move this parsing to a seperate method, which is also called if the CMakeList.txt is updated CMakeCbpParser cbpparser; + qDebug()<<"Parsing file "<path()); m_files.sort(); + qDebug()<<"Adding Targets"; m_targets = cbpparser.targets(); qDebug()<<"Printing targets"; foreach(CMakeTarget ct, m_targets) { @@ -91,6 +104,7 @@ CMakeProject::CMakeProject(CMakeManager *manager, const QString &fileName) qDebug()<<""; } + qDebug()<<"Updating CodeModel"; CppTools::CppModelManagerInterface *modelmanager = ExtensionSystem::PluginManager::instance()->getObject(); if (modelmanager) { CppTools::CppModelManagerInterface::ProjectInfo pinfo = modelmanager->projectInfo(this); @@ -106,9 +120,12 @@ CMakeProject::CMakeProject(CMakeManager *manager, const QString &fileName) } } -CMakeProject::~CMakeProject() +QStringList CMakeProject::targets() const { - delete m_rootNode; + QStringList results; + foreach(const CMakeTarget &ct, m_targets) + results << ct.title; + return results; } QString CMakeProject::findCbpFile(const QDir &directory) @@ -134,10 +151,12 @@ void CMakeProject::createCbpFile(const QDir &directory) // QtCreator generator, which actually can be very similar to the CodeBlock Generator // TODO we need to pass on the same paremeters as the cmakestep + qDebug()<<"Creating cbp file"; QProcess cmake; cmake.setWorkingDirectory(directory.absolutePath()); cmake.start("cmake", QStringList() << "-GCodeBlocks - Unix Makefiles"); - cmake.waitForFinished(); + cmake.waitForFinished(-1); + qDebug()<<"cmake output: \n"< list) @@ -219,14 +238,15 @@ ProjectExplorer::Environment CMakeProject::environment(const QString &buildConfi QString CMakeProject::buildDirectory(const QString &buildConfiguration) const { - Q_UNUSED(buildConfiguration) - //TODO - return QFileInfo(m_fileName).absolutePath(); + QString buildDirectory = value(buildConfiguration, "buildDirectory").toString(); + if (buildDirectory.isEmpty()) + buildDirectory = QFileInfo(m_fileName).absolutePath(); + return buildDirectory; } ProjectExplorer::BuildStepConfigWidget *CMakeProject::createConfigWidget() { - return new CMakeBuildSettingsWidget; + return new CMakeBuildSettingsWidget(this); } QList CMakeProject::subConfigWidgets() @@ -238,8 +258,8 @@ QList CMakeProject::subConfigWidgets() // You should probably set some default values in this method void CMakeProject::newBuildConfiguration(const QString &buildConfiguration) { - Q_UNUSED(buildConfiguration); - //TODO + // Default to all + makeStep()->setBuildTarget(buildConfiguration, "all", true); } ProjectExplorer::ProjectNode *CMakeProject::rootProjectNode() const @@ -261,6 +281,25 @@ void CMakeProject::saveSettingsImpl(ProjectExplorer::PersistentSettingsWriter &w Project::saveSettingsImpl(writer); } +MakeStep *CMakeProject::makeStep() const +{ + foreach (ProjectExplorer::BuildStep *bs, buildSteps()) { + MakeStep *ms = qobject_cast(bs); + if (ms) + return ms; + } + return 0; +} + +CMakeStep *CMakeProject::cmakeStep() const +{ + foreach (ProjectExplorer::BuildStep *bs, buildSteps()) { + if (CMakeStep *cs = qobject_cast(bs)) + return cs; + } + return 0; +} + void CMakeProject::restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader &reader) { // TODO @@ -273,14 +312,16 @@ void CMakeProject::restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader insertBuildStep(0, cmakeStep); insertBuildStep(1, makeStep); - addBuildConfiguration("AllTargets"); - setActiveBuildConfiguration("AllTargets"); - makeStep->setValue("AllTargets", "buildTargets", QStringList() << "all"); + addBuildConfiguration("all"); + setActiveBuildConfiguration("all"); + makeStep->setBuildTarget("all", "all", true); - // Create build configurations of m_targets - qDebug()<<"Create build configurations of m_targets"; + // Create run configurations for m_targets + qDebug()<<"Create run configurations of m_targets"; bool setActive = false; foreach(const CMakeTarget &ct, m_targets) { + if (ct.executable.isEmpty()) + continue; QSharedPointer rc(new CMakeRunConfiguration(this, ct.executable, ct.workingDirectory)); addRunConfiguration(rc); // The first one gets the honour of beeing the active one @@ -289,7 +330,6 @@ void CMakeProject::restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader setActive = true; } } - setActiveBuildConfiguration("all"); } // Restoring is fine @@ -352,10 +392,19 @@ void CMakeFile::modified(ReloadBehavior *behavior) Q_UNUSED(behavior); } - -CMakeBuildSettingsWidget::CMakeBuildSettingsWidget() +CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeProject *project) + : m_project(project) { - + QFormLayout *fl = new QFormLayout(this); + setLayout(fl); + m_pathChooser = new Core::Utils::PathChooser(this); + m_pathChooser->setEnabled(false); + // TODO currently doesn't work + // since creating the cbp file also creates makefiles + // and then cmake builds in that directory instead of shadow building + // We need our own generator for that to work + connect(m_pathChooser, SIGNAL(changed()), this, SLOT(buildDirectoryChanged())); + fl->addRow("Build directory:", m_pathChooser); } QString CMakeBuildSettingsWidget::displayName() const @@ -365,10 +414,19 @@ QString CMakeBuildSettingsWidget::displayName() const void CMakeBuildSettingsWidget::init(const QString &buildConfiguration) { - Q_UNUSED(buildConfiguration); - // TODO + m_buildConfiguration = buildConfiguration; + m_pathChooser->setPath(m_project->buildDirectory(buildConfiguration)); } +void CMakeBuildSettingsWidget::buildDirectoryChanged() +{ + m_project->setValue(m_buildConfiguration, "buildDirectory", m_pathChooser->path()); +} + +///// +// CMakeCbpParser +//// + bool CMakeCbpParser::parseCbpFile(const QString &fileName) { QFile fi(fileName); @@ -445,7 +503,7 @@ void CMakeCbpParser::parseTarget() while (!atEnd()) { readNext(); if (isEndElement()) { - if (m_targetType || m_target.title == "all") { + if (m_targetType || m_target.title == "all" || m_target.title == "install") { m_targets.append(m_target); } return; diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.h b/src/plugins/cmakeprojectmanager/cmakeproject.h index c6a93f8693c..cad7b5fe5df 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.h +++ b/src/plugins/cmakeprojectmanager/cmakeproject.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -36,11 +36,14 @@ #include "cmakeprojectmanager.h" #include "cmakeprojectnodes.h" +#include "makestep.h" +#include "cmakestep.h" #include #include #include #include +#include #include @@ -99,8 +102,12 @@ public: // virtual Node *nodeForFile(const QString &filePath) const = 0; virtual QStringList files(FilesMode fileMode) const; + MakeStep *makeStep() const; + CMakeStep *cmakeStep() const; + QStringList targets() const; private: + void parseCMakeLists(const QDir &directory); QString findCbpFile(const QDir &); void createCbpFile(const QDir &); @@ -177,13 +184,20 @@ private: class CMakeBuildSettingsWidget : public ProjectExplorer::BuildStepConfigWidget { + Q_OBJECT public: - CMakeBuildSettingsWidget(); + CMakeBuildSettingsWidget(CMakeProject *project); virtual QString displayName() const; // This is called to set up the config widget before showing it // buildConfiguration is QString::null for the non buildConfiguration specific page virtual void init(const QString &buildConfiguration); +private slots: + void buildDirectoryChanged(); +private: + CMakeProject *m_project; + Core::Utils::PathChooser *m_pathChooser; + QString m_buildConfiguration; }; } // namespace Internal diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h b/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h index 4e753c570e9..0c543055668 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h +++ b/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index 2282f0cb527..1f4bc59e9ef 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h index b3335702de1..34d97f1cc7c 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp index 2d48295f0f6..b998a18bb70 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.h b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.h index 3f7b8442fa9..ba569dbaf4a 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.h +++ b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp index d38cb56c145..e1b2b1279b6 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -34,6 +34,8 @@ #include "cmakeprojectplugin.h" #include "cmakeprojectmanager.h" #include "cmakerunconfiguration.h" +#include "cmakestep.h" +#include "makestep.h" #include #include @@ -58,6 +60,8 @@ bool CMakeProjectPlugin::initialize(const QStringList & /*arguments*/, QString * if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":cmakeproject/CMakeProject.mimetypes.xml"), errorMessage)) return false; addAutoReleasedObject(new CMakeManager()); + addAutoReleasedObject(new CMakeBuildStepFactory()); + addAutoReleasedObject(new MakeBuildStepFactory()); addAutoReleasedObject(new CMakeRunConfigurationFactory()); return true; } diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.h b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.h index d3cd8941b53..fd40f322c48 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.h +++ b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp index 356cfba3b38..b688fa6bb11 100644 --- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h index 6dff25adfd5..1452ca3908c 100644 --- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -71,7 +71,7 @@ private: * QString nameForType(const QString&) are used to generate a list of creatable * RunConfigurations, and create(..) is used to create it. */ -class CMakeRunConfigurationFactory : public QObject +class CMakeRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory { Q_OBJECT; public: diff --git a/src/plugins/cmakeprojectmanager/cmakestep.cpp b/src/plugins/cmakeprojectmanager/cmakestep.cpp index 13963273287..9f114893fc4 100644 --- a/src/plugins/cmakeprojectmanager/cmakestep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakestep.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -37,6 +37,8 @@ #include "cmakeprojectconstants.h" #include +#include +#include using namespace CMakeProjectManager; using namespace CMakeProjectManager::Internal; @@ -55,7 +57,14 @@ bool CMakeStep::init(const QString &buildConfiguration) setEnabled(buildConfiguration, true); setWorkingDirectory(buildConfiguration, m_pro->buildDirectory(buildConfiguration)); setCommand(buildConfiguration, "cmake"); // TODO give full path here? - setArguments(buildConfiguration, QStringList() << "-GUnix Makefiles"); // TODO + + QString sourceDir = QFileInfo(m_pro->file()->fileName()).absolutePath(); + setArguments(buildConfiguration, + QStringList() + << sourceDir + << "-GUnix Makefiles" + << value(buildConfiguration, "userArguments").toStringList()); // TODO + setEnvironment(buildConfiguration, m_pro->environment(buildConfiguration)); return AbstractProcessStep::init(buildConfiguration); } @@ -72,17 +81,17 @@ void CMakeStep::run(QFutureInterface &fi) QString CMakeStep::name() { - return "CMake"; + return Constants::CMAKESTEP; } QString CMakeStep::displayName() { - return Constants::CMAKESTEP; + return "CMake"; } ProjectExplorer::BuildStepConfigWidget *CMakeStep::createConfigWidget() { - return new CMakeBuildStepConfigWidget(); + return new CMakeBuildStepConfigWidget(this); } bool CMakeStep::immutable() const @@ -90,18 +99,46 @@ bool CMakeStep::immutable() const return true; } +QString CMakeStep::userArguments(const QString &buildConfiguration) const +{ + return ProjectExplorer::Environment::joinArgumentList(value(buildConfiguration, "userArguments").toStringList()); +} + +void CMakeStep::setUserArguments(const QString &buildConfiguration, const QString &arguments) +{ + setValue(buildConfiguration, "userArguments", ProjectExplorer::Environment::parseCombinedArgString(arguments)); +} + // // CMakeBuildStepConfigWidget // +CMakeBuildStepConfigWidget::CMakeBuildStepConfigWidget(CMakeStep *cmakeStep) + : m_cmakeStep(cmakeStep) +{ + QFormLayout *fl = new QFormLayout(this); + setLayout(fl); + m_arguments = new QLineEdit(this); + fl->addRow("Additional arguments", m_arguments); + connect(m_arguments, SIGNAL(textChanged(QString)), this, SLOT(argumentsLineEditChanged())); +} + QString CMakeBuildStepConfigWidget::displayName() const { return "CMake"; } -void CMakeBuildStepConfigWidget::init(const QString & /*buildConfiguration */) +void CMakeBuildStepConfigWidget::init(const QString &buildConfiguration) { - // TODO + m_buildConfiguration = buildConfiguration; + disconnect(m_arguments, SIGNAL(textChanged(QString)), this, SLOT(argumentsLineEditChanged())); + m_arguments->setText(m_cmakeStep->userArguments(buildConfiguration)); + connect(m_arguments, SIGNAL(textChanged(QString)), this, SLOT(argumentsLineEditChanged())); +} + +void CMakeBuildStepConfigWidget::argumentsLineEditChanged() +{ + m_cmakeStep->setUserArguments(m_buildConfiguration, m_arguments->text()); } // diff --git a/src/plugins/cmakeprojectmanager/cmakestep.h b/src/plugins/cmakeprojectmanager/cmakestep.h index a0a20b0c50d..c5006a3eadc 100644 --- a/src/plugins/cmakeprojectmanager/cmakestep.h +++ b/src/plugins/cmakeprojectmanager/cmakestep.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -37,6 +37,10 @@ #include #include +QT_BEGIN_NAMESPACE +class QLineEdit; +QT_END_NAMESPACE + namespace CMakeProjectManager { namespace Internal { @@ -46,6 +50,7 @@ class CMakeBuildStepConfigWidget; class CMakeStep : public ProjectExplorer::AbstractProcessStep { + Q_OBJECT public: CMakeStep(CMakeProject *pro); ~CMakeStep(); @@ -57,15 +62,26 @@ public: virtual QString displayName(); virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); virtual bool immutable() const; + + void setUserArguments(const QString &buildConfiguration, const QString &arguments); + QString userArguments(const QString &buildConfiguration) const; private: CMakeProject *m_pro; }; class CMakeBuildStepConfigWidget :public ProjectExplorer::BuildStepConfigWidget { + Q_OBJECT public: + CMakeBuildStepConfigWidget(CMakeStep *cmakeStep); virtual QString displayName() const; virtual void init(const QString &buildConfiguration); +private slots: + void argumentsLineEditChanged(); +private: + CMakeStep *m_cmakeStep; + QString m_buildConfiguration; + QLineEdit *m_arguments; }; class CMakeBuildStepFactory : public ProjectExplorer::IBuildStepFactory diff --git a/src/plugins/cmakeprojectmanager/makestep.cpp b/src/plugins/cmakeprojectmanager/makestep.cpp index abd77cd10aa..60f5d04903e 100644 --- a/src/plugins/cmakeprojectmanager/makestep.cpp +++ b/src/plugins/cmakeprojectmanager/makestep.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -36,6 +36,11 @@ #include "cmakeproject.h" #include +#include +#include +#include +#include +#include using namespace CMakeProjectManager; using namespace CMakeProjectManager::Internal; @@ -66,17 +71,17 @@ void MakeStep::run(QFutureInterface &fi) QString MakeStep::name() { - return "Make"; + return Constants::MAKESTEP; } QString MakeStep::displayName() { - return Constants::CMAKESTEP; + return "Make"; } ProjectExplorer::BuildStepConfigWidget *MakeStep::createConfigWidget() { - return new MakeBuildStepConfigWidget(); + return new MakeBuildStepConfigWidget(this); } bool MakeStep::immutable() const @@ -84,18 +89,72 @@ bool MakeStep::immutable() const return true; } +CMakeProject *MakeStep::project() const +{ + return m_pro; +} + +bool MakeStep::buildsTarget(const QString &buildConfiguration, const QString &target) const +{ + return value(buildConfiguration, "buildTargets").toStringList().contains(target); +} + +void MakeStep::setBuildTarget(const QString &buildConfiguration, const QString &target, bool on) +{ + QStringList old = value(buildConfiguration, "buildTargets").toStringList(); + if (on && !old.contains(target)) + setValue(buildConfiguration, "buildTargets", old << target); + else if(!on && old.contains(target)) + setValue(buildConfiguration, "buildTargets", old.removeOne(target)); +} + // // CMakeBuildStepConfigWidget // +MakeBuildStepConfigWidget::MakeBuildStepConfigWidget(MakeStep *makeStep) + : m_makeStep(makeStep) +{ + QFormLayout *fl = new QFormLayout(this); + setLayout(fl); + + m_targetsList = new QListWidget; + fl->addRow("Targets:", m_targetsList); + + // TODO update this list also on rescans of the CMakeLists.txt + CMakeProject *pro = m_makeStep->project(); + foreach(const QString& target, pro->targets()) { + QListWidgetItem *item = new QListWidgetItem(target, m_targetsList); + item->setFlags(item->flags() | Qt::ItemIsUserCheckable); + item->setCheckState(Qt::Unchecked); + } + connect(m_targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*))); +} + +void MakeBuildStepConfigWidget::itemChanged(QListWidgetItem *item) +{ + m_makeStep->setBuildTarget(m_buildConfiguration, item->text(), item->checkState() & Qt::Checked); +} QString MakeBuildStepConfigWidget::displayName() const { return "Make"; } -void MakeBuildStepConfigWidget::init(const QString & /* buildConfiguration */) +void MakeBuildStepConfigWidget::init(const QString &buildConfiguration) { // TODO + + // disconnect to make the changes to the items + disconnect(m_targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*))); + m_buildConfiguration = buildConfiguration; + int count = m_targetsList->count(); + for(int i = 0; i < count; ++i) { + QListWidgetItem *item = m_targetsList->item(i); + item->setCheckState(m_makeStep->buildsTarget(buildConfiguration, item->text()) ? Qt::Checked : Qt::Unchecked); + } + // and connect again + connect(m_targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*))); + } // diff --git a/src/plugins/cmakeprojectmanager/makestep.h b/src/plugins/cmakeprojectmanager/makestep.h index 33800265d6a..fbfc007dbe4 100644 --- a/src/plugins/cmakeprojectmanager/makestep.h +++ b/src/plugins/cmakeprojectmanager/makestep.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -36,6 +36,12 @@ #include +QT_BEGIN_NAMESPACE +class QLineEdit; +class QListWidget; +class QListWidgetItem; +QT_END_NAMESPACE + namespace CMakeProjectManager { namespace Internal { @@ -43,6 +49,7 @@ class CMakeProject; class MakeStep : public ProjectExplorer::AbstractProcessStep { + Q_OBJECT public: MakeStep(CMakeProject *pro); ~MakeStep(); @@ -54,15 +61,26 @@ public: virtual QString displayName(); virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); virtual bool immutable() const; + CMakeProject *project() const; + bool buildsTarget(const QString &buildConfiguration, const QString &target) const; + void setBuildTarget(const QString &buildConfiguration, const QString &target, bool on); private: CMakeProject *m_pro; }; class MakeBuildStepConfigWidget :public ProjectExplorer::BuildStepConfigWidget { + Q_OBJECT public: + MakeBuildStepConfigWidget(MakeStep *makeStep); virtual QString displayName() const; virtual void init(const QString &buildConfiguration); +private slots: + void itemChanged(QListWidgetItem*); +private: + QString m_buildConfiguration; + MakeStep * m_makeStep; + QListWidget *m_targetsList; }; class MakeBuildStepFactory : public ProjectExplorer::IBuildStepFactory diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp index bec545cc262..bf2d49826c0 100644 --- a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp +++ b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -31,8 +31,10 @@ ** ***************************************************************************/ -#include "actioncontainer.h" -#include "command.h" +#include "actioncontainer_p.h" +#include "actionmanager_p.h" + +#include "command_p.h" #include "coreimpl.h" #include "coreconstants.h" @@ -48,146 +50,112 @@ Q_DECLARE_METATYPE(Core::Internal::MenuActionContainer*) using namespace Core; using namespace Core::Internal; -/*! - \class IActionContainer - \mainclass - \ingroup qwb - \inheaderfile iactioncontainer.h - - \brief The class... - - The Action Container interface... -*/ - -/*! - \enum IActionContainer::ContainerType -*/ - -/*! - \enum IActionContainer::EmptyAction -*/ - -/*! - \fn virtual IActionContainer::setEmptyAction(EmptyAction ea) -*/ - -/*! - \fn virtual int IActionContainer::id() const -*/ - -/*! - \fn virtual ContainerType IActionContainer::type() const -*/ - -/*! - \fn virtual QMenu *IActionContainer::menu() const -*/ - -/*! - \fn virtual QToolBar *IActionContainer::toolBar() const -*/ - -/*! - \fn virtual QMenuBar *IActionContainer::menuBar() const -*/ - -/*! - \fn virtual QAction *IActionContainer::insertLocation(const QString &group) const -*/ - -/*! - \fn virtual void IActionContainer::appendGroup(const QString &group, bool global) -*/ - -/*! - \fn virtual void IActionContainer::addAction(Core::ICommand *action, const QString &group) -*/ - -/*! - \fn virtual void IActionContainer::addMenu(Core::IActionContainer *menu, const QString &group) -*/ - -/*! - \fn virtual bool IActionContainer::update() -*/ - -/*! - \fn virtual IActionContainer::~IActionContainer() -*/ - -// ---------- ActionContainer ------------ - /*! \class ActionContainer - \ingroup qwb - \inheaderfile actioncontainer.h + \mainclass + + \brief The ActionContainer class represents a menu or menu bar in Qt Creator. + + */ /*! - \enum ActionContainer::ContainerState + \enum ActionContainer::ContainerType */ /*! -\fn ActionContainer::ActionContainer(ContainerType type, int id) + \enum ActionContainer::EmptyAction */ -ActionContainer::ActionContainer(ContainerType type, int id) - : m_data(CS_None), m_type(type), m_id(id) -{ -} +/*! + \fn virtual ActionContainer::setEmptyAction(EmptyAction ea) +*/ + +/*! + \fn virtual int ActionContainer::id() const +*/ + +/*! + \fn virtual ContainerType ActionContainer::type() const +*/ + +/*! + \fn virtual QMenu *ActionContainer::menu() const +*/ + +/*! + \fn virtual QToolBar *ActionContainer::toolBar() const +*/ + +/*! + \fn virtual QMenuBar *ActionContainer::menuBar() const +*/ + +/*! + \fn virtual QAction *ActionContainer::insertLocation(const QString &group) const +*/ + +/*! + \fn virtual void ActionContainer::appendGroup(const QString &group, bool global) +*/ + +/*! + \fn virtual void ActionContainer::addAction(Core::Command *action, const QString &group) +*/ + +/*! + \fn virtual void ActionContainer::addMenu(Core::ActionContainer *menu, const QString &group) +*/ + +/*! + \fn virtual bool ActionContainer::update() +*/ /*! \fn virtual ActionContainer::~ActionContainer() */ +// ---------- ActionContainerPrivate ------------ + /*! - ... + \class Core::Internal::ActionContainerPrivate + \internal */ -void ActionContainer::setEmptyAction(EmptyAction ea) + +ActionContainerPrivate::ActionContainerPrivate(int id) + : m_data(CS_None), m_id(id) +{ + +} + +void ActionContainerPrivate::setEmptyAction(EmptyAction ea) { m_data = ((m_data & ~EA_Mask) | ea); } -/*! - ... -*/ -bool ActionContainer::hasEmptyAction(EmptyAction ea) const +bool ActionContainerPrivate::hasEmptyAction(EmptyAction ea) const { return (m_data & EA_Mask) == ea; } -/*! - ... -*/ -void ActionContainer::setState(ContainerState state) +void ActionContainerPrivate::setState(ContainerState state) { m_data |= state; } -/*! - ... -*/ -bool ActionContainer::hasState(ContainerState state) const +bool ActionContainerPrivate::hasState(ContainerState state) const { return (m_data & state); } -/*! - ... -*/ -void ActionContainer::appendGroup(const QString &group, bool global) +void ActionContainerPrivate::appendGroup(const QString &group) { UniqueIDManager *idmanager = CoreImpl::instance()->uniqueIDManager(); int gid = idmanager->uniqueIdentifier(group); m_groups << gid; - if (global) - ActionManager::instance()->registerGlobalGroup(gid, m_id); } -/*! - ... -*/ -QAction *ActionContainer::insertLocation(const QString &group) const +QAction *ActionContainerPrivate::insertLocation(const QString &group) const { UniqueIDManager *idmanager = CoreImpl::instance()->uniqueIDManager(); int grpid = idmanager->uniqueIdentifier(group); @@ -196,41 +164,22 @@ QAction *ActionContainer::insertLocation(const QString &group) const return beforeAction(pos, &prevKey); } -/*! -\fn virtual void ActionContainer::insertAction(QAction *before, QAction *action) = 0 -*/ - -/*! -\fn virtual void ActionContainer::insertMenu(QAction *before, QMenu *menu) = 0 -*/ - -/*! -\fn QList ActionContainer::commands() const -*/ - -/*! -\fn QList ActionContainer::subContainers() const -*/ - -/*! - ... -*/ -void ActionContainer::addAction(ICommand *action, const QString &group) +void ActionContainerPrivate::addAction(Command *action, const QString &group) { if (!canAddAction(action)) return; - ActionManager *am = ActionManager::instance(); + ActionManagerPrivate *am = ActionManagerPrivate::instance(); Action *a = static_cast(action); - if (a->stateFlags() & Command::CS_PreLocation) { + if (a->stateFlags() & CommandPrivate::CS_PreLocation) { QList locs = a->locations(); for (int i=0; iactionContainer(locs.at(i).m_container)) { - ActionContainer *ac = static_cast(aci); + if (ActionContainer *aci = am->actionContainer(locs.at(i).m_container)) { + ActionContainerPrivate *ac = static_cast(aci); ac->addAction(action, locs.at(i).m_position, false); } } - a->setStateFlags(a->stateFlags() | Command::CS_Initialized); + a->setStateFlags(a->stateFlags() | CommandPrivate::CS_Initialized); } else { UniqueIDManager *idmanager = CoreImpl::instance()->uniqueIDManager(); int grpid = idmanager->uniqueIdentifier(Constants::G_DEFAULT_TWO); @@ -243,23 +192,21 @@ void ActionContainer::addAction(ICommand *action, const QString &group) } } -/*! - ... -*/ -void ActionContainer::addMenu(IActionContainer *menu, const QString &group) +void ActionContainerPrivate::addMenu(ActionContainer *menu, const QString &group) { - if (!canAddMenu(menu)) + ActionContainerPrivate *container = static_cast(menu); + if (!container->canBeAddedToMenu()) return; - ActionManager *am = ActionManager::instance(); + ActionManagerPrivate *am = ActionManagerPrivate::instance(); MenuActionContainer *mc = static_cast(menu); - if (mc->hasState(ActionContainer::CS_PreLocation)) { + if (mc->hasState(ActionContainerPrivate::CS_PreLocation)) { CommandLocation loc = mc->location(); - if (IActionContainer *aci = am->actionContainer(loc.m_container)) { - ActionContainer *ac = static_cast(aci); + if (ActionContainer *aci = am->actionContainer(loc.m_container)) { + ActionContainerPrivate *ac = static_cast(aci); ac->addMenu(menu, loc.m_position, false); } - mc->setState(ActionContainer::CS_Initialized); + mc->setState(ActionContainerPrivate::CS_Initialized); } else { UniqueIDManager *idmanager = CoreImpl::instance()->uniqueIDManager(); int grpid = idmanager->uniqueIdentifier(Constants::G_DEFAULT_TWO); @@ -272,80 +219,34 @@ void ActionContainer::addMenu(IActionContainer *menu, const QString &group) } } -/*! - ... -*/ -int ActionContainer::id() const +int ActionContainerPrivate::id() const { return m_id; } -/*! - ... -*/ -IActionContainer::ContainerType ActionContainer::type() const -{ - return m_type; -} - -/*! - ... -*/ -QMenu *ActionContainer::menu() const +QMenu *ActionContainerPrivate::menu() const { return 0; } -/*! - ... -*/ -QToolBar *ActionContainer::toolBar() const +QMenuBar *ActionContainerPrivate::menuBar() const { return 0; } -/*! - ... -*/ -QMenuBar *ActionContainer::menuBar() const +bool ActionContainerPrivate::canAddAction(Command *action) const { - return 0; -} - -/*! - ... -*/ -bool ActionContainer::canAddAction(ICommand *action) const -{ - if (action->type() != ICommand::CT_OverridableAction) + if (action->type() != Command::CT_OverridableAction) return false; - Command *cmd = static_cast(action); - if (cmd->stateFlags() & Command::CS_Initialized) + CommandPrivate *cmd = static_cast(action); + if (cmd->stateFlags() & CommandPrivate::CS_Initialized) return false; return true; } -/*! - ... -*/ -bool ActionContainer::canAddMenu(IActionContainer *menu) const -{ - if (menu->type() != IActionContainer::CT_Menu) - return false; - - ActionContainer *container = static_cast(menu); - if (container->hasState(ActionContainer::CS_Initialized)) - return false; - - return true; -} - -/*! - ... -*/ -void ActionContainer::addAction(ICommand *action, int pos, bool setpos) +void ActionContainerPrivate::addAction(Command *action, int pos, bool setpos) { Action *a = static_cast(action); @@ -367,10 +268,7 @@ void ActionContainer::addAction(ICommand *action, int pos, bool setpos) insertAction(ba, a->action()); } -/*! - ... -*/ -void ActionContainer::addMenu(IActionContainer *menu, int pos, bool setpos) +void ActionContainerPrivate::addMenu(ActionContainer *menu, int pos, bool setpos) { MenuActionContainer *mc = static_cast(menu); @@ -390,13 +288,9 @@ void ActionContainer::addMenu(IActionContainer *menu, int pos, bool setpos) insertMenu(ba, mc->menu()); } -/*! - ... - \internal -*/ -QAction *ActionContainer::beforeAction(int pos, int *prevKey) const +QAction *ActionContainerPrivate::beforeAction(int pos, int *prevKey) const { - ActionManager *am = ActionManager::instance(); + ActionManagerPrivate *am = ActionManagerPrivate::instance(); int baId = -1; @@ -415,20 +309,16 @@ QAction *ActionContainer::beforeAction(int pos, int *prevKey) const if (baId == -1) return 0; - if (ICommand *cmd = am->command(baId)) + if (Command *cmd = am->command(baId)) return cmd->action(); - if (IActionContainer *container = am->actionContainer(baId)) + if (ActionContainer *container = am->actionContainer(baId)) if (QMenu *menu = container->menu()) return menu->menuAction(); return 0; } -/*! - ... - \internal -*/ -int ActionContainer::calcPosition(int pos, int prevKey) const +int ActionContainerPrivate::calcPosition(int pos, int prevKey) const { int grp = (pos & 0xFFFF0000); if (prevKey == -1) @@ -445,23 +335,16 @@ int ActionContainer::calcPosition(int pos, int prevKey) const // ---------- MenuActionContainer ------------ /*! - \class MenuActionContainer - \ingroup qwb - \inheaderfile actioncontainer.h + \class Core::Internal::MenuActionContainer + \internal */ -/*! - ... -*/ MenuActionContainer::MenuActionContainer(int id) - : ActionContainer(CT_Menu, id), m_menu(0) + : ActionContainerPrivate(id), m_menu(0) { setEmptyAction(EA_Disable); } -/*! - ... -*/ void MenuActionContainer::setMenu(QMenu *menu) { m_menu = menu; @@ -472,49 +355,31 @@ void MenuActionContainer::setMenu(QMenu *menu) m_menu->menuAction()->setData(v); } -/*! - ... -*/ QMenu *MenuActionContainer::menu() const { return m_menu; } -/*! - ... -*/ void MenuActionContainer::insertAction(QAction *before, QAction *action) { m_menu->insertAction(before, action); } -/*! - ... -*/ void MenuActionContainer::insertMenu(QAction *before, QMenu *menu) { m_menu->insertMenu(before, menu); } -/*! - ... -*/ void MenuActionContainer::setLocation(const CommandLocation &location) { m_location = location; } -/*! - ... -*/ CommandLocation MenuActionContainer::location() const { return m_location; } -/*! - ... -*/ bool MenuActionContainer::update() { if (hasEmptyAction(EA_None)) @@ -522,7 +387,7 @@ bool MenuActionContainer::update() bool hasitems = false; - foreach (IActionContainer *container, subContainers()) { + foreach (ActionContainer *container, subContainers()) { if (container == this) { qWarning() << Q_FUNC_INFO << "container" << (this->menu() ? this->menu()->title() : "") << "contains itself as subcontainer"; continue; @@ -533,7 +398,7 @@ bool MenuActionContainer::update() } } if (!hasitems) { - foreach (ICommand *command, commands()) { + foreach (Command *command, commands()) { if (command->isActive()) { hasitems = true; break; @@ -549,131 +414,48 @@ bool MenuActionContainer::update() return hasitems; } -// ---------- ToolBarActionContainer ------------ - -/*! - \class ToolBarActionContainer - \ingroup qwb - \inheaderfile actioncontainer.h -*/ - -/*! - ... -*/ -ToolBarActionContainer::ToolBarActionContainer(int id) - : ActionContainer(CT_ToolBar, id), m_toolBar(0) +bool MenuActionContainer::canBeAddedToMenu() const { - setEmptyAction(EA_None); + if (hasState(ActionContainerPrivate::CS_Initialized)) + return false; + + return true; } -/*! - ... -*/ -void ToolBarActionContainer::setToolBar(QToolBar *toolBar) -{ - m_toolBar = toolBar; -} - -/*! - ... -*/ -QToolBar *ToolBarActionContainer::toolBar() const -{ - return m_toolBar; -} - -/*! - ... -*/ -void ToolBarActionContainer::insertAction(QAction *before, QAction *action) -{ - m_toolBar->insertAction(before, action); -} - -/*! - ... -*/ -void ToolBarActionContainer::insertMenu(QAction *, QMenu *) -{ - // not implemented -} - -/*! - ... -*/ -bool ToolBarActionContainer::update() -{ - if (hasEmptyAction(EA_None)) - return true; - - bool hasitems = false; - foreach (ICommand *command, commands()) { - if (command->isActive()) { - hasitems = true; - break; - } - } - - if (hasEmptyAction(EA_Hide)) - m_toolBar->setVisible(hasitems); - else if (hasEmptyAction(EA_Disable)) - m_toolBar->setEnabled(hasitems); - - return hasitems; -} // ---------- MenuBarActionContainer ------------ /*! - \class MenuBarActionContainer - \ingroup qwb - \inheaderfile actioncontainer.h + \class Core::Internal::MenuBarActionContainer + \internal */ -/*! - ... -*/ MenuBarActionContainer::MenuBarActionContainer(int id) - : ActionContainer(CT_ToolBar, id), m_menuBar(0) + : ActionContainerPrivate(id), m_menuBar(0) { setEmptyAction(EA_None); } -/*! - ... -*/ void MenuBarActionContainer::setMenuBar(QMenuBar *menuBar) { m_menuBar = menuBar; } -/*! - ... -*/ QMenuBar *MenuBarActionContainer::menuBar() const { return m_menuBar; } -/*! - ... -*/ void MenuBarActionContainer::insertAction(QAction *before, QAction *action) { m_menuBar->insertAction(before, action); } -/*! - ... -*/ void MenuBarActionContainer::insertMenu(QAction *before, QMenu *menu) { m_menuBar->insertMenu(before, menu); } -/*! - ... -*/ bool MenuBarActionContainer::update() { if (hasEmptyAction(EA_None)) @@ -695,3 +477,9 @@ bool MenuBarActionContainer::update() return hasitems; } + +bool MenuBarActionContainer::canBeAddedToMenu() const +{ + return false; +} + diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer.h b/src/plugins/coreplugin/actionmanager/actioncontainer.h index 6d116426f20..adad9a3d342 100644 --- a/src/plugins/coreplugin/actionmanager/actioncontainer.h +++ b/src/plugins/coreplugin/actionmanager/actioncontainer.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -34,123 +34,42 @@ #ifndef ACTIONCONTAINER_H #define ACTIONCONTAINER_H -#include "actionmanager.h" - -#include -#include +#include +#include +#include +#include +#include namespace Core { -namespace Internal { -class ActionContainer : public Core::IActionContainer +class Command; + +class ActionContainer : public QObject { public: - enum ContainerState { - CS_None = 0x000000, - CS_Initialized = 0x010000, - CS_PreLocation = 0x020000, - CS_UserDefined = 0x040000 + enum EmptyAction { + EA_Mask = 0xFF00, + EA_None = 0x0100, + EA_Hide = 0x0200, + EA_Disable = 0x0300 }; - ActionContainer(ContainerType type, int id); + virtual void setEmptyAction(EmptyAction ea) = 0; + + virtual int id() const = 0; + + virtual QMenu *menu() const = 0; + virtual QMenuBar *menuBar() const = 0; + + virtual QAction *insertLocation(const QString &group) const = 0; + virtual void appendGroup(const QString &group) = 0; + virtual void addAction(Core::Command *action, const QString &group = QString()) = 0; + virtual void addMenu(Core::ActionContainer *menu, const QString &group = QString()) = 0; + + virtual bool update() = 0; virtual ~ActionContainer() {} - - void setEmptyAction(EmptyAction ea); - bool hasEmptyAction(EmptyAction ea) const; - - void setState(ContainerState state); - bool hasState(ContainerState state) const; - - QAction *insertLocation(const QString &group) const; - void appendGroup(const QString &group, bool global = false); - void addAction(ICommand *action, const QString &group = QString()); - void addMenu(IActionContainer *menu, const QString &group = QString()); - - int id() const; - ContainerType type() const; - - QMenu *menu() const; - QToolBar *toolBar() const; - QMenuBar *menuBar() const; - - virtual void insertAction(QAction *before, QAction *action) = 0; - virtual void insertMenu(QAction *before, QMenu *menu) = 0; - - QList commands() const { return m_commands; } - QList subContainers() const { return m_subContainers; } -protected: - bool canAddAction(ICommand *action) const; - bool canAddMenu(IActionContainer *menu) const; - - void addAction(ICommand *action, int pos, bool setpos); - void addMenu(IActionContainer *menu, int pos, bool setpos); - -private: - QAction *beforeAction(int pos, int *prevKey) const; - int calcPosition(int pos, int prevKey) const; - - QList m_groups; - int m_data; - ContainerType m_type; - int m_id; - QMap m_posmap; - QList m_subContainers; - QList m_commands; }; -class MenuActionContainer : public ActionContainer -{ -public: - MenuActionContainer(int id); - - void setMenu(QMenu *menu); - QMenu *menu() const; - - void setLocation(const CommandLocation &location); - CommandLocation location() const; - - void insertAction(QAction *before, QAction *action); - void insertMenu(QAction *before, QMenu *menu); - bool update(); - -private: - QMenu *m_menu; - CommandLocation m_location; -}; - -class ToolBarActionContainer : public ActionContainer -{ -public: - ToolBarActionContainer(int id); - - void setToolBar(QToolBar *toolBar); - QToolBar *toolBar() const; - - void insertAction(QAction *before, QAction *action); - void insertMenu(QAction *before, QMenu *menu); - bool update(); - -private: - QToolBar *m_toolBar; -}; - -class MenuBarActionContainer : public ActionContainer -{ -public: - MenuBarActionContainer(int id); - - void setMenuBar(QMenuBar *menuBar); - QMenuBar *menuBar() const; - - void insertAction(QAction *before, QAction *action); - void insertMenu(QAction *before, QMenu *menu); - bool update(); - -private: - QMenuBar *m_menuBar; -}; - -} // namespace Internal } // namespace Core #endif // ACTIONCONTAINER_H diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer_p.h b/src/plugins/coreplugin/actionmanager/actioncontainer_p.h new file mode 100644 index 00000000000..6521cff5748 --- /dev/null +++ b/src/plugins/coreplugin/actionmanager/actioncontainer_p.h @@ -0,0 +1,142 @@ +/*************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** +** Non-Open Source Usage +** +** Licensees may use this file in accordance with the Qt Beta Version +** License Agreement, Agreement version 2.2 provided with the Software or, +** alternatively, in accordance with the terms contained in a written +** agreement between you and Nokia. +** +** GNU General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the packaging +** of this file. Please review the following information to ensure GNU +** General Public Licensing requirements will be met: +** +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt GPL Exception +** version 1.3, included in the file GPL_EXCEPTION.txt in this package. +** +***************************************************************************/ + +#ifndef ACTIONCONTAINER_P_H +#define ACTIONCONTAINER_P_H + +#include "actionmanager_p.h" + +#include +#include + +namespace Core { +namespace Internal { + +class ActionContainerPrivate : public Core::ActionContainer +{ +public: + enum ContainerState { + CS_None = 0x000000, + CS_Initialized = 0x010000, + CS_PreLocation = 0x020000, + CS_UserDefined = 0x040000 + }; + + ActionContainerPrivate(int id); + virtual ~ActionContainerPrivate() {} + + void setEmptyAction(EmptyAction ea); + bool hasEmptyAction(EmptyAction ea) const; + + void setState(ContainerState state); + bool hasState(ContainerState state) const; + + QAction *insertLocation(const QString &group) const; + void appendGroup(const QString &group); + void addAction(Command *action, const QString &group = QString()); + void addMenu(ActionContainer *menu, const QString &group = QString()); + + int id() const; + + QMenu *menu() const; + QMenuBar *menuBar() const; + + virtual void insertAction(QAction *before, QAction *action) = 0; + virtual void insertMenu(QAction *before, QMenu *menu) = 0; + + QList commands() const { return m_commands; } + QList subContainers() const { return m_subContainers; } +protected: + bool canAddAction(Command *action) const; + bool canAddMenu(ActionContainer *menu) const; + virtual bool canBeAddedToMenu() const = 0; + + void addAction(Command *action, int pos, bool setpos); + void addMenu(ActionContainer *menu, int pos, bool setpos); + +private: + QAction *beforeAction(int pos, int *prevKey) const; + int calcPosition(int pos, int prevKey) const; + + QList m_groups; + int m_data; + int m_id; + QMap m_posmap; + QList m_subContainers; + QList m_commands; +}; + +class MenuActionContainer : public ActionContainerPrivate +{ +public: + MenuActionContainer(int id); + + void setMenu(QMenu *menu); + QMenu *menu() const; + + void setLocation(const CommandLocation &location); + CommandLocation location() const; + + void insertAction(QAction *before, QAction *action); + void insertMenu(QAction *before, QMenu *menu); + bool update(); + +protected: + bool canBeAddedToMenu() const; +private: + QMenu *m_menu; + CommandLocation m_location; +}; + +class MenuBarActionContainer : public ActionContainerPrivate +{ +public: + MenuBarActionContainer(int id); + + void setMenuBar(QMenuBar *menuBar); + QMenuBar *menuBar() const; + + void insertAction(QAction *before, QAction *action); + void insertMenu(QAction *before, QMenu *menu); + bool update(); + +protected: + bool canBeAddedToMenu() const; +private: + QMenuBar *m_menuBar; +}; + +} // namespace Internal +} // namespace Core + +#endif // ACTIONCONTAINER_P_H diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.cpp b/src/plugins/coreplugin/actionmanager/actionmanager.cpp index bc43374f0e4..3932d42598b 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager.cpp +++ b/src/plugins/coreplugin/actionmanager/actionmanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -31,10 +31,10 @@ ** ***************************************************************************/ -#include "actionmanager.h" +#include "actionmanager_p.h" #include "mainwindow.h" -#include "actioncontainer.h" -#include "command.h" +#include "actioncontainer_p.h" +#include "command_p.h" #include "uniqueidmanager.h" #include @@ -44,7 +44,6 @@ #include #include #include -#include #include namespace { @@ -52,115 +51,163 @@ namespace { } /*! - \class Core::ActionManagerInterface + \class Core::ActionManager \mainclass - \ingroup qwb - \inheaderfile actionmanagerinterface.h - \brief All actions should be registered in the ActionManager, since this enables the user to - e.g. change their shortcuts at a central place. + \brief The action manager is responsible for registration of menus and + menu items and keyboard shortcuts. - The ActionManagerInterface is the central bookkeeper of actions and their shortcuts and layout. - You get the only implementation of this class from the core interface (ICore::actionManager()). + The ActionManager is the central bookkeeper of actions and their shortcuts and layout. + You get the only implementation of this class from the core interface + ICore::actionManager() method, e.g. + \code + ExtensionSystem::PluginManager::instance()->getObject()->actionManager() + \endcode The main reasons for the need of this class is to provide a central place where the user can specify all his keyboard shortcuts, and to provide a solution for actions that should behave differently in different contexts (like the copy/replace/undo/redo actions). All actions that are registered with the same string id (but different context lists) - are considered to be overloads of the same command. The action that is visible to the user - is the one returned by ICommand::action(). (If you provide yourself a user visible - representation of your action be sure to always use ICommand::action() for this.) - If this action is invoked by the user, the signal is forwarded to the registered action that - is valid for the current context. + are considered to be overloads of the same command, represented by an instance + of the Command class. + The action that is visible to the user is the one returned by Command::action(). + If you provide yourself a user visible representation of your action you need + to use Command::action() for this. + When this action is invoked by the user, + the signal is forwarded to the registered action that is valid for the current context. - You use this class also to add items to registered - action containers like the applications menu bar. For this you register your action via the + So to register a globally active action "My Action" + put the following in your plugin's IPlugin::initialize method: + \code + Core::ActionManager *am = ExtensionSystem::PluginManager::instance() + ->getObject()->actionManager(); + QAction *myAction = new QAction(tr("My Action"), this); + Core::Command *cmd = am->registerAction(myAction, + "myplugin.myaction", + QList() << C_GLOBAL_ID); + cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+u"))); + connect(myAction, SIGNAL(triggered()), this, SLOT(performMyAction())); + \endcode + + So the \c connect is done to your own QAction instance. If you create e.g. + a tool button that should represent the action you add the action + from Command::action() to it: + \code + QToolButton *myButton = new QToolButton(someParentWidget); + myButton->setDefaultAction(cmd->action()); + \endcode + + Also use the ActionManager to add items to registered + action containers like the applications menu bar or menus in that menu bar. + To do this, you register your action via the registerAction methods, get the action container for a specific id (like specified in - Core::Constants) with a call of + the Core::Constants namespace) with a call of actionContainer(const QString&) and add your command to this container. - Guidelines: + Following the example adding "My Action" to the "Tools" menu would be done by + \code + am->actionContainer(Core::M_TOOLS)->addAction(cmd); + \endcode + + Important guidelines: \list \o Always register your actions and shortcuts! + \o Register your actions and shortcuts during your plugin's IPlugin::initialize + or IPlugin::extensionsInitialized methods, otherwise the shortcuts won't appear + in the keyboard settings dialog from the beginning. \o When registering an action with cmd=registerAction(action, id, contexts) be sure to connect your own action connect(action, SIGNAL...) but make cmd->action() visible to the user, i.e. widget->addAction(cmd->action()). \o Use this class to add actions to the applications menus \endlist - \sa Core::ICore, Core::ICommand - \sa Core::IActionContainer + \sa Core::ICore + \sa Core::Command + \sa Core::ActionContainer + \sa Core::IContext */ /*! - \fn virtual IActionContainer *ActionManagerInterface::createMenu(const QString &id) = 0 - ... + \fn ActionContainer *ActionManager::createMenu(const QString &id) + \brief Creates a new menu with the given string \a id. + + Returns a new ActionContainer that you can use to get the QMenu instance + or to add menu items to the menu. The ActionManager owns + the returned ActionContainer. + Add your menu to some other menu or a menu bar via the + ActionManager::actionContainer and ActionContainer::addMenu methods. */ /*! - \fn virtual IActionContainer *ActionManagerInterface::createMenuBar(const QString &id) = 0 - ... + \fn ActionContainer *ActionManager::createMenuBar(const QString &id) + \brief Creates a new menu bar with the given string \a id. + + Returns a new ActionContainer that you can use to get the QMenuBar instance + or to add menus to the menu bar. The ActionManager owns + the returned ActionContainer. */ /*! - \fn virtual ICommand *ActionManagerInterface::registerAction(QAction *action, const QString &id, const QList &context) = 0 - ... + \fn Command *ActionManager::registerAction(QAction *action, const QString &id, const QList &context) + \brief Makes an \a action known to the system under the specified string \a id. + + Returns a command object that represents the action in the application and is + owned by the ActionManager. You can registered several actions with the + same \a id as long as the \a context is different. In this case + a trigger of the actual action is forwarded to the registered QAction + for the currently active context. */ /*! - \fn virtual ICommand *ActionManagerInterface::registerShortcut(QShortcut *shortcut, const QString &id, const QList &context) = 0 - ... + \fn Command *ActionManager::registerShortcut(QShortcut *shortcut, const QString &id, const QList &context) + \brief Makes a \a shortcut known to the system under the specified string \a id. + + Returns a command object that represents the shortcut in the application and is + owned by the ActionManager. You can registered several shortcuts with the + same \a id as long as the \a context is different. In this case + a trigger of the actual shortcut is forwarded to the registered QShortcut + for the currently active context. */ /*! - \fn virtual ICommand *ActionManagerInterface::registerAction(QAction *action, const QString &id) = 0 - ... + \fn Command *ActionManager::command(const QString &id) const + \brief Returns the Command object that is known to the system + under the given string \a id. + + \sa ActionManager::registerAction() */ /*! - \fn virtual void ActionManagerInterface::addAction(ICommand *action, const QString &globalGroup) = 0 - ... -*/ + \fn ActionContainer *ActionManager::actionContainer(const QString &id) const + \brief Returns the IActionContainter object that is know to the system + under the given string \a id. -/*! - \fn virtual void ActionManagerInterface::addMenu(IActionContainer *menu, const QString &globalGroup) = 0 - ... + \sa ActionManager::createMenu() + \sa ActionManager::createMenuBar() */ - /*! - \fn virtual ICommand *ActionManagerInterface::command(const QString &id) const = 0 - ... + \fn ActionManager::ActionManager(QObject *parent) + \internal */ - /*! - \fn virtual IActionContainer *ActionManagerInterface::actionContainer(const QString &id) const = 0 - ... -*/ - -/*! - \fn virtual ActionManagerInterface::~ActionManagerInterface() - ... + \fn ActionManager::~ActionManager() + \internal */ using namespace Core; using namespace Core::Internal; -ActionManager* ActionManager::m_instance = 0; +ActionManagerPrivate* ActionManagerPrivate::m_instance = 0; /*! - \class ActionManager - \ingroup qwb - \inheaderfile actionmanager.h - - \sa ActionContainer + \class ActionManagerPrivate + \inheaderfile actionmanager_p.h + \internal */ -/*! - ... -*/ -ActionManager::ActionManager(MainWindow *mainWnd, UniqueIDManager *uidmgr) : - ActionManagerInterface(mainWnd), +ActionManagerPrivate::ActionManagerPrivate(MainWindow *mainWnd, UniqueIDManager *uidmgr) : + ActionManager(mainWnd), m_mainWnd(mainWnd) { m_defaultGroups << uidmgr->uniqueIdentifier(Constants::G_DEFAULT_ONE); @@ -170,73 +217,38 @@ ActionManager::ActionManager(MainWindow *mainWnd, UniqueIDManager *uidmgr) : } -/*! - ... -*/ -ActionManager::~ActionManager() +ActionManagerPrivate::~ActionManagerPrivate() { qDeleteAll(m_idCmdMap.values()); qDeleteAll(m_idContainerMap.values()); } -/*! - ... -*/ -ActionManager* ActionManager::instance() +ActionManagerPrivate* ActionManagerPrivate::instance() { return m_instance; } -/*! - ... -*/ -QList ActionManager::defaultGroups() const +QList ActionManagerPrivate::defaultGroups() const { return m_defaultGroups; } -/*! - ... -*/ -QList ActionManager::commands() const +QList ActionManagerPrivate::commands() const { return m_idCmdMap.values(); } -/*! - ... -*/ -QList ActionManager::containers() const +QList ActionManagerPrivate::containers() const { return m_idContainerMap.values(); } -/*! - ... -*/ -void ActionManager::registerGlobalGroup(int groupId, int containerId) -{ - if (m_globalgroups.contains(groupId)) { - qWarning() << "registerGlobalGroup: Global group " - << m_mainWnd->uniqueIDManager()->stringForUniqueIdentifier(groupId) - << " already registered"; - } else { - m_globalgroups.insert(groupId, containerId); - } -} - -/*! - ... -*/ -bool ActionManager::hasContext(int context) const +bool ActionManagerPrivate::hasContext(int context) const { return m_context.contains(context); } -/*! - ... -*/ -void ActionManager::setContext(const QList &context) +void ActionManagerPrivate::setContext(const QList &context) { // here are possibilities for speed optimization if necessary: // let commands (de-)register themselves for contexts @@ -251,10 +263,7 @@ void ActionManager::setContext(const QList &context) it.value()->update(); } -/*! - \internal -*/ -bool ActionManager::hasContext(QList context) const +bool ActionManagerPrivate::hasContext(QList context) const { for (int i=0; i context) const return false; } -/*! - ... -*/ -IActionContainer *ActionManager::createMenu(const QString &id) +ActionContainer *ActionManagerPrivate::createMenu(const QString &id) { const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id); const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid); @@ -284,10 +290,7 @@ IActionContainer *ActionManager::createMenu(const QString &id) return mc; } -/*! - ... -*/ -IActionContainer *ActionManager::createMenuBar(const QString &id) +ActionContainer *ActionManagerPrivate::createMenuBar(const QString &id) { const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id); const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid); @@ -305,36 +308,22 @@ IActionContainer *ActionManager::createMenuBar(const QString &id) return mbc; } -/*! - ... -*/ -ICommand *ActionManager::registerAction(QAction *action, const QString &id, const QList &context) +Command *ActionManagerPrivate::registerAction(QAction *action, const QString &id, const QList &context) { OverrideableAction *a = 0; - ICommand *c = registerOverridableAction(action, id, false); + Command *c = registerOverridableAction(action, id, false); a = static_cast(c); if (a) a->addOverrideAction(action, context); return a; } -/*! - ... -*/ -ICommand *ActionManager::registerAction(QAction *action, const QString &id) -{ - return registerOverridableAction(action, id, true); -} - -/*! - \internal -*/ -ICommand *ActionManager::registerOverridableAction(QAction *action, const QString &id, bool checkUnique) +Command *ActionManagerPrivate::registerOverridableAction(QAction *action, const QString &id, bool checkUnique) { OverrideableAction *a = 0; const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id); - if (Command *c = m_idCmdMap.value(uid, 0)) { - if (c->type() != ICommand::CT_OverridableAction) { + if (CommandPrivate *c = m_idCmdMap.value(uid, 0)) { + if (c->type() != Command::CT_OverridableAction) { qWarning() << "registerAction: id" << id << "is registered with a different command type."; return c; } @@ -375,15 +364,12 @@ ICommand *ActionManager::registerOverridableAction(QAction *action, const QStrin return a; } -/*! - ... -*/ -ICommand *ActionManager::registerShortcut(QShortcut *shortcut, const QString &id, const QList &context) +Command *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const QString &id, const QList &context) { Shortcut *sc = 0; int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id); - if (Command *c = m_idCmdMap.value(uid, 0)) { - if (c->type() != ICommand::CT_Shortcut) { + if (CommandPrivate *c = m_idCmdMap.value(uid, 0)) { + if (c->type() != Command::CT_Shortcut) { qWarning() << "registerShortcut: id" << id << "is registered with a different command type."; return c; } @@ -415,98 +401,47 @@ ICommand *ActionManager::registerShortcut(QShortcut *shortcut, const QString &id return sc; } -/*! - \fn void ActionManager::addAction(Core::ICommand *action, const QString &globalGroup) -*/ -void ActionManager::addAction(ICommand *action, const QString &globalGroup) -{ - const int gid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(globalGroup); - if (!m_globalgroups.contains(gid)) { - qWarning() << "addAction: Unknown global group " << globalGroup; - return; - } - - const int cid = m_globalgroups.value(gid); - if (IActionContainer *aci = actionContainer(cid)) { - aci->addAction(action, globalGroup); - } else { - qWarning() << "addAction: Cannot find container." << cid << '/' << gid; - } -} - -/*! - \fn void ActionManager::addMenu(Core::IActionContainer *menu, const QString &globalGroup) - -*/ -void ActionManager::addMenu(IActionContainer *menu, const QString &globalGroup) -{ - const int gid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(globalGroup); - if (!m_globalgroups.contains(gid)) { - qWarning() << "addAction: Unknown global group " << globalGroup; - return; - } - - const int cid = m_globalgroups.value(gid); - if (IActionContainer *aci = actionContainer(cid)) { - aci->addMenu(menu, globalGroup); - } else { - qWarning() << "addAction: Cannot find container." << cid << '/' << gid; - } -} - -/*! - ... -*/ -ICommand *ActionManager::command(const QString &id) const +Command *ActionManagerPrivate::command(const QString &id) const { const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id); const IdCmdMap::const_iterator it = m_idCmdMap.constFind(uid); if (it == m_idCmdMap.constEnd()) { if (warnAboutFindFailures) - qWarning() << "ActionManager::command(): failed to find :" << id << '/' << uid; + qWarning() << "ActionManagerPrivate::command(): failed to find :" << id << '/' << uid; return 0; } return it.value(); } -/*! - ... -*/ -IActionContainer *ActionManager::actionContainer(const QString &id) const +ActionContainer *ActionManagerPrivate::actionContainer(const QString &id) const { const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id); const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid); if ( it == m_idContainerMap.constEnd()) { if (warnAboutFindFailures) - qWarning() << "ActionManager::actionContainer(): failed to find :" << id << '/' << uid; + qWarning() << "ActionManagerPrivate::actionContainer(): failed to find :" << id << '/' << uid; return 0; } return it.value(); } -/*! - ... -*/ -ICommand *ActionManager::command(int uid) const +Command *ActionManagerPrivate::command(int uid) const { const IdCmdMap::const_iterator it = m_idCmdMap.constFind(uid); if (it == m_idCmdMap.constEnd()) { if (warnAboutFindFailures) - qWarning() << "ActionManager::command(): failed to find :" << m_mainWnd->uniqueIDManager()->stringForUniqueIdentifier(uid) << '/' << uid; + qWarning() << "ActionManagerPrivate::command(): failed to find :" << m_mainWnd->uniqueIDManager()->stringForUniqueIdentifier(uid) << '/' << uid; return 0; } return it.value(); } -/*! - ... -*/ -IActionContainer *ActionManager::actionContainer(int uid) const +ActionContainer *ActionManagerPrivate::actionContainer(int uid) const { const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid); if (it == m_idContainerMap.constEnd()) { if (warnAboutFindFailures) - qWarning() << "ActionManager::actionContainer(): failed to find :" << m_mainWnd->uniqueIDManager()->stringForUniqueIdentifier(uid) << uid; + qWarning() << "ActionManagerPrivate::actionContainer(): failed to find :" << m_mainWnd->uniqueIDManager()->stringForUniqueIdentifier(uid) << uid; return 0; } return it.value(); @@ -516,10 +451,7 @@ static const char *settingsGroup = "KeyBindings"; static const char *idKey = "ID"; static const char *sequenceKey = "Keysequence"; -/*! - \internal -*/ -void ActionManager::initialize() +void ActionManagerPrivate::initialize() { QSettings *settings = m_mainWnd->settings(); const int shortcuts = settings->beginReadArray(QLatin1String(settingsGroup)); @@ -529,17 +461,14 @@ void ActionManager::initialize() const QKeySequence key(settings->value(QLatin1String(sequenceKey)).toString()); const int id = m_mainWnd->uniqueIDManager()->uniqueIdentifier(sid); - ICommand *cmd = command(id); + Command *cmd = command(id); if (cmd) cmd->setKeySequence(key); } settings->endArray(); } -/*! - ... -*/ -void ActionManager::saveSettings(QSettings *settings) +void ActionManagerPrivate::saveSettings(QSettings *settings) { settings->beginWriteArray(QLatin1String(settingsGroup)); int count = 0; @@ -547,7 +476,7 @@ void ActionManager::saveSettings(QSettings *settings) const IdCmdMap::const_iterator cmdcend = m_idCmdMap.constEnd(); for (IdCmdMap::const_iterator j = m_idCmdMap.constBegin(); j != cmdcend; ++j) { const int id = j.key(); - Command *cmd = j.value(); + CommandPrivate *cmd = j.value(); QKeySequence key = cmd->keySequence(); if (key != cmd->defaultKeySequence()) { const QString sid = m_mainWnd->uniqueIDManager()->stringForUniqueIdentifier(id); diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.h b/src/plugins/coreplugin/actionmanager/actionmanager.h index dd5e2f61e92..8550aaf5d38 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager.h +++ b/src/plugins/coreplugin/actionmanager/actionmanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -34,97 +34,39 @@ #ifndef ACTIONMANAGER_H #define ACTIONMANAGER_H -#include +#include "coreplugin/core_global.h" -#include -#include -#include +#include +#include + +#include +#include QT_BEGIN_NAMESPACE -class QSettings; +class QAction; +class QShortcut; +class QString; QT_END_NAMESPACE -struct CommandLocation -{ - int m_container; - int m_position; -}; - namespace Core { -class UniqueIDManager; - -namespace Internal { - -class ActionContainer; -class MainWindow; -class Command; - -class ActionManager : public Core::ActionManagerInterface +class CORE_EXPORT ActionManager : public QObject { Q_OBJECT - public: - ActionManager(MainWindow *mainWnd, UniqueIDManager *uidmgr); - ~ActionManager(); + ActionManager(QObject *parent = 0) : QObject(parent) {} + virtual ~ActionManager() {} - void setContext(const QList &context); - static ActionManager* instance(); + virtual ActionContainer *createMenu(const QString &id) = 0; + virtual ActionContainer *createMenuBar(const QString &id) = 0; - void saveSettings(QSettings *settings); - QList defaultGroups() const; + virtual Command *registerAction(QAction *action, const QString &id, const QList &context) = 0; + virtual Command *registerShortcut(QShortcut *shortcut, const QString &id, const QList &context) = 0; - QList commands() const; - QList containers() const; - - bool hasContext(int context) const; - - ICommand *command(int uid) const; - IActionContainer *actionContainer(int uid) const; - - void registerGlobalGroup(int groupId, int containerId); - - void initialize(); - - //ActionManager Interface - IActionContainer *createMenu(const QString &id); - IActionContainer *createMenuBar(const QString &id); - - ICommand *registerAction(QAction *action, const QString &id, - const QList &context); - ICommand *registerAction(QAction *action, const QString &id); - ICommand *registerShortcut(QShortcut *shortcut, const QString &id, - const QList &context); - - void addAction(Core::ICommand *action, const QString &globalGroup); - void addMenu(Core::IActionContainer *menu, const QString &globalGroup); - - Core::ICommand *command(const QString &id) const; - Core::IActionContainer *actionContainer(const QString &id) const; - -private: - bool hasContext(QList context) const; - ICommand *registerOverridableAction(QAction *action, const QString &id, - bool checkUnique); - - static ActionManager* m_instance; - QList m_defaultGroups; - - typedef QHash IdCmdMap; - IdCmdMap m_idCmdMap; - - typedef QHash IdContainerMap; - IdContainerMap m_idContainerMap; - - typedef QMap GlobalGroupMap; - GlobalGroupMap m_globalgroups; - - QList m_context; - - MainWindow *m_mainWnd; + virtual Command *command(const QString &id) const = 0; + virtual ActionContainer *actionContainer(const QString &id) const = 0; }; -} // namespace Internal } // namespace Core #endif // ACTIONMANAGER_H diff --git a/src/plugins/coreplugin/actionmanager/actionmanager_p.h b/src/plugins/coreplugin/actionmanager/actionmanager_p.h new file mode 100644 index 00000000000..31513276ec1 --- /dev/null +++ b/src/plugins/coreplugin/actionmanager/actionmanager_p.h @@ -0,0 +1,124 @@ +/*************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** +** Non-Open Source Usage +** +** Licensees may use this file in accordance with the Qt Beta Version +** License Agreement, Agreement version 2.2 provided with the Software or, +** alternatively, in accordance with the terms contained in a written +** agreement between you and Nokia. +** +** GNU General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the packaging +** of this file. Please review the following information to ensure GNU +** General Public Licensing requirements will be met: +** +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt GPL Exception +** version 1.3, included in the file GPL_EXCEPTION.txt in this package. +** +***************************************************************************/ + +#ifndef ACTIONMANAGERPRIVATE_H +#define ACTIONMANAGERPRIVATE_H + +#include + +#include +#include +#include + +QT_BEGIN_NAMESPACE +class QSettings; +QT_END_NAMESPACE + +struct CommandLocation +{ + int m_container; + int m_position; +}; + +namespace Core { + +class UniqueIDManager; + +namespace Internal { + +class ActionContainerPrivate; +class MainWindow; +class CommandPrivate; + +class ActionManagerPrivate : public Core::ActionManager +{ + Q_OBJECT + +public: + ActionManagerPrivate(MainWindow *mainWnd, UniqueIDManager *uidmgr); + ~ActionManagerPrivate(); + + void setContext(const QList &context); + static ActionManagerPrivate* instance(); + + void saveSettings(QSettings *settings); + QList defaultGroups() const; + + QList commands() const; + QList containers() const; + + bool hasContext(int context) const; + + Command *command(int uid) const; + ActionContainer *actionContainer(int uid) const; + + void initialize(); + + //ActionManager Interface + ActionContainer *createMenu(const QString &id); + ActionContainer *createMenuBar(const QString &id); + + Command *registerAction(QAction *action, const QString &id, + const QList &context); + Command *registerShortcut(QShortcut *shortcut, const QString &id, + const QList &context); + + Core::Command *command(const QString &id) const; + Core::ActionContainer *actionContainer(const QString &id) const; + +private: + bool hasContext(QList context) const; + Command *registerOverridableAction(QAction *action, const QString &id, + bool checkUnique); + + static ActionManagerPrivate* m_instance; + QList m_defaultGroups; + + typedef QHash IdCmdMap; + IdCmdMap m_idCmdMap; + + typedef QHash IdContainerMap; + IdContainerMap m_idContainerMap; + +// typedef QMap GlobalGroupMap; +// GlobalGroupMap m_globalgroups; +// + QList m_context; + + MainWindow *m_mainWnd; +}; + +} // namespace Internal +} // namespace Core + +#endif // ACTIONMANAGERPRIVATE_H diff --git a/src/plugins/coreplugin/actionmanager/actionmanagerinterface.h b/src/plugins/coreplugin/actionmanager/actionmanagerinterface.h deleted file mode 100644 index f77e9ca484c..00000000000 --- a/src/plugins/coreplugin/actionmanager/actionmanagerinterface.h +++ /dev/null @@ -1,77 +0,0 @@ -/*************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Qt Software Information (qt-info@nokia.com) -** -** -** Non-Open Source Usage -** -** Licensees may use this file in accordance with the Qt Beta Version -** License Agreement, Agreement version 2.2 provided with the Software or, -** alternatively, in accordance with the terms contained in a written -** agreement between you and Nokia. -** -** GNU General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the packaging -** of this file. Please review the following information to ensure GNU -** General Public Licensing requirements will be met: -** -** http://www.fsf.org/licensing/licenses/info/GPLv2.html and -** http://www.gnu.org/copyleft/gpl.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt GPL Exception -** version 1.3, included in the file GPL_EXCEPTION.txt in this package. -** -***************************************************************************/ - -#ifndef ACTIONMANAGERINTERFACE_H -#define ACTIONMANAGERINTERFACE_H - -#include "coreplugin/core_global.h" - -#include -#include - -#include -#include - -QT_BEGIN_NAMESPACE -class QAction; -class QShortcut; -class QString; -QT_END_NAMESPACE - -namespace Core { - -class CORE_EXPORT ActionManagerInterface : public QObject -{ - Q_OBJECT -public: - ActionManagerInterface(QObject *parent = 0) : QObject(parent) {} - virtual ~ActionManagerInterface() {} - - virtual IActionContainer *createMenu(const QString &id) = 0; - virtual IActionContainer *createMenuBar(const QString &id) = 0; - - virtual ICommand *registerAction(QAction *action, const QString &id, const QList &context) = 0; - virtual ICommand *registerShortcut(QShortcut *shortcut, const QString &id, const QList &context) = 0; - - virtual ICommand *registerAction(QAction *action, const QString &id) = 0; - - virtual void addAction(ICommand *action, const QString &globalGroup) = 0; - virtual void addMenu(IActionContainer *menu, const QString &globalGroup) = 0; - - virtual ICommand *command(const QString &id) const = 0; - virtual IActionContainer *actionContainer(const QString &id) const = 0; -}; - -} // namespace Core - -#endif // ACTIONMANAGERINTERFACE_H diff --git a/src/plugins/coreplugin/actionmanager/command.cpp b/src/plugins/coreplugin/actionmanager/command.cpp index d5370e4ffee..21056cfc5dd 100644 --- a/src/plugins/coreplugin/actionmanager/command.cpp +++ b/src/plugins/coreplugin/actionmanager/command.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -35,13 +35,12 @@ #include #include -#include "command.h" +#include "command_p.h" /*! - \class Core::ICommand + \class Core::Command \mainclass \ingroup qwb - \inheaderfile icommand.h \brief The class... @@ -49,226 +48,167 @@ */ /*! - \enum ICommand::CommandType + \enum Command::CommandType */ /*! - \enum ICommand::CommandAttribute + \enum Command::CommandAttribute */ /*! - \fn void ICommand::setCategory(const QString &name) + \fn void Command::setCategory(const QString &name) Sets the category to \a name. */ /*! - \fn virtual void ICommand::setDefaultKeySequence(const QKeySequence &key) + \fn virtual void Command::setDefaultKeySequence(const QKeySequence &key) */ /*! - \fn virtual int ICommand::id() const + \fn virtual int Command::id() const */ /*! - \fn virtual CommandType ICommand::type() const + \fn virtual CommandType Command::type() const */ /*! - \fn virtual QAction *ICommand::action() const + \fn virtual QAction *Command::action() const */ /*! - \fn virtual QShortcut *ICommand::shortcut() const + \fn virtual QShortcut *Command::shortcut() const */ /*! - \fn virtual void ICommand::setAttribute(CommandAttribute attr) + \fn virtual void Command::setAttribute(CommandAttribute attr) */ /*! - \fn virtual void ICommand::removeAttribute(CommandAttribute attr) + \fn virtual void Command::removeAttribute(CommandAttribute attr) */ /*! - \fn virtual bool ICommand::hasAttribute(CommandAttribute attr) const + \fn virtual bool Command::hasAttribute(CommandAttribute attr) const */ /*! - \fn virtual bool ICommand::isActive() const + \fn virtual bool Command::isActive() const */ -/*! - \fn virtual ICommand::~ICommand() -*/ - -using namespace Core::Internal; - -/*! - \class Command - \ingroup qwb - \inheaderfile command.h -*/ - -/*! - \enum Command::CommandState -*/ - -/*! - \fn Command::Command(CommandType type, int id) -*/ -Command::Command(CommandType type, int id) - : m_type(type), m_id(id) -{ -} - /*! \fn virtual Command::~Command() */ +using namespace Core::Internal; + /*! - ... + \class CommandPrivate + \inheaderfile command_p.h + \internal */ -void Command::setStateFlags(int state) + +CommandPrivate::CommandPrivate(CommandType type, int id) + : m_type(type), m_id(id) +{ +} + +void CommandPrivate::setStateFlags(int state) { m_type |= (state & CS_Mask); } -/*! - ... -*/ -int Command::stateFlags() const +int CommandPrivate::stateFlags() const { return (m_type & CS_Mask); } -/*! - \fn virtual QString Command::name() const -*/ - -/*! - ... -*/ -void Command::setCategory(const QString &name) +void CommandPrivate::setCategory(const QString &name) { m_category = name; } -/*! - ... -*/ -QString Command::category() const +QString CommandPrivate::category() const { if (m_category.isEmpty()) return QObject::tr("Other"); return m_category; } -/*! - ... -*/ -void Command::setDefaultKeySequence(const QKeySequence &key) +void CommandPrivate::setDefaultKeySequence(const QKeySequence &key) { m_defaultKey = key; } -/*! - ... -*/ -QKeySequence Command::defaultKeySequence() const +QKeySequence CommandPrivate::defaultKeySequence() const { return m_defaultKey; } -void Command::setDefaultText(const QString &text) +void CommandPrivate::setDefaultText(const QString &text) { m_defaultText = text; } -QString Command::defaultText() const +QString CommandPrivate::defaultText() const { return m_defaultText; } -/*! - ... -*/ -int Command::id() const +int CommandPrivate::id() const { return m_id; } -/*! - ... -*/ -Command::CommandType Command::type() const +CommandPrivate::CommandType CommandPrivate::type() const { return (CommandType)(m_type & CT_Mask); } -/*! - ... -*/ -QAction *Command::action() const +QAction *CommandPrivate::action() const { return 0; } -/*! - ... -*/ -QShortcut *Command::shortcut() const +QShortcut *CommandPrivate::shortcut() const { return 0; } -/*! - ... -*/ -void Command::setAttribute(CommandAttribute attr) +void CommandPrivate::setAttribute(CommandAttribute attr) { m_type |= attr; } -/*! - ... -*/ -void Command::removeAttribute(CommandAttribute attr) +void CommandPrivate::removeAttribute(CommandAttribute attr) { m_type &= ~attr; } -/*! - ... -*/ -bool Command::hasAttribute(CommandAttribute attr) const +bool CommandPrivate::hasAttribute(CommandAttribute attr) const { return (m_type & attr); } -QString Command::stringWithAppendedShortcut(const QString &str) const +QString CommandPrivate::stringWithAppendedShortcut(const QString &str) const { return QString("%1 %2").arg(str).arg( keySequence().toString(QKeySequence::NativeText)); } -/*! - \fn virtual bool Command::setCurrentContext(const QList &context) = 0 -*/ - // ---------- Shortcut ------------ /*! \class Shortcut \ingroup qwb - \inheaderfile command.h */ /*! ... */ Shortcut::Shortcut(int id) - : Command(CT_Shortcut, id), m_shortcut(0) + : CommandPrivate(CT_Shortcut, id), m_shortcut(0) { } @@ -322,7 +262,7 @@ QList Shortcut::context() const void Shortcut::setDefaultKeySequence(const QKeySequence &key) { setKeySequence(key); - Command::setDefaultKeySequence(key); + CommandPrivate::setDefaultKeySequence(key); } void Shortcut::setKeySequence(const QKeySequence &key) @@ -374,14 +314,13 @@ bool Shortcut::isActive() const /*! \class Action \ingroup qwb - \inheaderfile command.h */ /*! ... */ Action::Action(CommandType type, int id) - : Command(type, id), m_action(0) + : CommandPrivate(type, id), m_action(0) { } @@ -439,7 +378,7 @@ QList Action::locations() const void Action::setDefaultKeySequence(const QKeySequence &key) { setKeySequence(key); - Command::setDefaultKeySequence(key); + CommandPrivate::setDefaultKeySequence(key); } void Action::setKeySequence(const QKeySequence &key) @@ -467,7 +406,6 @@ QKeySequence Action::keySequence() const /*! \class OverrideableAction \ingroup qwb - \inheaderfile command.h */ /*! diff --git a/src/plugins/coreplugin/actionmanager/command.h b/src/plugins/coreplugin/actionmanager/command.h index 848114c8b96..53342555d13 100644 --- a/src/plugins/coreplugin/actionmanager/command.h +++ b/src/plugins/coreplugin/actionmanager/command.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -34,146 +34,61 @@ #ifndef COMMAND_H #define COMMAND_H -#include "icommand.h" -#include "actionmanager.h" +#include -#include -#include -#include +#include +#include #include namespace Core { -namespace Internal { -class Command : public Core::ICommand +class CORE_EXPORT Command : public QObject { Q_OBJECT public: - enum CommandState { - CS_PreLocation = 0x020000, - CS_LocationChanged = 0x040000, - CS_Initialized = 0x080000, - CS_Mask = 0xFF0000 + enum CommandType { + CT_Shortcut = 0x0001, + CT_OverridableAction = 0x0002, + CT_Mask = 0x00FF }; - Command(CommandType type, int id); + enum CommandAttribute { + CA_Hide = 0x0100, + CA_UpdateText = 0x0200, + CA_UpdateIcon = 0x0400, + CA_NonConfigureable = 0x8000, + CA_Mask = 0xFF00 + }; + + virtual void setDefaultKeySequence(const QKeySequence &key) = 0; + virtual void setKeySequence(const QKeySequence &key) = 0; + virtual QKeySequence defaultKeySequence() const = 0; + virtual QKeySequence keySequence() const = 0; + virtual void setDefaultText(const QString &text) = 0; + virtual QString defaultText() const = 0; + + virtual void setCategory(const QString &name) = 0; + + virtual int id() const = 0; + virtual CommandType type() const = 0; + + virtual QAction *action() const = 0; + virtual QShortcut *shortcut() const = 0; + + virtual void setAttribute(CommandAttribute attr) = 0; + virtual void removeAttribute(CommandAttribute attr) = 0; + virtual bool hasAttribute(CommandAttribute attr) const = 0; + + virtual bool isActive() const = 0; + virtual ~Command() {} - void setStateFlags(int state); - int stateFlags() const; + virtual QString stringWithAppendedShortcut(const QString &str) const = 0; - virtual QString name() const = 0; - - void setCategory(const QString &name); - QString category() const; - - void setDefaultKeySequence(const QKeySequence &key); - QKeySequence defaultKeySequence() const; - - void setDefaultText(const QString &text); - QString defaultText() const; - - int id() const; - CommandType type() const; - - QAction *action() const; - QShortcut *shortcut() const; - - void setAttribute(CommandAttribute attr); - void removeAttribute(CommandAttribute attr); - bool hasAttribute(CommandAttribute attr) const; - - virtual bool setCurrentContext(const QList &context) = 0; - - QString stringWithAppendedShortcut(const QString &str) const; - -protected: - QString m_category; - int m_type; - int m_id; - QKeySequence m_defaultKey; - QString m_defaultText; +signals: + void keySequenceChanged(); }; -class Shortcut : public Command -{ - Q_OBJECT -public: - Shortcut(int id); - - QString name() const; - - void setDefaultKeySequence(const QKeySequence &key); - void setKeySequence(const QKeySequence &key); - QKeySequence keySequence() const; - - virtual void setDefaultText(const QString &key); - virtual QString defaultText() const; - - void setShortcut(QShortcut *shortcut); - QShortcut *shortcut() const; - - void setContext(const QList &context); - QList context() const; - bool setCurrentContext(const QList &context); - - bool isActive() const; -private: - QList m_context; - QShortcut *m_shortcut; - QString m_defaultText; -}; - -class Action : public Command -{ - Q_OBJECT -public: - Action(CommandType type, int id); - - QString name() const; - - void setDefaultKeySequence(const QKeySequence &key); - void setKeySequence(const QKeySequence &key); - QKeySequence keySequence() const; - - virtual void setAction(QAction *action); - QAction *action() const; - - void setLocations(const QList &locations); - QList locations() const; - -protected: - void updateToolTipWithKeySequence(); - - QAction *m_action; - QList m_locations; - QString m_toolTip; -}; - -class OverrideableAction : public Action -{ - Q_OBJECT - -public: - OverrideableAction(int id); - - void setAction(QAction *action); - bool setCurrentContext(const QList &context); - void addOverrideAction(QAction *action, const QList &context); - bool isActive() const; - -private slots: - void actionChanged(); - -private: - QPointer m_currentAction; - QList m_context; - QMap > m_contextActionMap; - bool m_active; - bool m_contextInitialized; -}; - -} // namespace Internal } // namespace Core #endif // COMMAND_H diff --git a/src/plugins/coreplugin/actionmanager/command_p.h b/src/plugins/coreplugin/actionmanager/command_p.h new file mode 100644 index 00000000000..c41053bb55e --- /dev/null +++ b/src/plugins/coreplugin/actionmanager/command_p.h @@ -0,0 +1,179 @@ +/*************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** +** Non-Open Source Usage +** +** Licensees may use this file in accordance with the Qt Beta Version +** License Agreement, Agreement version 2.2 provided with the Software or, +** alternatively, in accordance with the terms contained in a written +** agreement between you and Nokia. +** +** GNU General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the packaging +** of this file. Please review the following information to ensure GNU +** General Public Licensing requirements will be met: +** +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt GPL Exception +** version 1.3, included in the file GPL_EXCEPTION.txt in this package. +** +***************************************************************************/ + +#ifndef COMMAND_P_H +#define COMMAND_P_H + +#include "command.h" +#include "actionmanager_p.h" + +#include +#include +#include +#include + +namespace Core { +namespace Internal { + +class CommandPrivate : public Core::Command +{ + Q_OBJECT +public: + enum CommandState { + CS_PreLocation = 0x020000, + CS_LocationChanged = 0x040000, + CS_Initialized = 0x080000, + CS_Mask = 0xFF0000 + }; + + CommandPrivate(CommandType type, int id); + virtual ~CommandPrivate() {} + + void setStateFlags(int state); + int stateFlags() const; + + virtual QString name() const = 0; + + void setCategory(const QString &name); + QString category() const; + + void setDefaultKeySequence(const QKeySequence &key); + QKeySequence defaultKeySequence() const; + + void setDefaultText(const QString &text); + QString defaultText() const; + + int id() const; + CommandType type() const; + + QAction *action() const; + QShortcut *shortcut() const; + + void setAttribute(CommandAttribute attr); + void removeAttribute(CommandAttribute attr); + bool hasAttribute(CommandAttribute attr) const; + + virtual bool setCurrentContext(const QList &context) = 0; + + QString stringWithAppendedShortcut(const QString &str) const; + +protected: + QString m_category; + int m_type; + int m_id; + QKeySequence m_defaultKey; + QString m_defaultText; +}; + +class Shortcut : public CommandPrivate +{ + Q_OBJECT +public: + Shortcut(int id); + + QString name() const; + + void setDefaultKeySequence(const QKeySequence &key); + void setKeySequence(const QKeySequence &key); + QKeySequence keySequence() const; + + virtual void setDefaultText(const QString &key); + virtual QString defaultText() const; + + void setShortcut(QShortcut *shortcut); + QShortcut *shortcut() const; + + void setContext(const QList &context); + QList context() const; + bool setCurrentContext(const QList &context); + + bool isActive() const; +private: + QList m_context; + QShortcut *m_shortcut; + QString m_defaultText; +}; + +class Action : public CommandPrivate +{ + Q_OBJECT +public: + Action(CommandType type, int id); + + QString name() const; + + void setDefaultKeySequence(const QKeySequence &key); + void setKeySequence(const QKeySequence &key); + QKeySequence keySequence() const; + + virtual void setAction(QAction *action); + QAction *action() const; + + void setLocations(const QList &locations); + QList locations() const; + +protected: + void updateToolTipWithKeySequence(); + + QAction *m_action; + QList m_locations; + QString m_toolTip; +}; + +class OverrideableAction : public Action +{ + Q_OBJECT + +public: + OverrideableAction(int id); + + void setAction(QAction *action); + bool setCurrentContext(const QList &context); + void addOverrideAction(QAction *action, const QList &context); + bool isActive() const; + +private slots: + void actionChanged(); + +private: + QPointer m_currentAction; + QList m_context; + QMap > m_contextActionMap; + bool m_active; + bool m_contextInitialized; +}; + +} // namespace Internal +} // namespace Core + +#endif // COMMAND_P_H diff --git a/src/plugins/coreplugin/actionmanager/commandsfile.cpp b/src/plugins/coreplugin/actionmanager/commandsfile.cpp index 99602efaa85..abdecf43660 100644 --- a/src/plugins/coreplugin/actionmanager/commandsfile.cpp +++ b/src/plugins/coreplugin/actionmanager/commandsfile.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -34,7 +34,7 @@ #include "coreimpl.h" #include "commandsfile.h" #include "shortcutsettings.h" -#include "command.h" +#include "command_p.h" #include diff --git a/src/plugins/coreplugin/actionmanager/commandsfile.h b/src/plugins/coreplugin/actionmanager/commandsfile.h index 7c515a32c26..79eeaed6311 100644 --- a/src/plugins/coreplugin/actionmanager/commandsfile.h +++ b/src/plugins/coreplugin/actionmanager/commandsfile.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/actionmanager/iactioncontainer.h b/src/plugins/coreplugin/actionmanager/iactioncontainer.h deleted file mode 100644 index ad510393521..00000000000 --- a/src/plugins/coreplugin/actionmanager/iactioncontainer.h +++ /dev/null @@ -1,83 +0,0 @@ -/*************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Qt Software Information (qt-info@nokia.com) -** -** -** Non-Open Source Usage -** -** Licensees may use this file in accordance with the Qt Beta Version -** License Agreement, Agreement version 2.2 provided with the Software or, -** alternatively, in accordance with the terms contained in a written -** agreement between you and Nokia. -** -** GNU General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the packaging -** of this file. Please review the following information to ensure GNU -** General Public Licensing requirements will be met: -** -** http://www.fsf.org/licensing/licenses/info/GPLv2.html and -** http://www.gnu.org/copyleft/gpl.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt GPL Exception -** version 1.3, included in the file GPL_EXCEPTION.txt in this package. -** -***************************************************************************/ - -#ifndef IACTIONCONTAINER_H -#define IACTIONCONTAINER_H - -#include -#include -#include -#include -#include - -namespace Core { - -class ICommand; - -class IActionContainer : public QObject -{ -public: - enum ContainerType { - CT_Mask = 0xFF, - CT_Menu = 0x01, - CT_ToolBar = 0x02 - }; - - enum EmptyAction { - EA_Mask = 0xFF00, - EA_None = 0x0100, - EA_Hide = 0x0200, - EA_Disable = 0x0300 - }; - - virtual void setEmptyAction(EmptyAction ea) = 0; - - virtual int id() const = 0; - virtual ContainerType type() const = 0; - - virtual QMenu *menu() const = 0; - virtual QToolBar *toolBar() const = 0; - virtual QMenuBar *menuBar() const = 0; - - virtual QAction *insertLocation(const QString &group) const = 0; - virtual void appendGroup(const QString &group, bool global = false) = 0; - virtual void addAction(Core::ICommand *action, const QString &group = QString()) = 0; - virtual void addMenu(Core::IActionContainer *menu, const QString &group = QString()) = 0; - - virtual bool update() = 0; - virtual ~IActionContainer() {} -}; - -} // namespace Core - -#endif // IACTIONCONTAINER_H diff --git a/src/plugins/coreplugin/actionmanager/icommand.h b/src/plugins/coreplugin/actionmanager/icommand.h deleted file mode 100644 index 7ab5145b74a..00000000000 --- a/src/plugins/coreplugin/actionmanager/icommand.h +++ /dev/null @@ -1,94 +0,0 @@ -/*************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Qt Software Information (qt-info@nokia.com) -** -** -** Non-Open Source Usage -** -** Licensees may use this file in accordance with the Qt Beta Version -** License Agreement, Agreement version 2.2 provided with the Software or, -** alternatively, in accordance with the terms contained in a written -** agreement between you and Nokia. -** -** GNU General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the packaging -** of this file. Please review the following information to ensure GNU -** General Public Licensing requirements will be met: -** -** http://www.fsf.org/licensing/licenses/info/GPLv2.html and -** http://www.gnu.org/copyleft/gpl.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt GPL Exception -** version 1.3, included in the file GPL_EXCEPTION.txt in this package. -** -***************************************************************************/ - -#ifndef ICOMMAND_H -#define ICOMMAND_H - -#include - -#include -#include -#include - -namespace Core { - -class CORE_EXPORT ICommand : public QObject -{ - Q_OBJECT -public: - enum CommandType { - CT_Shortcut = 0x0001, - CT_OverridableAction = 0x0002, - CT_Mask = 0x00FF - }; - - enum CommandAttribute { - CA_Hide = 0x0100, - CA_UpdateText = 0x0200, - CA_UpdateIcon = 0x0400, - CA_NonConfigureable = 0x8000, - CA_Mask = 0xFF00 - }; - - virtual void setDefaultKeySequence(const QKeySequence &key) = 0; - virtual void setKeySequence(const QKeySequence &key) = 0; - virtual QKeySequence defaultKeySequence() const = 0; - virtual QKeySequence keySequence() const = 0; - virtual void setDefaultText(const QString &text) = 0; - virtual QString defaultText() const = 0; - - virtual void setCategory(const QString &name) = 0; - - virtual int id() const = 0; - virtual CommandType type() const = 0; - - virtual QAction *action() const = 0; - virtual QShortcut *shortcut() const = 0; - - virtual void setAttribute(CommandAttribute attr) = 0; - virtual void removeAttribute(CommandAttribute attr) = 0; - virtual bool hasAttribute(CommandAttribute attr) const = 0; - - virtual bool isActive() const = 0; - - virtual ~ICommand() {} - - virtual QString stringWithAppendedShortcut(const QString &str) const = 0; - -signals: - void keySequenceChanged(); -}; - -} // namespace Core - -#endif // ICOMMAND_H diff --git a/src/plugins/coreplugin/basefilewizard.cpp b/src/plugins/coreplugin/basefilewizard.cpp index 468c76a0dc6..aad82af6677 100644 --- a/src/plugins/coreplugin/basefilewizard.cpp +++ b/src/plugins/coreplugin/basefilewizard.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/basefilewizard.h b/src/plugins/coreplugin/basefilewizard.h index d530b728aa5..40e98793cb9 100644 --- a/src/plugins/coreplugin/basefilewizard.h +++ b/src/plugins/coreplugin/basefilewizard.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/basemode.cpp b/src/plugins/coreplugin/basemode.cpp index 1a428aa4df7..ea2d202fc24 100644 --- a/src/plugins/coreplugin/basemode.cpp +++ b/src/plugins/coreplugin/basemode.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -82,38 +82,6 @@ BaseMode::BaseMode(QObject *parent): { } -/*! - \fn BaseMode::BaseMode(const QString &name, - const char * uniqueModeName, - const QIcon &icon, - int priority, - QWidget *widget, - QObject *parent) - - Creates a mode with the given properties. - - \a name - \a uniqueModeName - \a icon - \a priority - \a widget - \a parent -*/ -BaseMode::BaseMode(const QString &name, - const char * uniqueModeName, - const QIcon &icon, - int priority, - QWidget *widget, - QObject *parent): - IMode(parent), - m_name(name), - m_icon(icon), - m_priority(priority), - m_widget(widget), - m_uniqueModeName(uniqueModeName) -{ -} - /*! \fn BaseMode::~BaseMode() */ diff --git a/src/plugins/coreplugin/basemode.h b/src/plugins/coreplugin/basemode.h index c6fea7d4807..bca1f24347b 100644 --- a/src/plugins/coreplugin/basemode.h +++ b/src/plugins/coreplugin/basemode.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -49,12 +49,6 @@ class CORE_EXPORT BaseMode public: BaseMode(QObject *parent = 0); - BaseMode(const QString &name, - const char * uniqueModeName, - const QIcon &icon, - int priority, - QWidget *widget, - QObject *parent = 0); ~BaseMode(); // IMode diff --git a/src/plugins/coreplugin/baseview.cpp b/src/plugins/coreplugin/baseview.cpp index 5367062d371..f3dd93f5155 100644 --- a/src/plugins/coreplugin/baseview.cpp +++ b/src/plugins/coreplugin/baseview.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/baseview.h b/src/plugins/coreplugin/baseview.h index 0312de6613b..a39e4dc8ca2 100644 --- a/src/plugins/coreplugin/baseview.h +++ b/src/plugins/coreplugin/baseview.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/core_global.h b/src/plugins/coreplugin/core_global.h index 630b660c0c9..6fe5d150107 100644 --- a/src/plugins/coreplugin/core_global.h +++ b/src/plugins/coreplugin/core_global.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/coreconstants.h b/src/plugins/coreplugin/coreconstants.h index dd8155db820..8dd7d9c588d 100644 --- a/src/plugins/coreplugin/coreconstants.h +++ b/src/plugins/coreplugin/coreconstants.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/coreimpl.cpp b/src/plugins/coreplugin/coreimpl.cpp index 7a7eca4044f..68653b52fc7 100644 --- a/src/plugins/coreplugin/coreimpl.cpp +++ b/src/plugins/coreplugin/coreimpl.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -64,7 +64,7 @@ void CoreImpl::showOptionsDialog(const QString &group, const QString &page) m_mainwindow->showOptionsDialog(group, page); } -ActionManagerInterface *CoreImpl::actionManager() const +ActionManager *CoreImpl::actionManager() const { return m_mainwindow->actionManager(); } @@ -84,11 +84,6 @@ MessageManager *CoreImpl::messageManager() const return m_mainwindow->messageManager(); } -ViewManagerInterface *CoreImpl::viewManager() const -{ - return m_mainwindow->viewManager(); -} - ExtensionSystem::PluginManager *CoreImpl::pluginManager() const { return m_mainwindow->pluginManager(); @@ -99,12 +94,12 @@ EditorManager *CoreImpl::editorManager() const return m_mainwindow->editorManager(); } -ProgressManagerInterface *CoreImpl::progressManager() const +ProgressManager *CoreImpl::progressManager() const { return m_mainwindow->progressManager(); } -ScriptManagerInterface *CoreImpl::scriptManager() const +ScriptManager *CoreImpl::scriptManager() const { return m_mainwindow->scriptManager(); } @@ -148,15 +143,6 @@ QString CoreImpl::resourcePath() const #endif } -QString CoreImpl::libraryPath() const -{ -#if defined(Q_OS_MAC) - return QDir::cleanPath(QCoreApplication::applicationDirPath()+QLatin1String("/../PlugIns")); -#else - return QDir::cleanPath(QCoreApplication::applicationDirPath()+QLatin1String("/../lib")); -#endif -} - IContext *CoreImpl::currentContextObject() const { return m_mainwindow->currentContextObject(); @@ -168,12 +154,6 @@ QMainWindow *CoreImpl::mainWindow() const return m_mainwindow; } -QStatusBar *CoreImpl::statusBar() const -{ - return m_mainwindow->statusBar(); -} - - // adds and removes additional active contexts, this context is appended to the // currently active contexts. call updateContext after changing void CoreImpl::addAdditionalContext(int context) diff --git a/src/plugins/coreplugin/coreimpl.h b/src/plugins/coreplugin/coreimpl.h index 5380b9bdaf3..b09de4101f6 100644 --- a/src/plugins/coreplugin/coreimpl.h +++ b/src/plugins/coreplugin/coreimpl.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -56,15 +56,14 @@ public: void showOptionsDialog(const QString &group = QString(), const QString &page = QString()); - ActionManagerInterface *actionManager() const; + ActionManager *actionManager() const; FileManager *fileManager() const ; UniqueIDManager *uniqueIDManager() const; MessageManager *messageManager() const; - ViewManagerInterface *viewManager() const; ExtensionSystem::PluginManager *pluginManager() const; EditorManager *editorManager() const; - ProgressManagerInterface *progressManager() const; - ScriptManagerInterface *scriptManager() const; + ProgressManager *progressManager() const; + ScriptManager *scriptManager() const; VariableManager *variableManager() const; VCSManager *vcsManager() const; ModeManager *modeManager() const; @@ -74,12 +73,10 @@ public: QPrinter *printer() const; QString resourcePath() const; - QString libraryPath() const; IContext *currentContextObject() const; QMainWindow *mainWindow() const; - QStatusBar *statusBar() const; // adds and removes additional active contexts, this context is appended to the // currently active contexts. call updateContext after changing diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index 9a426dbeadc..4b18570037a 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -37,7 +37,6 @@ #include "editormanager.h" #include "mainwindow.h" #include "modemanager.h" -#include "viewmanager.h" #include "fileiconprovider.h" #include diff --git a/src/plugins/coreplugin/coreplugin.h b/src/plugins/coreplugin/coreplugin.h index a8341c97e90..020f407829a 100644 --- a/src/plugins/coreplugin/coreplugin.h +++ b/src/plugins/coreplugin/coreplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/coreplugin.pri b/src/plugins/coreplugin/coreplugin.pri index c2b2a3fa2cf..fc5fc7aae61 100644 --- a/src/plugins/coreplugin/coreplugin.pri +++ b/src/plugins/coreplugin/coreplugin.pri @@ -1,3 +1,2 @@ include(coreplugin_dependencies.pri) - LIBS *= -l$$qtLibraryTarget(Core) diff --git a/src/plugins/coreplugin/coreplugin.pro b/src/plugins/coreplugin/coreplugin.pro index 80056b3b2e5..7ba648c1619 100644 --- a/src/plugins/coreplugin/coreplugin.pro +++ b/src/plugins/coreplugin/coreplugin.pro @@ -73,7 +73,8 @@ SOURCES += mainwindow.cpp \ rightpane.cpp \ sidebar.cpp \ fileiconprovider.cpp \ - mimedatabase.cpp + mimedatabase.cpp \ + icore.cpp HEADERS += mainwindow.h \ welcomemode.h \ editmode.h \ @@ -97,12 +98,12 @@ HEADERS += mainwindow.h \ editormanager/openeditorswindow.h \ editormanager/ieditor.h \ editormanager/ieditorfactory.h \ - actionmanager/iactioncontainer.h \ - actionmanager/actionmanagerinterface.h \ - actionmanager/icommand.h \ + actionmanager/actioncontainer.h \ actionmanager/actionmanager.h \ actionmanager/command.h \ - actionmanager/actioncontainer.h \ + actionmanager/actionmanager_p.h \ + actionmanager/command_p.h \ + actionmanager/actioncontainer_p.h \ actionmanager/commandsfile.h \ dialogs/saveitemsdialog.h \ dialogs/newdialog.h \ @@ -111,11 +112,11 @@ HEADERS += mainwindow.h \ dialogs/openwithdialog.h \ dialogs/iwizard.h \ dialogs/ioptionspage.h \ - progressmanager/progressmanager.h \ + progressmanager/progressmanager_p.h \ progressmanager/progressview.h \ progressmanager/progresspie.h \ progressmanager/futureprogress.h \ - progressmanager/progressmanagerinterface.h \ + progressmanager/progressmanager.h \ icontext.h \ icore.h \ ifile.h \ @@ -131,8 +132,8 @@ HEADERS += mainwindow.h \ versiondialog.h \ scriptmanager/metatypedeclarations.h \ scriptmanager/qworkbench_wrapper.h \ - scriptmanager/scriptmanagerinterface.h \ scriptmanager/scriptmanager.h \ + scriptmanager/scriptmanager_p.h \ core_global.h \ basemode.h \ baseview.h \ diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.h b/src/plugins/coreplugin/dialogs/ioptionspage.h index df38e3562a6..f00c14ef9f0 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.h +++ b/src/plugins/coreplugin/dialogs/ioptionspage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -54,7 +54,8 @@ public: virtual QString trCategory() const = 0; virtual QWidget *createPage(QWidget *parent) = 0; - virtual void finished(bool accepted) = 0; + virtual void apply() = 0; + virtual void finish() = 0; }; } // namespace Core diff --git a/src/plugins/coreplugin/dialogs/iwizard.h b/src/plugins/coreplugin/dialogs/iwizard.h index 53216a0ed3d..e8417349a2e 100644 --- a/src/plugins/coreplugin/dialogs/iwizard.h +++ b/src/plugins/coreplugin/dialogs/iwizard.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/dialogs/newdialog.cpp b/src/plugins/coreplugin/dialogs/newdialog.cpp index a77d5935416..3aee7e994e1 100644 --- a/src/plugins/coreplugin/dialogs/newdialog.cpp +++ b/src/plugins/coreplugin/dialogs/newdialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/dialogs/newdialog.h b/src/plugins/coreplugin/dialogs/newdialog.h index 057d2e82697..d1169ddd3c0 100644 --- a/src/plugins/coreplugin/dialogs/newdialog.h +++ b/src/plugins/coreplugin/dialogs/newdialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/dialogs/openwithdialog.cpp b/src/plugins/coreplugin/dialogs/openwithdialog.cpp index 35a5152b17e..620e65177bc 100644 --- a/src/plugins/coreplugin/dialogs/openwithdialog.cpp +++ b/src/plugins/coreplugin/dialogs/openwithdialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/dialogs/openwithdialog.h b/src/plugins/coreplugin/dialogs/openwithdialog.h index b4ff9675082..e4acc6a339b 100644 --- a/src/plugins/coreplugin/dialogs/openwithdialog.h +++ b/src/plugins/coreplugin/dialogs/openwithdialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp b/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp index 36da081e2dd..6d7547cca96 100644 --- a/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/dialogs/saveitemsdialog.h b/src/plugins/coreplugin/dialogs/saveitemsdialog.h index 471c74b2b44..a2543c98a2a 100644 --- a/src/plugins/coreplugin/dialogs/saveitemsdialog.h +++ b/src/plugins/coreplugin/dialogs/saveitemsdialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp index e2865bf1830..669ea09bf92 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -126,20 +126,22 @@ void SettingsDialog::pageSelected(QTreeWidgetItem *) void SettingsDialog::accept() { - foreach (IOptionsPage *page, m_pages) - page->finished(true); + foreach (IOptionsPage *page, m_pages) { + page->apply(); + page->finish(); + } done(QDialog::Accepted); } void SettingsDialog::reject() { foreach (IOptionsPage *page, m_pages) - page->finished(false); + page->finish(); done(QDialog::Rejected); } void SettingsDialog::apply() { foreach (IOptionsPage *page, m_pages) - page->finished(true); + page->apply(); } diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.h b/src/plugins/coreplugin/dialogs/settingsdialog.h index 6dd8a2a37da..6a9194a8176 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.h +++ b/src/plugins/coreplugin/dialogs/settingsdialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp index ec1c3975c4d..3d51e00b874 100644 --- a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp +++ b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -33,15 +33,15 @@ #include "shortcutsettings.h" #include "ui_shortcutsettings.h" -#include "actionmanager.h" -#include "command.h" +#include "actionmanager_p.h" +#include "command_p.h" #include "coreconstants.h" #include "coreimpl.h" #include "commandsfile.h" #include "filemanager.h" #include -#include +#include #include #include @@ -120,14 +120,14 @@ QWidget *ShortcutSettings::createPage(QWidget *parent) return w; } -void ShortcutSettings::finished(bool accepted) +void ShortcutSettings::apply() { - if (accepted) { - foreach (ShortcutItem *item, m_scitems) { - item->m_cmd->setKeySequence(item->m_key); - } - } + foreach (ShortcutItem *item, m_scitems) + item->m_cmd->setKeySequence(item->m_key); +} +void ShortcutSettings::finish() +{ qDeleteAll(m_scitems); m_scitems.clear(); } @@ -281,14 +281,14 @@ void ShortcutSettings::initialize() { QMap categories; - m_am = ActionManager::instance(); + m_am = ActionManagerPrivate::instance(); UniqueIDManager *uidm = CoreImpl::instance()->uniqueIDManager(); - QList cmds = m_am->commands(); + QList cmds = m_am->commands(); for (int i = 0; i < cmds.size(); ++i) { - Command *c = cmds.at(i); - if (c->hasAttribute(Command::CA_NonConfigureable)) + CommandPrivate *c = cmds.at(i); + if (c->hasAttribute(CommandPrivate::CA_NonConfigureable)) continue; if (c->action() && c->action()->isSeparator()) continue; @@ -313,7 +313,7 @@ void ShortcutSettings::initialize() item->setText(0, uidm->stringForUniqueIdentifier(c->id())); if (c->action()) { - QString text = c->hasAttribute(Command::CA_UpdateText) && !c->defaultText().isNull() ? c->defaultText() : c->action()->text(); + QString text = c->hasAttribute(CommandPrivate::CA_UpdateText) && !c->defaultText().isNull() ? c->defaultText() : c->action()->text(); s->m_key = c->action()->shortcut(); item->setText(1, text); } else { diff --git a/src/plugins/coreplugin/dialogs/shortcutsettings.h b/src/plugins/coreplugin/dialogs/shortcutsettings.h index 99d4a8fbbc4..0466c84e6ec 100644 --- a/src/plugins/coreplugin/dialogs/shortcutsettings.h +++ b/src/plugins/coreplugin/dialogs/shortcutsettings.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -47,17 +47,16 @@ QT_END_NAMESPACE namespace Core { -class ICommand; +class Command; namespace Internal { -class ActionManager; -class Command; +class ActionManagerPrivate; class MainWindow; struct ShortcutItem { - ICommand *m_cmd; + Command *m_cmd; QKeySequence m_key; QTreeWidgetItem *m_item; }; @@ -77,7 +76,8 @@ public: QString trCategory() const; QWidget *createPage(QWidget *parent); - void finished(bool accepted); + void apply(); + void finish(); protected: bool eventFilter(QObject *o, QEvent *e); @@ -101,7 +101,7 @@ private: int translateModifiers(Qt::KeyboardModifiers state, const QString &text); QList m_scitems; - ActionManager *m_am; + ActionManagerPrivate *m_am; int m_key[4], m_keyNum; Ui_ShortcutSettings *m_page; }; diff --git a/src/plugins/coreplugin/editmode.cpp b/src/plugins/coreplugin/editmode.cpp index 503c52ac8f7..dacb31e355c 100644 --- a/src/plugins/coreplugin/editmode.cpp +++ b/src/plugins/coreplugin/editmode.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/editmode.h b/src/plugins/coreplugin/editmode.h index 2f7555915d8..423480a553a 100644 --- a/src/plugins/coreplugin/editmode.h +++ b/src/plugins/coreplugin/editmode.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/editormanager/editorgroup.cpp b/src/plugins/coreplugin/editormanager/editorgroup.cpp index 8158bab4d81..3ab8e84ed2e 100644 --- a/src/plugins/coreplugin/editormanager/editorgroup.cpp +++ b/src/plugins/coreplugin/editormanager/editorgroup.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/editormanager/editorgroup.h b/src/plugins/coreplugin/editormanager/editorgroup.h index bd9879e1ce3..8a0bcb475ff 100644 --- a/src/plugins/coreplugin/editormanager/editorgroup.h +++ b/src/plugins/coreplugin/editormanager/editorgroup.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 133616f8f36..0654e64a423 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include #include #include @@ -210,13 +210,13 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) : const QList editManagerContext = QList() << m_d->m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_EDITORMANAGER); - ActionManagerInterface *am = m_d->m_core->actionManager(); - IActionContainer *mfile = am->actionContainer(Constants::M_FILE); + ActionManager *am = m_d->m_core->actionManager(); + ActionContainer *mfile = am->actionContainer(Constants::M_FILE); //Revert to saved - ICommand *cmd = am->registerAction(m_d->m_revertToSavedAction, + Command *cmd = am->registerAction(m_d->m_revertToSavedAction, Constants::REVERTTOSAVED, editManagerContext); - cmd->setAttribute(ICommand::CA_UpdateText); + cmd->setAttribute(Command::CA_UpdateText); cmd->setDefaultText(tr("Revert File to Saved")); mfile->addAction(cmd, Constants::G_FILE_SAVE); connect(m_d->m_revertToSavedAction, SIGNAL(triggered()), this, SLOT(revertToSaved())); @@ -230,7 +230,7 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) : connect(m_d->m_saveAsAction, SIGNAL(triggered()), this, SLOT(saveFileAs())); //Window Menu - IActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW); + ActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW); //Window menu separators QAction *tmpaction = new QAction(this); @@ -261,7 +261,7 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) : //Close Action cmd = am->registerAction(m_d->m_closeCurrentEditorAction, Constants::CLOSE, editManagerContext); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+W"))); - cmd->setAttribute(Core::ICommand::CA_UpdateText); + cmd->setAttribute(Core::Command::CA_UpdateText); cmd->setDefaultText(m_d->m_closeCurrentEditorAction->text()); mfile->addAction(cmd, Constants::G_FILE_CLOSE); connect(m_d->m_closeCurrentEditorAction, SIGNAL(triggered()), this, SLOT(closeEditor())); @@ -318,8 +318,8 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) : connect(m_d->m_goForwardAction, SIGNAL(triggered()), this, SLOT(goForwardInNavigationHistory())); - IActionContainer *medit = am->actionContainer(Constants::M_EDIT); - IActionContainer *advancedMenu = am->createMenu(Constants::M_EDIT_ADVANCED); + ActionContainer *medit = am->actionContainer(Constants::M_EDIT); + ActionContainer *advancedMenu = am->createMenu(Constants::M_EDIT_ADVANCED); medit->addMenu(advancedMenu, Constants::G_EDIT_FORMAT); advancedMenu->menu()->setTitle(tr("&Advanced")); @@ -1403,7 +1403,7 @@ void EditorManager::readSettings(QSettings *settings) if (settings->contains(QLatin1String("EditorManager/DocumentStates"))) m_d->m_editorStates = settings->value(QLatin1String("EditorManager/DocumentStates")) .value >(); - if (settings->contains(QLatin1String("EditorManager/ExternalEditor"))) + if (settings->contains(QLatin1String("EditorManager/ExternalEditorCommand"))) m_d->m_externalEditor = settings->value(QLatin1String("EditorManager/ExternalEditorCommand")).toString(); } diff --git a/src/plugins/coreplugin/editormanager/editormanager.h b/src/plugins/coreplugin/editormanager/editormanager.h index f07da9d447a..0d9a9a65d59 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.h +++ b/src/plugins/coreplugin/editormanager/editormanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/editormanager/editorsplitter.cpp b/src/plugins/coreplugin/editormanager/editorsplitter.cpp index 370cae409fd..7e4f53f4e40 100644 --- a/src/plugins/coreplugin/editormanager/editorsplitter.cpp +++ b/src/plugins/coreplugin/editormanager/editorsplitter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include @@ -72,9 +72,9 @@ void EditorSplitter::registerActions() const QList editorManagerContext = QList() << m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_EDITORMANAGER); - ActionManagerInterface *am = m_core->actionManager(); - IActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW); - ICommand *cmd; + ActionManager *am = m_core->actionManager(); + ActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW); + Command *cmd; //Horizontal Action m_horizontalSplitAction = new QAction(tr("Split Left/Right"), this); @@ -98,7 +98,7 @@ void EditorSplitter::registerActions() this, SLOT(unsplit())); //Default Layout menu - IActionContainer *mLayout = am->createMenu("QtCreator.Menu.Window.Layout"); + ActionContainer *mLayout = am->createMenu("QtCreator.Menu.Window.Layout"); mwindow->addMenu(mLayout, Constants::G_WINDOW_SPLIT); mLayout->menu()->setTitle(tr("Default Splitter Layout")); diff --git a/src/plugins/coreplugin/editormanager/editorsplitter.h b/src/plugins/coreplugin/editormanager/editorsplitter.h index 0a52aa77449..94aac2df231 100644 --- a/src/plugins/coreplugin/editormanager/editorsplitter.h +++ b/src/plugins/coreplugin/editormanager/editorsplitter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/editormanager/ieditor.h b/src/plugins/coreplugin/editormanager/ieditor.h index 02f65d94e00..c650d43c26c 100644 --- a/src/plugins/coreplugin/editormanager/ieditor.h +++ b/src/plugins/coreplugin/editormanager/ieditor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/editormanager/ieditorfactory.h b/src/plugins/coreplugin/editormanager/ieditorfactory.h index c3a25162c7a..eabf81c0a3a 100644 --- a/src/plugins/coreplugin/editormanager/ieditorfactory.h +++ b/src/plugins/coreplugin/editormanager/ieditorfactory.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/editormanager/openeditorsview.cpp b/src/plugins/coreplugin/editormanager/openeditorsview.cpp index c04a2a5c73b..7693d1700b2 100644 --- a/src/plugins/coreplugin/editormanager/openeditorsview.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorsview.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/editormanager/openeditorsview.h b/src/plugins/coreplugin/editormanager/openeditorsview.h index a7403d1e867..c3523976e18 100644 --- a/src/plugins/coreplugin/editormanager/openeditorsview.h +++ b/src/plugins/coreplugin/editormanager/openeditorsview.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp index c7fe93b7155..f9fe4ffe5cc 100644 --- a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/editormanager/openeditorswindow.h b/src/plugins/coreplugin/editormanager/openeditorswindow.h index 270849fb1f7..c715beb559d 100644 --- a/src/plugins/coreplugin/editormanager/openeditorswindow.h +++ b/src/plugins/coreplugin/editormanager/openeditorswindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/editormanager/stackededitorgroup.cpp b/src/plugins/coreplugin/editormanager/stackededitorgroup.cpp index 0111be02b76..edceea70002 100644 --- a/src/plugins/coreplugin/editormanager/stackededitorgroup.cpp +++ b/src/plugins/coreplugin/editormanager/stackededitorgroup.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/editormanager/stackededitorgroup.h b/src/plugins/coreplugin/editormanager/stackededitorgroup.h index 250e643c86e..7557830239e 100644 --- a/src/plugins/coreplugin/editormanager/stackededitorgroup.h +++ b/src/plugins/coreplugin/editormanager/stackededitorgroup.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/fancyactionbar.cpp b/src/plugins/coreplugin/fancyactionbar.cpp index a4da55d393a..b144a731ad4 100644 --- a/src/plugins/coreplugin/fancyactionbar.cpp +++ b/src/plugins/coreplugin/fancyactionbar.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/fancyactionbar.h b/src/plugins/coreplugin/fancyactionbar.h index e7946e8ed95..07a3c984556 100644 --- a/src/plugins/coreplugin/fancyactionbar.h +++ b/src/plugins/coreplugin/fancyactionbar.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/fancytabwidget.cpp b/src/plugins/coreplugin/fancytabwidget.cpp index ccf9c92322c..1302dc71d67 100644 --- a/src/plugins/coreplugin/fancytabwidget.cpp +++ b/src/plugins/coreplugin/fancytabwidget.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/fancytabwidget.h b/src/plugins/coreplugin/fancytabwidget.h index 58a59794370..24865fe8d0e 100644 --- a/src/plugins/coreplugin/fancytabwidget.h +++ b/src/plugins/coreplugin/fancytabwidget.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/fileiconprovider.cpp b/src/plugins/coreplugin/fileiconprovider.cpp index 0c4b4a39de1..bf48ba37013 100644 --- a/src/plugins/coreplugin/fileiconprovider.cpp +++ b/src/plugins/coreplugin/fileiconprovider.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/fileiconprovider.h b/src/plugins/coreplugin/fileiconprovider.h index ce4939605a5..8a92666ba4e 100644 --- a/src/plugins/coreplugin/fileiconprovider.h +++ b/src/plugins/coreplugin/fileiconprovider.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/filemanager.cpp b/src/plugins/coreplugin/filemanager.cpp index 27276fbe149..c4f515547a1 100644 --- a/src/plugins/coreplugin/filemanager.cpp +++ b/src/plugins/coreplugin/filemanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/filemanager.h b/src/plugins/coreplugin/filemanager.h index 817c0d2a5ab..bffbb088355 100644 --- a/src/plugins/coreplugin/filemanager.h +++ b/src/plugins/coreplugin/filemanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/findplaceholder.cpp b/src/plugins/coreplugin/findplaceholder.cpp index 866b9eadcd4..b3416f01b44 100644 --- a/src/plugins/coreplugin/findplaceholder.cpp +++ b/src/plugins/coreplugin/findplaceholder.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/findplaceholder.h b/src/plugins/coreplugin/findplaceholder.h index 860b16a7878..c7d36d6328a 100644 --- a/src/plugins/coreplugin/findplaceholder.h +++ b/src/plugins/coreplugin/findplaceholder.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/flowlayout.cpp b/src/plugins/coreplugin/flowlayout.cpp index c48190f9e2e..95097f74e52 100644 --- a/src/plugins/coreplugin/flowlayout.cpp +++ b/src/plugins/coreplugin/flowlayout.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/flowlayout.h b/src/plugins/coreplugin/flowlayout.h index efdd3a72807..af709c2bd16 100644 --- a/src/plugins/coreplugin/flowlayout.h +++ b/src/plugins/coreplugin/flowlayout.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index 294bb36dec8..b21b96fd5e4 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -81,11 +81,8 @@ QWidget *GeneralSettings::createPage(QWidget *parent) return w; } -void GeneralSettings::finished(bool accepted) +void GeneralSettings::apply() { - if (!accepted) - return; - // Apply the new base color if accepted StyleHelper::setBaseColor(m_page->colorButton->color()); EditorManager::instance()->setExternalEditor(m_page->externalEditorEdit->text()); diff --git a/src/plugins/coreplugin/generalsettings.h b/src/plugins/coreplugin/generalsettings.h index ead56930333..aff4d0c8809 100644 --- a/src/plugins/coreplugin/generalsettings.h +++ b/src/plugins/coreplugin/generalsettings.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -55,7 +55,8 @@ public: QString category() const; QString trCategory() const; QWidget* createPage(QWidget *parent); - void finished(bool accepted); + void apply(); + void finish() { } private slots: void resetInterfaceColor(); diff --git a/src/plugins/coreplugin/icontext.h b/src/plugins/coreplugin/icontext.h index 3a45cfa4123..b2d32d4d846 100644 --- a/src/plugins/coreplugin/icontext.h +++ b/src/plugins/coreplugin/icontext.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp new file mode 100644 index 00000000000..5d6d3274177 --- /dev/null +++ b/src/plugins/coreplugin/icore.cpp @@ -0,0 +1,341 @@ +/*************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** +** Non-Open Source Usage +** +** Licensees may use this file in accordance with the Qt Beta Version +** License Agreement, Agreement version 2.2 provided with the Software or, +** alternatively, in accordance with the terms contained in a written +** agreement between you and Nokia. +** +** GNU General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the packaging +** of this file. Please review the following information to ensure GNU +** General Public Licensing requirements will be met: +** +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt GPL Exception +** version 1.3, included in the file GPL_EXCEPTION.txt in this package. +** +***************************************************************************/ + +#include "icore.h" + +/*! + \namespace Core + \brief The Core namespace contains all classes that make up the Core plugin + which constitute the basic functionality of Qt Creator. +*/ + +/*! + \namespace Core::Internal + \internal +*/ + +/*! + \class Core::ICore + \brief The ICore class allows access to the different part that make up + the basic functionality of Qt Creator. + + You should never create a subclass of this interface. The one and only + instance is created by the Core plugin. You can access this instance + from your plugin via the plugin manager, e.g. + \code + ExtensionSystem::PluginManager::instance()->getObject(); + \endcode + + \mainclass +*/ + +/*! + \fn QStringList ICore::showNewItemDialog(const QString &title, + const QList &wizards, + const QString &defaultLocation = QString()) + \brief Opens a dialog where the user can choose from a set of \a wizards that + create new files/classes/projects. + + The \a title argument is shown as the dialogs title. The path where the + files will be created (if the user doesn't change it) is set + in \a defaultLocation. It defaults to the path of the file manager's + current file. + + \sa Core::FileManager +*/ + +/*! + \fn void ICore::showOptionsDialog(const QString &group = QString(), + const QString &page = QString()) + \brief Opens the application options/preferences dialog with preselected + \a page in a specified \a group. + + The arguments refer to the string IDs of the corresponding IOptionsPage. +*/ + +/*! + \fn ActionManager *ICore::actionManager() const + \brief Returns the application's action manager. + + The action manager is responsible for registration of menus and + menu items and keyboard shortcuts. +*/ + +/*! + \fn FileManager *ICore::fileManager() const + \brief Returns the application's file manager. + + The file manager keeps track of files for changes outside the application. +*/ + +/*! + \fn UniqueIDManager *ICore::uniqueIDManager() const + \brief Returns the application's id manager. + + The unique ID manager transforms strings in unique integers and the other way round. +*/ + +/*! + \fn MessageManager *ICore::messageManager() const + \brief Returns the application's message manager. + + The message manager is the interface to the "General" output pane for + general application debug messages. +*/ + +/*! + \fn ExtensionSystem::PluginManager *ICore::pluginManager() const + \brief Returns the application's plugin manager. + + The plugin manager handles the plugin life cycles and manages + the common object pool. +*/ + +/*! + \fn EditorManager *ICore::editorManager() const + \brief Returns the application's editor manager. + + The editor manager handles all editor related tasks like opening + documents, the stack of currently open documents and the currently + active document. +*/ + +/*! + \fn ProgressManager *ICore::progressManager() const + \brief Returns the application's progress manager. + + Use the progress manager to register a concurrent task to + show a progress bar the way Qt Creator does it. +*/ + +/*! + \fn ScriptManager *ICore::scriptManager() const + \internal +*/ + +/*! + \fn VariableManager *ICore::variableManager() const + \brief Returns the application's variable manager. + + The variable manager is used to register application wide string variables + like \c MY_PROJECT_DIR such that strings like \c{somecommand ${MY_PROJECT_DIR}/sub} + can be resolved/expanded from anywhere in the application. +*/ + +/*! + \fn VCSManager *ICore::vcsManager() const + \brief Returns the application's vcs manager. + + The vcs manager can be used to e.g. retrieve information about + the version control system used for a directory on hard disk. + The actual functionality for a specific version control system + must be implemented in a IVersionControl object and registered in + the plugin manager's object pool. +*/ + +/*! + \fn ModeManager *ICore::modeManager() const + \brief Returns the application's mode manager. + + The mode manager handles everything related to the instances of IMode + that were added to the plugin manager's object pool as well as their + buttons and the tool bar with the round buttons in the lower left + corner of Qt Creator. +*/ + +/*! + \fn MimeDatabase *ICore::mimeDatabase() const + \brief Returns the application's mime database. + + Use the mime database to manage mime types. +*/ + +/*! + \fn QSettings *ICore::settings() const + \brief Returns the application's main settings object. + + You can use it to retrieve or set application wide settings + (in contrast to session or project specific settings). +*/ + +/*! + \fn QPrinter *ICore::printer() const + \brief Returns the application's printer object. + + Always use this printer object for printing, so the different parts of the + application re-use it's settings. +*/ + +/*! + \fn QString ICore::resourcePath() const + \brief Returns the absolute path that is used for resources like + project templates and the debugger macros. + + This abstraction is needed to avoid platform-specific code all over + the place, since e.g. on Mac the resources are part of the application bundle. +*/ + +/*! + \fn QMainWindow *ICore::mainWindow() const + \brief Returns the main application window. + + For use as dialog parent etc. +*/ + +/*! + \fn IContext *ICore::currentContextObject() const + \brief Returns the context object of the current main context. + + \sa ICore::addAdditionalContext() + \sa ICore::addContextObject() +*/ + +/*! + \fn void ICore::addAdditionalContext(int context) + \brief Register additional context to be currently active. + + Appends the additional \a context to the list of currently active + contexts. You need to call ICore::updateContext to make that change + take effect. + + \sa ICore::removeAdditionalContext() + \sa ICore::hasContext() + \sa ICore::updateContext() +*/ + +/*! + \fn void ICore::removeAdditionalContext(int context) + \brief Removes the given \a context from the list of currently active contexts. + + You need to call ICore::updateContext to make that change + take effect. + + \sa ICore::addAdditionalContext() + \sa ICore::hasContext() + \sa ICore::updateContext() +*/ + +/*! + \fn bool ICore::hasContext(int context) const + \brief Returns if the given \a context is currently one of the active contexts. + + \sa ICore::addAdditionalContext() + \sa ICore::addContextObject() +*/ + +/*! + \fn void ICore::addContextObject(IContext *context) + \brief Registers an additional \a context object. + + After registration this context object gets automatically the + current context object whenever it's widget gets focus. + + \sa ICore::removeContextObject() + \sa ICore::addAdditionalContext() + \sa ICore::currentContextObject() +*/ + +/*! + \fn void ICore::removeContextObject(IContext *context) + \brief Unregisters a \a context object from the list of know contexts. + + \sa ICore::addContextObject() + \sa ICore::addAdditionalContext() + \sa ICore::currentContextObject() +} +*/ + +/*! + \fn void ICore::updateContext() + \brief Update the list of active contexts after adding or removing additional ones. + + \sa ICore::addAdditionalContext() + \sa ICore::removeAdditionalContext() +*/ + +/*! + \fn void ICore::openFiles(const QStringList &fileNames) + \brief Open all files from a list of \a fileNames like it would be + done if they were given to Qt Creator on the command line, or + they were opened via \gui{File|Open}. +*/ + +/*! + \fn ICore::ICore() + \internal +*/ + +/*! + \fn ICore::~ICore() + \internal +*/ + +/*! + \fn void ICore::coreOpened() + \brief Emitted after all plugins have been loaded and the main window shown. +*/ + +/*! + \fn void ICore::saveSettingsRequested() + \brief Emitted to signal that the user has requested that the global settings + should be saved to disk. + + At the moment that happens when the application is closed, and on \gui{Save All}. +*/ + +/*! + \fn void ICore::optionsDialogRequested() + \brief Signal that allows plugins to perform actions just before the \gui{Tools|Options} + dialog is shown. +*/ + +/*! + \fn void ICore::coreAboutToClose() + \brief Plugins can do some pre-end-of-life actions when they get this signal. + + The application is guaranteed to shut down after this signal is emitted. + It's there as an addition to the usual plugin lifecycle methods, namely + IPlugin::shutdown(), just for convenience. +*/ + +/*! + \fn void ICore::contextAboutToChange(Core::IContext *context) + \brief Sent just before a new \a context becomes the current context + (meaning that it's widget got focus). +*/ + +/*! + \fn void ICore::contextChanged(Core::IContext *context) + \brief Sent just after a new \a context became the current context + (meaning that it's widget got focus). +*/ diff --git a/src/plugins/coreplugin/icore.h b/src/plugins/coreplugin/icore.h index fe9b3b3ba9b..7244782b495 100644 --- a/src/plugins/coreplugin/icore.h +++ b/src/plugins/coreplugin/icore.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -50,16 +50,15 @@ QT_END_NAMESPACE namespace Core { // forward declarations -class ActionManagerInterface; +class ActionManager; class IFile; class FileManager; class MessageManager; class IEditor; class UniqueIDManager; -class ViewManagerInterface; class EditorManager; -class ProgressManagerInterface; -class ScriptManagerInterface; +class ProgressManager; +class ScriptManager; class VariableManager; class IContext; class VCSManager; @@ -82,15 +81,14 @@ public: virtual void showOptionsDialog(const QString &group = QString(), const QString &page = QString()) = 0; - virtual ActionManagerInterface *actionManager() const = 0; + virtual ActionManager *actionManager() const = 0; virtual FileManager *fileManager() const = 0; virtual UniqueIDManager *uniqueIDManager() const = 0; virtual MessageManager *messageManager() const = 0; - virtual ViewManagerInterface *viewManager() const = 0; virtual ExtensionSystem::PluginManager *pluginManager() const = 0; virtual EditorManager *editorManager() const = 0; - virtual ProgressManagerInterface *progressManager() const = 0; - virtual ScriptManagerInterface *scriptManager() const = 0; + virtual ProgressManager *progressManager() const = 0; + virtual ScriptManager *scriptManager() const = 0; virtual VariableManager *variableManager() const = 0; virtual VCSManager *vcsManager() const = 0; virtual ModeManager *modeManager() const = 0; @@ -100,20 +98,17 @@ public: virtual QPrinter *printer() const = 0; virtual QString resourcePath() const = 0; - virtual QString libraryPath() const = 0; - - virtual IContext *currentContextObject() const = 0; virtual QMainWindow *mainWindow() const = 0; - virtual QStatusBar *statusBar() const = 0; // adds and removes additional active contexts, this context is appended to the // currently active contexts. call updateContext after changing + virtual IContext *currentContextObject() const = 0; virtual void addAdditionalContext(int context) = 0; virtual void removeAdditionalContext(int context) = 0; virtual bool hasContext(int context) const = 0; - virtual void addContextObject(IContext *contex) = 0; - virtual void removeContextObject(IContext *contex) = 0; + virtual void addContextObject(IContext *context) = 0; + virtual void removeContextObject(IContext *context) = 0; virtual void updateContext() = 0; @@ -122,7 +117,7 @@ public: signals: void coreOpened(); void saveSettingsRequested(); - void settingsDialogRequested(); + void optionsDialogRequested(); void coreAboutToClose(); void contextAboutToChange(Core::IContext *context); void contextChanged(Core::IContext *context); diff --git a/src/plugins/coreplugin/icorelistener.h b/src/plugins/coreplugin/icorelistener.h index c0aab3b1aae..25468fbfd1a 100644 --- a/src/plugins/coreplugin/icorelistener.h +++ b/src/plugins/coreplugin/icorelistener.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/ifile.h b/src/plugins/coreplugin/ifile.h index a6ecdfbcb05..7ac816dcf88 100644 --- a/src/plugins/coreplugin/ifile.h +++ b/src/plugins/coreplugin/ifile.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/ifilefactory.h b/src/plugins/coreplugin/ifilefactory.h index d208d447f68..cd69fd5127d 100644 --- a/src/plugins/coreplugin/ifilefactory.h +++ b/src/plugins/coreplugin/ifilefactory.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/ifilewizardextension.h b/src/plugins/coreplugin/ifilewizardextension.h index 6e2c36c7594..76c94957653 100644 --- a/src/plugins/coreplugin/ifilewizardextension.h +++ b/src/plugins/coreplugin/ifilewizardextension.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/imode.h b/src/plugins/coreplugin/imode.h index 58602c083b6..34e04559906 100644 --- a/src/plugins/coreplugin/imode.h +++ b/src/plugins/coreplugin/imode.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/inavigationwidgetfactory.cpp b/src/plugins/coreplugin/inavigationwidgetfactory.cpp index f2ac6d8d539..4d64ad65876 100644 --- a/src/plugins/coreplugin/inavigationwidgetfactory.cpp +++ b/src/plugins/coreplugin/inavigationwidgetfactory.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/inavigationwidgetfactory.h b/src/plugins/coreplugin/inavigationwidgetfactory.h index a8f1dbbe42c..e3bb73e7b30 100644 --- a/src/plugins/coreplugin/inavigationwidgetfactory.h +++ b/src/plugins/coreplugin/inavigationwidgetfactory.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/ioutputpane.h b/src/plugins/coreplugin/ioutputpane.h index 44d2d09291a..7c4bfcb28bb 100644 --- a/src/plugins/coreplugin/ioutputpane.h +++ b/src/plugins/coreplugin/ioutputpane.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/iversioncontrol.h b/src/plugins/coreplugin/iversioncontrol.h index 4e82731b77c..12c4667f206 100644 --- a/src/plugins/coreplugin/iversioncontrol.h +++ b/src/plugins/coreplugin/iversioncontrol.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/iview.h b/src/plugins/coreplugin/iview.h index fb472b73475..0bce0f53544 100644 --- a/src/plugins/coreplugin/iview.h +++ b/src/plugins/coreplugin/iview.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 9a70673e088..f4633fcd735 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -33,7 +33,7 @@ #include "mainwindow.h" #include "actioncontainer.h" -#include "actionmanager.h" +#include "actionmanager_p.h" #include "basemode.h" #include "coreimpl.h" #include "coreconstants.h" @@ -49,12 +49,12 @@ #include "newdialog.h" #include "outputpane.h" #include "plugindialog.h" -#include "progressmanager.h" +#include "progressmanager_p.h" #include "progressview.h" #include "shortcutsettings.h" #include "vcsmanager.h" -#include "scriptmanager.h" +#include "scriptmanager_p.h" #include "settingsdialog.h" #include "stylehelper.h" #include "variablemanager.h" @@ -115,11 +115,11 @@ MainWindow::MainWindow() : m_additionalContexts(m_globalContext), m_settings(new QSettings(QSettings::IniFormat, QSettings::UserScope, QLatin1String("Nokia"), QLatin1String("QtCreator"), this)), m_printer(0), - m_actionManager(new ActionManager(this, m_uniqueIDManager)), + m_actionManager(new ActionManagerPrivate(this, m_uniqueIDManager)), m_editorManager(0), m_fileManager(new FileManager(m_coreImpl, this)), - m_progressManager(new ProgressManager()), - m_scriptManager(new ScriptManager(this, m_coreImpl)), + m_progressManager(new ProgressManagerPrivate()), + m_scriptManager(new ScriptManagerPrivate(this, m_coreImpl)), m_variableManager(new VariableManager(this)), m_vcsManager(new VCSManager()), m_viewManager(0), @@ -283,11 +283,12 @@ bool MainWindow::init(ExtensionSystem::PluginManager *pm, QString *) outputModeWidget->setLayout(new QVBoxLayout); outputModeWidget->layout()->setMargin(0); outputModeWidget->layout()->setSpacing(0); - m_outputMode = new BaseMode(tr("Output"), - Constants::MODE_OUTPUT, - QIcon(QLatin1String(":/fancyactionbar/images/mode_Output.png")), - Constants::P_MODE_OUTPUT, - outputModeWidget); + m_outputMode = new BaseMode; + m_outputMode->setName(tr("Output")); + m_outputMode->setUniqueModeName(Constants::MODE_OUTPUT); + m_outputMode->setIcon(QIcon(QLatin1String(":/fancyactionbar/images/mode_Output.png"))); + m_outputMode->setPriority(Constants::P_MODE_OUTPUT); + m_outputMode->setWidget(outputModeWidget); OutputPanePlaceHolder *oph = new OutputPanePlaceHolder(m_outputMode); oph->setVisible(true); oph->setCloseable(false); @@ -362,9 +363,9 @@ QStatusBar *MainWindow::statusBar() const void MainWindow::registerDefaultContainers() { - ActionManager *am = m_actionManager; + ActionManagerPrivate *am = m_actionManager; - IActionContainer *menubar = m_actionManager->createMenuBar(Constants::MENU_BAR); + ActionContainer *menubar = am->createMenuBar(Constants::MENU_BAR); #ifndef Q_WS_MAC // System menu bar on Mac setMenuBar(menubar->menuBar()); @@ -377,7 +378,7 @@ void MainWindow::registerDefaultContainers() menubar->appendGroup(Constants::G_HELP); //File Menu - IActionContainer *filemenu = am->createMenu(Constants::M_FILE); + ActionContainer *filemenu = am->createMenu(Constants::M_FILE); menubar->addMenu(filemenu, Constants::G_FILE); filemenu->menu()->setTitle(tr("&File")); filemenu->appendGroup(Constants::G_FILE_NEW); @@ -391,23 +392,23 @@ void MainWindow::registerDefaultContainers() //Edit Menu - IActionContainer *medit = am->createMenu(Constants::M_EDIT); + ActionContainer *medit = am->createMenu(Constants::M_EDIT); menubar->addMenu(medit, Constants::G_EDIT); medit->menu()->setTitle(tr("&Edit")); medit->appendGroup(Constants::G_EDIT_UNDOREDO); medit->appendGroup(Constants::G_EDIT_COPYPASTE); medit->appendGroup(Constants::G_EDIT_SELECTALL); medit->appendGroup(Constants::G_EDIT_FORMAT); - medit->appendGroup(Constants::G_EDIT_FIND, true); + medit->appendGroup(Constants::G_EDIT_FIND); medit->appendGroup(Constants::G_EDIT_OTHER); //Tools Menu - IActionContainer *ac = am->createMenu(Constants::M_TOOLS); + ActionContainer *ac = am->createMenu(Constants::M_TOOLS); menubar->addMenu(ac, Constants::G_TOOLS); ac->menu()->setTitle(tr("&Tools")); //Window Menu - IActionContainer *mwindow = am->createMenu(Constants::M_WINDOW); + ActionContainer *mwindow = am->createMenu(Constants::M_WINDOW); menubar->addMenu(mwindow, Constants::G_WINDOW); mwindow->menu()->setTitle(tr("&Window")); mwindow->appendGroup(Constants::G_WINDOW_SIZE); @@ -417,38 +418,38 @@ void MainWindow::registerDefaultContainers() mwindow->appendGroup(Constants::G_WINDOW_NAVIGATE); mwindow->appendGroup(Constants::G_WINDOW_NAVIGATE_GROUPS); mwindow->appendGroup(Constants::G_WINDOW_OTHER); - mwindow->appendGroup(Constants::G_WINDOW_LIST, true); + mwindow->appendGroup(Constants::G_WINDOW_LIST); //Help Menu ac = am->createMenu(Constants::M_HELP); menubar->addMenu(ac, Constants::G_HELP); ac->menu()->setTitle(tr("&Help")); - ac->appendGroup(Constants::G_HELP_HELP, true); - ac->appendGroup(Constants::G_HELP_ABOUT, true); + ac->appendGroup(Constants::G_HELP_HELP); + ac->appendGroup(Constants::G_HELP_ABOUT); } -static ICommand *createSeparator(ActionManager *am, QObject *parent, +static Command *createSeparator(ActionManagerPrivate *am, QObject *parent, const QString &name, const QList &context) { QAction *tmpaction = new QAction(parent); tmpaction->setSeparator(true); - ICommand *cmd = am->registerAction(tmpaction, name, context); + Command *cmd = am->registerAction(tmpaction, name, context); return cmd; } void MainWindow::registerDefaultActions() { - ActionManager *am = m_actionManager; - IActionContainer *mfile = am->actionContainer(Constants::M_FILE); - IActionContainer *medit = am->actionContainer(Constants::M_EDIT); - IActionContainer *mtools = am->actionContainer(Constants::M_TOOLS); - IActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW); + ActionManagerPrivate *am = m_actionManager; + ActionContainer *mfile = am->actionContainer(Constants::M_FILE); + ActionContainer *medit = am->actionContainer(Constants::M_EDIT); + ActionContainer *mtools = am->actionContainer(Constants::M_TOOLS); + ActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW); Q_UNUSED(mwindow) - IActionContainer *mhelp = am->actionContainer(Constants::M_HELP); + ActionContainer *mhelp = am->actionContainer(Constants::M_HELP); // File menu separators - ICommand *cmd = createSeparator(am, this, QLatin1String("QtCreator.File.Sep.Save"), m_globalContext); + Command *cmd = createSeparator(am, this, QLatin1String("QtCreator.File.Sep.Save"), m_globalContext); mfile->addAction(cmd, Constants::G_FILE_SAVE); cmd = createSeparator(am, this, QLatin1String("QtCreator.File.Sep.Print"), m_globalContext); @@ -505,25 +506,25 @@ void MainWindow::registerDefaultActions() connect(m_openWithAction, SIGNAL(triggered()), this, SLOT(openFileWith())); //File->Recent Files Menu - IActionContainer *ac = am->createMenu(Constants::M_FILE_RECENTFILES); + ActionContainer *ac = am->createMenu(Constants::M_FILE_RECENTFILES); mfile->addMenu(ac, Constants::G_FILE_OPEN); ac->menu()->setTitle(tr("Recent Files")); //Save Action QAction *tmpaction = new QAction(QIcon(Constants::ICON_SAVEFILE), tr("&Save"), this); - cmd = am->registerAction(tmpaction, Constants::SAVE); + cmd = am->registerAction(tmpaction, Constants::SAVE, m_globalContext); cmd->setDefaultKeySequence(QKeySequence::Save); - cmd->setAttribute(ICommand::CA_UpdateText); + cmd->setAttribute(Command::CA_UpdateText); cmd->setDefaultText(tr("&Save")); mfile->addAction(cmd, Constants::G_FILE_SAVE); //Save As Action tmpaction = new QAction(tr("Save &As..."), this); - cmd = am->registerAction(tmpaction, Constants::SAVEAS); + cmd = am->registerAction(tmpaction, Constants::SAVEAS, m_globalContext); #ifdef Q_OS_MAC cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+S"))); #endif - cmd->setAttribute(ICommand::CA_UpdateText); + cmd->setAttribute(Command::CA_UpdateText); cmd->setDefaultText(tr("Save &As...")); mfile->addAction(cmd, Constants::G_FILE_SAVE); @@ -538,7 +539,7 @@ void MainWindow::registerDefaultActions() //Print Action tmpaction = new QAction(tr("&Print..."), this); - cmd = am->registerAction(tmpaction, Constants::PRINT); + cmd = am->registerAction(tmpaction, Constants::PRINT, m_globalContext); mfile->addAction(cmd, Constants::G_FILE_PRINT); //Exit Action @@ -550,47 +551,47 @@ void MainWindow::registerDefaultActions() //Undo Action tmpaction = new QAction(QIcon(Constants::ICON_UNDO), tr("&Undo"), this); - cmd = am->registerAction(tmpaction, Constants::UNDO); + cmd = am->registerAction(tmpaction, Constants::UNDO, m_globalContext); cmd->setDefaultKeySequence(QKeySequence::Undo); - cmd->setAttribute(ICommand::CA_UpdateText); + cmd->setAttribute(Command::CA_UpdateText); cmd->setDefaultText(tr("&Undo")); medit->addAction(cmd, Constants::G_EDIT_UNDOREDO); //Redo Action tmpaction = new QAction(QIcon(Constants::ICON_REDO), tr("&Redo"), this); - cmd = am->registerAction(tmpaction, Constants::REDO); + cmd = am->registerAction(tmpaction, Constants::REDO, m_globalContext); cmd->setDefaultKeySequence(QKeySequence::Redo); - cmd->setAttribute(ICommand::CA_UpdateText); + cmd->setAttribute(Command::CA_UpdateText); cmd->setDefaultText(tr("&Redo")); medit->addAction(cmd, Constants::G_EDIT_UNDOREDO); //Cut Action tmpaction = new QAction(QIcon(Constants::ICON_CUT), tr("Cu&t"), this); - cmd = am->registerAction(tmpaction, Constants::CUT); + cmd = am->registerAction(tmpaction, Constants::CUT, m_globalContext); cmd->setDefaultKeySequence(QKeySequence::Cut); medit->addAction(cmd, Constants::G_EDIT_COPYPASTE); //Copy Action tmpaction = new QAction(QIcon(Constants::ICON_COPY), tr("&Copy"), this); - cmd = am->registerAction(tmpaction, Constants::COPY); + cmd = am->registerAction(tmpaction, Constants::COPY, m_globalContext); cmd->setDefaultKeySequence(QKeySequence::Copy); medit->addAction(cmd, Constants::G_EDIT_COPYPASTE); //Paste Action tmpaction = new QAction(QIcon(Constants::ICON_PASTE), tr("&Paste"), this); - cmd = am->registerAction(tmpaction, Constants::PASTE); + cmd = am->registerAction(tmpaction, Constants::PASTE, m_globalContext); cmd->setDefaultKeySequence(QKeySequence::Paste); medit->addAction(cmd, Constants::G_EDIT_COPYPASTE); //Select All tmpaction = new QAction(tr("&Select All"), this); - cmd = am->registerAction(tmpaction, Constants::SELECTALL); + cmd = am->registerAction(tmpaction, Constants::SELECTALL, m_globalContext); cmd->setDefaultKeySequence(QKeySequence::SelectAll); medit->addAction(cmd, Constants::G_EDIT_SELECTALL); //Goto Action tmpaction = new QAction(tr("&Go To Line..."), this); - cmd = am->registerAction(tmpaction, Constants::GOTO); + cmd = am->registerAction(tmpaction, Constants::GOTO, m_globalContext); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+L"))); medit->addAction(cmd, Constants::G_EDIT_OTHER); @@ -783,7 +784,7 @@ QStringList MainWindow::showNewItemDialog(const QString &title, void MainWindow::showOptionsDialog(const QString &category, const QString &page) { - emit m_coreImpl->settingsDialogRequested(); + emit m_coreImpl->optionsDialogRequested(); SettingsDialog dlg(this, category, page); dlg.exec(); } @@ -815,7 +816,7 @@ void MainWindow::openFileWith() } } -ActionManagerInterface *MainWindow::actionManager() const +ActionManager *MainWindow::actionManager() const { return m_actionManager; } @@ -840,22 +841,17 @@ VCSManager *MainWindow::vcsManager() const return m_vcsManager; } -ViewManagerInterface *MainWindow::viewManager() const -{ - return m_viewManager; -} - EditorManager *MainWindow::editorManager() const { return m_editorManager; } -ProgressManagerInterface *MainWindow::progressManager() const +ProgressManager *MainWindow::progressManager() const { return m_progressManager; } -ScriptManagerInterface *MainWindow::scriptManager() const +ScriptManager *MainWindow::scriptManager() const { return m_scriptManager; } @@ -967,17 +963,6 @@ void MainWindow::resetContext() updateContextObject(0); } -QMenu *MainWindow::createPopupMenu() -{ - QMenu *menu = new QMenu(this); - QList containers = m_actionManager->containers(); - foreach (ActionContainer *c, containers) { - if (c->toolBar()) - menu->addAction(c->toolBar()->toggleViewAction()); - } - return menu; -} - static const char *settingsGroup = "MainWindow"; static const char *geometryKey = "Geometry"; static const char *colorKey = "Color"; @@ -1071,7 +1056,7 @@ void MainWindow::updateContext() void MainWindow::aboutToShowRecentFiles() { - IActionContainer *aci = + ActionContainer *aci = m_actionManager->actionContainer(Constants::M_FILE_RECENTFILES); aci->menu()->clear(); m_recentFilesActions.clear(); diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h index 57338b31276..4a1c08f16ef 100644 --- a/src/plugins/coreplugin/mainwindow.h +++ b/src/plugins/coreplugin/mainwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -55,7 +55,7 @@ class PluginManager; namespace Core { -class ActionManagerInterface; +class ActionManager; class BaseMode; class BaseView; class EditorManager; @@ -64,9 +64,9 @@ class IContext; class MessageManager; class MimeDatabase; class ModeManager; -class ProgressManagerInterface; +class ProgressManager; class RightPaneWidget; -class ScriptManagerInterface; +class ScriptManager; class UniqueIDManager; class VariableManager; class VCSManager; @@ -74,13 +74,13 @@ class ViewManagerInterface; namespace Internal { -class ActionManager; +class ActionManagerPrivate; class CoreImpl; class FancyTabWidget; class GeneralSettings; class NavigationWidget; class OutputPane; -class ProgressManager; +class ProgressManagerPrivate; class ShortcutSettings; class ViewManager; class VersionDialog; @@ -105,15 +105,14 @@ public: //ICore inline ExtensionSystem::PluginManager *pluginManager() { return m_pluginManager; } - Core::ActionManagerInterface *actionManager() const; + Core::ActionManager *actionManager() const; Core::FileManager *fileManager() const; Core::UniqueIDManager *uniqueIDManager() const; Core::MessageManager *messageManager() const; - Core::ViewManagerInterface *viewManager() const; ExtensionSystem::PluginManager *pluginManager() const; Core::EditorManager *editorManager() const; - Core::ProgressManagerInterface *progressManager() const; - Core::ScriptManagerInterface *scriptManager() const; + Core::ProgressManager *progressManager() const; + Core::ScriptManager *scriptManager() const; Core::VariableManager *variableManager() const; Core::ModeManager *modeManager() const; Core::MimeDatabase *mimeDatabase() const; @@ -129,8 +128,6 @@ public: void updateContext(); - QMenu *createPopupMenu(); - void setSuppressNavigationWidget(bool suppress); signals: @@ -177,12 +174,12 @@ private: QList m_additionalContexts; QSettings *m_settings; mutable QPrinter *m_printer; - ActionManager *m_actionManager; + ActionManagerPrivate *m_actionManager; EditorManager *m_editorManager; FileManager *m_fileManager; MessageManager *m_messageManager; - ProgressManager *m_progressManager; - ScriptManagerInterface *m_scriptManager; + ProgressManagerPrivate *m_progressManager; + ScriptManager *m_scriptManager; VariableManager *m_variableManager; VCSManager *m_vcsManager; ViewManager *m_viewManager; diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index 9237883221b..a38a6c9774b 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/manhattanstyle.h b/src/plugins/coreplugin/manhattanstyle.h index 991d976a79e..1f61b931e9d 100644 --- a/src/plugins/coreplugin/manhattanstyle.h +++ b/src/plugins/coreplugin/manhattanstyle.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/messagemanager.cpp b/src/plugins/coreplugin/messagemanager.cpp index 081dfb68327..1b74995ef4d 100644 --- a/src/plugins/coreplugin/messagemanager.cpp +++ b/src/plugins/coreplugin/messagemanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/messagemanager.h b/src/plugins/coreplugin/messagemanager.h index 6e28b0a7e30..12a1524cb47 100644 --- a/src/plugins/coreplugin/messagemanager.h +++ b/src/plugins/coreplugin/messagemanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/messageoutputwindow.cpp b/src/plugins/coreplugin/messageoutputwindow.cpp index 8833507ff54..9a37af27a03 100644 --- a/src/plugins/coreplugin/messageoutputwindow.cpp +++ b/src/plugins/coreplugin/messageoutputwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/messageoutputwindow.h b/src/plugins/coreplugin/messageoutputwindow.h index 44bf29ca1cf..03ae5854643 100644 --- a/src/plugins/coreplugin/messageoutputwindow.h +++ b/src/plugins/coreplugin/messageoutputwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/mimedatabase.cpp b/src/plugins/coreplugin/mimedatabase.cpp index abca6a8e51d..5e57da02241 100644 --- a/src/plugins/coreplugin/mimedatabase.cpp +++ b/src/plugins/coreplugin/mimedatabase.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/mimedatabase.h b/src/plugins/coreplugin/mimedatabase.h index 2f43be45cd4..d7d696bd723 100644 --- a/src/plugins/coreplugin/mimedatabase.h +++ b/src/plugins/coreplugin/mimedatabase.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/minisplitter.cpp b/src/plugins/coreplugin/minisplitter.cpp index 1270a9ccf3f..7cd3653b541 100644 --- a/src/plugins/coreplugin/minisplitter.cpp +++ b/src/plugins/coreplugin/minisplitter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/minisplitter.h b/src/plugins/coreplugin/minisplitter.h index 0a2beaf17ae..2e7fbcc4b74 100644 --- a/src/plugins/coreplugin/minisplitter.h +++ b/src/plugins/coreplugin/minisplitter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/modemanager.cpp b/src/plugins/coreplugin/modemanager.cpp index 2e1713d05f9..579881a215d 100644 --- a/src/plugins/coreplugin/modemanager.cpp +++ b/src/plugins/coreplugin/modemanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -39,8 +39,8 @@ #include -#include -#include +#include +#include #include #include #include @@ -140,11 +140,11 @@ void ModeManager::objectAdded(QObject *obj) m_modeStack->insertTab(index, mode->widget(), mode->icon(), mode->name()); // Register mode shortcut - ActionManagerInterface *am = m_mainWindow->actionManager(); + ActionManager *am = m_mainWindow->actionManager(); const QString shortcutId = QLatin1String("QtCreator.Mode.") + mode->uniqueModeName(); QShortcut *shortcut = new QShortcut(m_mainWindow); shortcut->setWhatsThis(tr("Switch to %1 mode").arg(mode->name())); - ICommand *cmd = am->registerShortcut(shortcut, shortcutId, QList() << Constants::C_GLOBAL_ID); + Command *cmd = am->registerShortcut(shortcut, shortcutId, QList() << Constants::C_GLOBAL_ID); m_modeShortcuts.insert(index, cmd); connect(cmd, SIGNAL(keySequenceChanged()), this, SLOT(updateModeToolTip())); @@ -162,7 +162,7 @@ void ModeManager::objectAdded(QObject *obj) void ModeManager::updateModeToolTip() { - ICommand *cmd = qobject_cast(sender()); + Command *cmd = qobject_cast(sender()); if (cmd) { int index = m_modeShortcuts.indexOf(cmd); if (index != -1) @@ -184,7 +184,7 @@ void ModeManager::aboutToRemoveObject(QObject *obj) m_mainWindow->removeContextObject(mode); } -void ModeManager::addAction(ICommand *command, int priority, QMenu *menu) +void ModeManager::addAction(Command *command, int priority, QMenu *menu) { m_actions.insert(command, priority); diff --git a/src/plugins/coreplugin/modemanager.h b/src/plugins/coreplugin/modemanager.h index d3b328c29e0..4d783f461d6 100644 --- a/src/plugins/coreplugin/modemanager.h +++ b/src/plugins/coreplugin/modemanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -48,7 +48,7 @@ QT_END_NAMESPACE namespace Core { -class ICommand; +class Command; class IMode; namespace Internal { @@ -70,7 +70,7 @@ public: IMode* currentMode() const; IMode* mode(const QString &id) const; - void addAction(ICommand *command, int priority, QMenu *menu = 0); + void addAction(Command *command, int priority, QMenu *menu = 0); void addWidget(QWidget *widget); signals: @@ -95,9 +95,9 @@ private: Internal::MainWindow *m_mainWindow; Internal::FancyTabWidget *m_modeStack; Internal::FancyActionBar *m_actionBar; - QMap m_actions; + QMap m_actions; QVector m_modes; - QVector m_modeShortcuts; + QVector m_modeShortcuts; QSignalMapper *m_signalMapper; QList m_addedContexts; }; diff --git a/src/plugins/coreplugin/navigationwidget.cpp b/src/plugins/coreplugin/navigationwidget.cpp index 491c3943438..f6b586f7603 100644 --- a/src/plugins/coreplugin/navigationwidget.cpp +++ b/src/plugins/coreplugin/navigationwidget.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include @@ -316,14 +316,14 @@ void NavigationWidget::objectAdded(QObject * obj) return; Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject(); - Core::ActionManagerInterface *am = core->actionManager(); + Core::ActionManager *am = core->actionManager(); QList navicontext = QList() << core->uniqueIDManager()-> uniqueIdentifier(Core::Constants::C_NAVIGATION_PANE); QString displayName = factory->displayName(); QShortcut *shortcut = new QShortcut(this); shortcut->setWhatsThis(tr("Activate %1 Pane").arg(displayName)); - Core::ICommand *cmd = am->registerShortcut(shortcut, + Core::Command *cmd = am->registerShortcut(shortcut, displayName + QLatin1String(".FocusShortcut"), navicontext); cmd->setDefaultKeySequence(factory->activationSequence()); connect(shortcut, SIGNAL(activated()), this, SLOT(activateSubWidget())); @@ -492,10 +492,10 @@ void NavigationSubWidget::restoreSettings(int position) factory()->restoreSettings(position, m_navigationWidget); } -Core::ICommand *NavigationSubWidget::command(const QString &title) const +Core::Command *NavigationSubWidget::command(const QString &title) const { - const QHash commandMap = m_parentWidget->commandMap(); - QHash::const_iterator r = commandMap.find(title); + const QHash commandMap = m_parentWidget->commandMap(); + QHash::const_iterator r = commandMap.find(title); if (r != commandMap.end()) return r.value(); return 0; @@ -510,7 +510,7 @@ bool NavComboBox::event(QEvent *e) { if (e->type() == QEvent::ToolTip) { QString txt = currentText(); - Core::ICommand *cmd = m_navSubWidget->command(txt); + Core::Command *cmd = m_navSubWidget->command(txt); if (cmd) { txt = tr("Activate %1").arg(txt); setToolTip(cmd->stringWithAppendedShortcut(txt)); diff --git a/src/plugins/coreplugin/navigationwidget.h b/src/plugins/coreplugin/navigationwidget.h index 77dbf43ecef..016fbcd0bda 100644 --- a/src/plugins/coreplugin/navigationwidget.h +++ b/src/plugins/coreplugin/navigationwidget.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -50,7 +50,7 @@ namespace Core { class INavigationWidgetFactory; class IMode; -class ICommand; +class Command; namespace Internal { class NavigationWidget; @@ -99,7 +99,7 @@ public: // Called from the place holders void placeHolderChanged(NavigationWidgetPlaceHolder *holder); - QHash commandMap() const { return m_commandMap; } + QHash commandMap() const { return m_commandMap; } protected: void resizeEvent(QResizeEvent *); @@ -113,7 +113,7 @@ private: NavigationSubWidget *insertSubItem(int position); QList m_subWidgets; QHash m_shortcutMap; - QHash m_commandMap; + QHash m_commandMap; bool m_shown; bool m_suppressed; int m_width; @@ -136,7 +136,7 @@ public: void saveSettings(int position); void restoreSettings(int position); - Core::ICommand *command(const QString &title) const; + Core::Command *command(const QString &title) const; signals: void split(); diff --git a/src/plugins/coreplugin/outputpane.cpp b/src/plugins/coreplugin/outputpane.cpp index 6b5c3b146d1..36fc9de9cf8 100644 --- a/src/plugins/coreplugin/outputpane.cpp +++ b/src/plugins/coreplugin/outputpane.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -37,8 +37,8 @@ #include "mainwindow.h" #include "modemanager.h" -#include -#include +#include +#include #include #include @@ -210,11 +210,11 @@ void OutputPane::init(ICore *core, ExtensionSystem::PluginManager *pm) m_pluginManager = pm; m_core = core; - ActionManagerInterface *am = m_core->actionManager(); - IActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW); + ActionManager *am = m_core->actionManager(); + ActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW); // Window->Output Panes - IActionContainer *mpanes = am->createMenu(Constants::M_WINDOW_PANES); + ActionContainer *mpanes = am->createMenu(Constants::M_WINDOW_PANES); mwindow->addMenu(mpanes, Constants::G_WINDOW_PANES); mpanes->menu()->setTitle(tr("Output &Panes")); @@ -252,7 +252,7 @@ void OutputPane::init(ICore *core, ExtensionSystem::PluginManager *pm) actionId.remove(QLatin1Char(' ')); QAction *action = new QAction(outPane->name(), this); - ICommand *cmd = am->registerAction(action, actionId, m_context); + Command *cmd = am->registerAction(action, actionId, m_context); if (outPane->priorityInStatusBar() != -1) { #ifdef Q_OS_MAC cmd->setDefaultKeySequence(QKeySequence("Ctrl+" + QString::number(shortcutNumber))); diff --git a/src/plugins/coreplugin/outputpane.h b/src/plugins/coreplugin/outputpane.h index 096567a8a66..5a7c928a546 100644 --- a/src/plugins/coreplugin/outputpane.h +++ b/src/plugins/coreplugin/outputpane.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/plugindialog.cpp b/src/plugins/coreplugin/plugindialog.cpp index 829c28e9c39..29ea470411c 100644 --- a/src/plugins/coreplugin/plugindialog.cpp +++ b/src/plugins/coreplugin/plugindialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/plugindialog.h b/src/plugins/coreplugin/plugindialog.h index c264978918b..ace03bb3c17 100644 --- a/src/plugins/coreplugin/plugindialog.h +++ b/src/plugins/coreplugin/plugindialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/progressmanager/futureprogress.cpp b/src/plugins/coreplugin/progressmanager/futureprogress.cpp index 476a80a3667..bfd00ef37b3 100644 --- a/src/plugins/coreplugin/progressmanager/futureprogress.cpp +++ b/src/plugins/coreplugin/progressmanager/futureprogress.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/progressmanager/futureprogress.h b/src/plugins/coreplugin/progressmanager/futureprogress.h index 8b286dbf217..5f8e5353b3f 100644 --- a/src/plugins/coreplugin/progressmanager/futureprogress.h +++ b/src/plugins/coreplugin/progressmanager/futureprogress.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/progressmanager/progressmanager.cpp b/src/plugins/coreplugin/progressmanager/progressmanager.cpp index aaa5f4406c9..968d2bb9fc8 100644 --- a/src/plugins/coreplugin/progressmanager/progressmanager.cpp +++ b/src/plugins/coreplugin/progressmanager/progressmanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -31,37 +31,36 @@ ** ***************************************************************************/ -#include "progressmanager.h" +#include "progressmanager_p.h" #include "progressview.h" #include "coreimpl.h" #include "baseview.h" #include "coreconstants.h" #include "uniqueidmanager.h" -#include "viewmanagerinterface.h" #include using namespace Core; using namespace Core::Internal; -ProgressManager::ProgressManager(QObject *parent) - : ProgressManagerInterface(parent) +ProgressManagerPrivate::ProgressManagerPrivate(QObject *parent) + : ProgressManager(parent) { m_progressView = new ProgressView; ICore *core = CoreImpl::instance(); connect(core, SIGNAL(coreAboutToClose()), this, SLOT(cancelAllRunningTasks())); } -ProgressManager::~ProgressManager() +ProgressManagerPrivate::~ProgressManagerPrivate() { } -void ProgressManager::init() +void ProgressManagerPrivate::init() { } -void ProgressManager::cancelTasks(const QString &type) +void ProgressManagerPrivate::cancelTasks(const QString &type) { QMap *, QString>::iterator task = m_runningTasks.begin(); while (task != m_runningTasks.end()) { @@ -76,7 +75,7 @@ void ProgressManager::cancelTasks(const QString &type) } } -void ProgressManager::cancelAllRunningTasks() +void ProgressManagerPrivate::cancelAllRunningTasks() { QMap *, QString>::const_iterator task = m_runningTasks.constBegin(); while (task != m_runningTasks.constEnd()) { @@ -88,7 +87,7 @@ void ProgressManager::cancelAllRunningTasks() m_runningTasks.clear(); } -FutureProgress *ProgressManager::addTask(const QFuture &future, const QString &title, const QString &type, PersistentType persistency) +FutureProgress *ProgressManagerPrivate::addTask(const QFuture &future, const QString &title, const QString &type, PersistentType persistency) { QFutureWatcher *watcher = new QFutureWatcher(); m_runningTasks.insert(watcher, type); @@ -97,12 +96,12 @@ FutureProgress *ProgressManager::addTask(const QFuture &future, const QStr return m_progressView->addTask(future, title, type, persistency); } -QWidget *ProgressManager::progressView() +QWidget *ProgressManagerPrivate::progressView() { return m_progressView; } -void ProgressManager::taskFinished() +void ProgressManagerPrivate::taskFinished() { QObject *taskObject = sender(); QTC_ASSERT(taskObject, return); diff --git a/src/plugins/coreplugin/progressmanager/progressmanager.h b/src/plugins/coreplugin/progressmanager/progressmanager.h index 7df78fe26b8..a82bd24b517 100644 --- a/src/plugins/coreplugin/progressmanager/progressmanager.h +++ b/src/plugins/coreplugin/progressmanager/progressmanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -34,41 +34,30 @@ #ifndef PROGRESSMANAGER_H #define PROGRESSMANAGER_H -#include "progressmanagerinterface.h" +#include +#include -#include -#include -#include +#include +#include +#include namespace Core { -namespace Internal { -class ProgressView; - -class ProgressManager : public Core::ProgressManagerInterface +class CORE_EXPORT ProgressManager : public QObject { Q_OBJECT public: - ProgressManager(QObject *parent = 0); - ~ProgressManager(); - void init(); + enum PersistentType { CloseOnSuccess, KeepOnFinish }; - FutureProgress *addTask(const QFuture &future, const QString &title, const QString &type, PersistentType persistency); + ProgressManager(QObject *parent = 0) : QObject(parent) {} + virtual ~ProgressManager() {} - QWidget *progressView(); + virtual FutureProgress *addTask(const QFuture &future, const QString &title, const QString &type, PersistentType persistency = KeepOnFinish) = 0; public slots: - void cancelTasks(const QString &type); - -private slots: - void taskFinished(); - void cancelAllRunningTasks(); -private: - QPointer m_progressView; - QMap *, QString> m_runningTasks; + virtual void cancelTasks(const QString &type) = 0; }; -} // namespace Internal } // namespace Core -#endif // PROGRESSMANAGER_H +#endif //PROGRESSMANAGER_H diff --git a/src/plugins/debugger/mode.h b/src/plugins/coreplugin/progressmanager/progressmanager_p.h similarity index 62% rename from src/plugins/debugger/mode.h rename to src/plugins/coreplugin/progressmanager/progressmanager_p.h index 2d64ca6f072..92140904b05 100644 --- a/src/plugins/debugger/mode.h +++ b/src/plugins/coreplugin/progressmanager/progressmanager_p.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -31,55 +31,44 @@ ** ***************************************************************************/ -#ifndef DEBUGGER_DEBUGMODE_H -#define DEBUGGER_DEBUGMODE_H +#ifndef PROGRESSMANAGER_P_H +#define PROGRESSMANAGER_P_H -#include +#include "progressmanager.h" -#include #include +#include +#include -QT_BEGIN_NAMESPACE -class QAction; -class QDockWidget; -class QMainWindow; -class QSettings; -class QSplitter; -class QToolBar; -class QWidget; -QT_END_NAMESPACE - -namespace Debugger { +namespace Core { namespace Internal { -class DebuggerManager; +class ProgressView; -class DebugMode : public Core::BaseMode +class ProgressManagerPrivate : public Core::ProgressManager { Q_OBJECT - public: - DebugMode(DebuggerManager *manager, QObject *parent = 0); - ~DebugMode(); + ProgressManagerPrivate(QObject *parent = 0); + ~ProgressManagerPrivate(); + void init(); - // IMode - void activated(); - void shutdown(); - static QSettings *settings(); + FutureProgress *addTask(const QFuture &future, const QString &title, const QString &type, PersistentType persistency); + + QWidget *progressView(); + +public slots: + void cancelTasks(const QString &type); private slots: - void focusCurrentEditor(Core::IMode *mode); - + void taskFinished(); + void cancelAllRunningTasks(); private: - QToolBar *createToolBar(); - void writeSettings() const; - void readSettings(); - - QPointer m_manager; - QAction *m_toggleLockedAction; + QPointer m_progressView; + QMap *, QString> m_runningTasks; }; } // namespace Internal -} // namespace Debugger +} // namespace Core -#endif // DEBUGGER_DEBUGMODE_H +#endif // PROGRESSMANAGER_P_H diff --git a/src/plugins/coreplugin/progressmanager/progresspie.cpp b/src/plugins/coreplugin/progressmanager/progresspie.cpp index 620b369c547..be2a3e124b5 100644 --- a/src/plugins/coreplugin/progressmanager/progresspie.cpp +++ b/src/plugins/coreplugin/progressmanager/progresspie.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/progressmanager/progresspie.h b/src/plugins/coreplugin/progressmanager/progresspie.h index 1914b51b13b..e878a024ea4 100644 --- a/src/plugins/coreplugin/progressmanager/progresspie.h +++ b/src/plugins/coreplugin/progressmanager/progresspie.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/progressmanager/progressview.cpp b/src/plugins/coreplugin/progressmanager/progressview.cpp index a4e686d494b..cee81c697b0 100644 --- a/src/plugins/coreplugin/progressmanager/progressview.cpp +++ b/src/plugins/coreplugin/progressmanager/progressview.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -62,7 +62,7 @@ ProgressView::~ProgressView() FutureProgress *ProgressView::addTask(const QFuture &future, const QString &title, const QString &type, - ProgressManagerInterface::PersistentType persistency) + ProgressManager::PersistentType persistency) { removeOldTasks(type); if (m_taskList.size() == 3) @@ -73,7 +73,7 @@ FutureProgress *ProgressView::addTask(const QFuture &future, m_layout->insertWidget(0, progress); m_taskList.append(progress); m_type.insert(progress, type); - m_keep.insert(progress, (persistency == ProgressManagerInterface::KeepOnFinish)); + m_keep.insert(progress, (persistency == ProgressManager::KeepOnFinish)); connect(progress, SIGNAL(finished()), this, SLOT(slotFinished())); return progress; } diff --git a/src/plugins/coreplugin/progressmanager/progressview.h b/src/plugins/coreplugin/progressmanager/progressview.h index 455362009cf..939b162639e 100644 --- a/src/plugins/coreplugin/progressmanager/progressview.h +++ b/src/plugins/coreplugin/progressmanager/progressview.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -34,7 +34,7 @@ #ifndef PROGRESSVIEW_H #define PROGRESSVIEW_H -#include "progressmanagerinterface.h" +#include "progressmanager.h" #include #include @@ -59,7 +59,7 @@ public: FutureProgress *addTask(const QFuture &future, const QString &title, const QString &type, - ProgressManagerInterface::PersistentType persistency); + ProgressManager::PersistentType persistency); private slots: void slotFinished(); diff --git a/src/plugins/coreplugin/rightpane.cpp b/src/plugins/coreplugin/rightpane.cpp index 389afbced91..69c0e51e188 100644 --- a/src/plugins/coreplugin/rightpane.cpp +++ b/src/plugins/coreplugin/rightpane.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/rightpane.h b/src/plugins/coreplugin/rightpane.h index 84739ab4e66..776b9fdb2bb 100644 --- a/src/plugins/coreplugin/rightpane.h +++ b/src/plugins/coreplugin/rightpane.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/scriptmanager/metatypedeclarations.h b/src/plugins/coreplugin/scriptmanager/metatypedeclarations.h index 6431e426519..1e068b7cf45 100644 --- a/src/plugins/coreplugin/scriptmanager/metatypedeclarations.h +++ b/src/plugins/coreplugin/scriptmanager/metatypedeclarations.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp b/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp index 03809fdf30e..de98aecb215 100644 --- a/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp +++ b/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -44,7 +44,6 @@ #include #include -#include #include #include @@ -82,11 +81,6 @@ QMainWindow *CorePrototype::mainWindow() const return callee()->mainWindow(); } -QStatusBar *CorePrototype::statusBar() const -{ - return callee()->statusBar(); -} - QSettings *CorePrototype::settings() const { return callee()->settings(); diff --git a/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.h b/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.h index c7eae4a6ed4..d90030bc9a7 100644 --- a/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.h +++ b/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -55,7 +55,6 @@ class CorePrototype : public QObject, public QScriptable Q_PROPERTY(Core::EditorManager* editorManager READ editorManager DESIGNABLE false SCRIPTABLE true STORED false) Q_PROPERTY(QMainWindow* mainWindow READ mainWindow DESIGNABLE false SCRIPTABLE true STORED false) - Q_PROPERTY(QStatusBar* statusBar READ statusBar DESIGNABLE false SCRIPTABLE true STORED false) Q_PROPERTY(QSettings* settings READ settings DESIGNABLE false SCRIPTABLE true STORED false) public: @@ -68,7 +67,6 @@ public: Core::EditorManager *editorManager() const; QMainWindow *mainWindow() const; - QStatusBar *statusBar() const; QSettings *settings() const; public slots: diff --git a/src/plugins/coreplugin/scriptmanager/scriptmanager.cpp b/src/plugins/coreplugin/scriptmanager/scriptmanager.cpp index 084888c4dd2..1ac21ca743c 100644 --- a/src/plugins/coreplugin/scriptmanager/scriptmanager.cpp +++ b/src/plugins/coreplugin/scriptmanager/scriptmanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -31,7 +31,7 @@ ** ***************************************************************************/ -#include "scriptmanager.h" +#include "scriptmanager_p.h" #include "qworkbench_wrapper.h" #include "metatypedeclarations.h" @@ -177,19 +177,19 @@ static QScriptValue fileBox(QScriptContext *context, QScriptEngine *engine) engine->toScriptValue(rc) : engine->toScriptValue(rc.front()); } -// ------ ScriptManager +// ------ ScriptManagerPrivate namespace Core { namespace Internal { -ScriptManager::ScriptManager(QObject *parent, ICore *core) : - ScriptManagerInterface(parent), +ScriptManagerPrivate::ScriptManagerPrivate(QObject *parent, ICore *core) : + ScriptManager(parent), m_core(core), m_initialized(false) { } -QScriptEngine &ScriptManager::scriptEngine() +QScriptEngine &ScriptManagerPrivate::scriptEngine() { ensureEngineInitialized(); return m_engine; @@ -200,7 +200,7 @@ QScriptEngine &ScriptManager::scriptEngine() // demoProjectExplorer()@:237 // ()@:276 // ()@:0" -static void parseBackTrace(const QStringList &backTrace, ScriptManager::Stack &stack) +static void parseBackTrace(const QStringList &backTrace, ScriptManagerPrivate::Stack &stack) { const QChar at = QLatin1Char('@'); const QChar colon = QLatin1Char(':'); @@ -213,7 +213,7 @@ static void parseBackTrace(const QStringList &backTrace, ScriptManager::Stack &s if (colonPos == -1) continue; - ScriptManager::StackFrame frame; + ScriptManagerPrivate::StackFrame frame; frame.function = line.left(atPos); frame.fileName = line.mid(atPos + 1, colonPos - atPos - 1); frame.lineNumber = line.right(line.size() - colonPos - 1).toInt(); @@ -221,13 +221,13 @@ static void parseBackTrace(const QStringList &backTrace, ScriptManager::Stack &s } } -bool ScriptManager::runScript(const QString &script, QString *errorMessage) +bool ScriptManagerPrivate::runScript(const QString &script, QString *errorMessage) { Stack stack; return runScript(script, errorMessage, &stack); } -bool ScriptManager::runScript(const QString &script, QString *errorMessage, Stack *stack) +bool ScriptManagerPrivate::runScript(const QString &script, QString *errorMessage, Stack *stack) { ensureEngineInitialized(); stack->clear(); @@ -247,7 +247,7 @@ bool ScriptManager::runScript(const QString &script, QString *errorMessage, Stac return !failed; } -void ScriptManager::ensureEngineInitialized() +void ScriptManagerPrivate::ensureEngineInitialized() { if (m_initialized) return; @@ -304,7 +304,7 @@ void ScriptManager::ensureEngineInitialized() m_initialized = true; } -QString ScriptManager::engineError(QScriptEngine &scriptEngine) +QString ScriptManagerPrivate::engineError(QScriptEngine &scriptEngine) { QScriptValue error = scriptEngine.evaluate(QLatin1String("Error")); if (error.isValid()) diff --git a/src/plugins/coreplugin/scriptmanager/scriptmanager.h b/src/plugins/coreplugin/scriptmanager/scriptmanager.h index 305da45ca3a..c39cc21e0a0 100644 --- a/src/plugins/coreplugin/scriptmanager/scriptmanager.h +++ b/src/plugins/coreplugin/scriptmanager/scriptmanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -34,39 +34,43 @@ #ifndef SCRIPTMANAGER_H #define SCRIPTMANAGER_H -#include -#include +#include #include -#include +#include #include namespace Core { -namespace Internal { -class ScriptManager : public Core::ScriptManagerInterface +/* Script Manager. + * Provides a script engine that is initialized with + * Qt Creator's interfaces and allows for running scripts. + * @{todo} Should it actually manage script files, too? */ + +class CORE_EXPORT ScriptManager : public QObject { Q_OBJECT - public: - ScriptManager(QObject *parent, ICore *core); + // A stack frame as returned by a failed invocation (exception) + // fileName may be empty. lineNumber can be 0 for the top frame (goof-up?). + struct StackFrame { + QString function; + QString fileName; + int lineNumber; + }; + typedef QList Stack; - virtual QScriptEngine &scriptEngine(); + ScriptManager(QObject *parent = 0) : QObject(parent) {} + virtual ~ScriptManager() { } - virtual bool runScript(const QString &script, QString *errorMessage, Stack *stack); - virtual bool runScript(const QString &script, QString *errorMessage); + // Access the engine (for plugins to wrap additional interfaces). + virtual QScriptEngine &scriptEngine() = 0; - static QString engineError(QScriptEngine &scriptEngine); - -private: - void ensureEngineInitialized(); - - QScriptEngine m_engine; - ICore *m_core; - bool m_initialized; + // Run a script + virtual bool runScript(const QString &script, QString *errorMessage, Stack *errorStack) = 0; + virtual bool runScript(const QString &script, QString *errorMessage) = 0; }; -} // namespace Internal } // namespace Core #endif // SCRIPTMANAGER_H diff --git a/src/plugins/coreplugin/progressmanager/progressmanagerinterface.h b/src/plugins/coreplugin/scriptmanager/scriptmanager_p.h similarity index 61% rename from src/plugins/coreplugin/progressmanager/progressmanagerinterface.h rename to src/plugins/coreplugin/scriptmanager/scriptmanager_p.h index 8bb55cc96dd..40768f0fa9b 100644 --- a/src/plugins/coreplugin/progressmanager/progressmanagerinterface.h +++ b/src/plugins/coreplugin/scriptmanager/scriptmanager_p.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -31,33 +31,42 @@ ** ***************************************************************************/ -#ifndef PROGRESSMANAGERINTERFACE_H -#define PROGRESSMANAGERINTERFACE_H +#ifndef SCRIPTMANAGER_P_H +#define SCRIPTMANAGER_P_H -#include -#include +#include +#include #include -#include -#include +#include +#include namespace Core { +namespace Internal { -class CORE_EXPORT ProgressManagerInterface : public QObject +class ScriptManagerPrivate : public Core::ScriptManager { Q_OBJECT + public: - enum PersistentType { CloseOnSuccess, KeepOnFinish }; + ScriptManagerPrivate(QObject *parent, ICore *core); - ProgressManagerInterface(QObject *parent = 0) : QObject(parent) {} - virtual ~ProgressManagerInterface() {} + virtual QScriptEngine &scriptEngine(); - virtual FutureProgress *addTask(const QFuture &future, const QString &title, const QString &type, PersistentType persistency = KeepOnFinish) = 0; + virtual bool runScript(const QString &script, QString *errorMessage, Stack *stack); + virtual bool runScript(const QString &script, QString *errorMessage); -public slots: - virtual void cancelTasks(const QString &type) = 0; + static QString engineError(QScriptEngine &scriptEngine); + +private: + void ensureEngineInitialized(); + + QScriptEngine m_engine; + ICore *m_core; + bool m_initialized; }; +} // namespace Internal } // namespace Core -#endif //PROGRESSMANAGERINTERFACE_H +#endif // SCRIPTMANAGER_P_H diff --git a/src/plugins/coreplugin/sidebar.cpp b/src/plugins/coreplugin/sidebar.cpp index 17887450d9b..b84947d3706 100644 --- a/src/plugins/coreplugin/sidebar.cpp +++ b/src/plugins/coreplugin/sidebar.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -35,7 +35,7 @@ #include "imode.h" #include "modemanager.h" -#include "actionmanager/actionmanagerinterface.h" +#include "actionmanager/actionmanager.h" #include #include @@ -206,12 +206,12 @@ void SideBar::activateItem(SideBarItem *item) item->widget()->setFocus(); } -void SideBar::setShortcutMap(const QMap &shortcutMap) +void SideBar::setShortcutMap(const QMap &shortcutMap) { m_shortcutMap = shortcutMap; } -QMap SideBar::shortcutMap() const +QMap SideBar::shortcutMap() const { return m_shortcutMap; } @@ -341,10 +341,10 @@ void SideBarWidget::setCurrentIndex(int) emit currentWidgetChanged(); } -Core::ICommand *SideBarWidget::command(const QString &title) const +Core::Command *SideBarWidget::command(const QString &title) const { - const QMap shortcutMap = m_sideBar->shortcutMap(); - QMap::const_iterator r = shortcutMap.find(title); + const QMap shortcutMap = m_sideBar->shortcutMap(); + QMap::const_iterator r = shortcutMap.find(title); if (r != shortcutMap.end()) return r.value(); return 0; @@ -361,7 +361,7 @@ bool ComboBox::event(QEvent *e) { if (e->type() == QEvent::ToolTip) { QString txt = currentText(); - Core::ICommand *cmd = m_sideBarWidget->command(txt); + Core::Command *cmd = m_sideBarWidget->command(txt); if (cmd) { txt = tr("Activate %1").arg(txt); setToolTip(cmd->stringWithAppendedShortcut(txt)); diff --git a/src/plugins/coreplugin/sidebar.h b/src/plugins/coreplugin/sidebar.h index dd8e5727c19..e5b1f9c3afa 100644 --- a/src/plugins/coreplugin/sidebar.h +++ b/src/plugins/coreplugin/sidebar.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -50,7 +50,7 @@ QT_END_NAMESPACE namespace Core { -class ICommand; +class Command; namespace Internal { class SideBarWidget; @@ -110,8 +110,8 @@ public: void activateItem(SideBarItem *item); - void setShortcutMap(const QMap &shortcutMap); - QMap shortcutMap() const; + void setShortcutMap(const QMap &shortcutMap); + QMap shortcutMap() const; private slots: void split(); @@ -126,7 +126,7 @@ private: QMap m_itemMap; QStringList m_availableItems; QStringList m_defaultVisible; - QMap m_shortcutMap; + QMap m_shortcutMap; }; namespace Internal { @@ -144,7 +144,7 @@ public: void updateAvailableItems(); void removeCurrentItem(); - Core::ICommand *command(const QString &title) const; + Core::Command *command(const QString &title) const; signals: void split(); diff --git a/src/plugins/coreplugin/styleanimator.cpp b/src/plugins/coreplugin/styleanimator.cpp index fa8ccd93de2..f0fda1f512c 100644 --- a/src/plugins/coreplugin/styleanimator.cpp +++ b/src/plugins/coreplugin/styleanimator.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/styleanimator.h b/src/plugins/coreplugin/styleanimator.h index f4b6e9f95ce..7a75056af5d 100644 --- a/src/plugins/coreplugin/styleanimator.h +++ b/src/plugins/coreplugin/styleanimator.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/stylehelper.cpp b/src/plugins/coreplugin/stylehelper.cpp index 9fcb5180deb..b102f6e2086 100644 --- a/src/plugins/coreplugin/stylehelper.cpp +++ b/src/plugins/coreplugin/stylehelper.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/stylehelper.h b/src/plugins/coreplugin/stylehelper.h index ec46f9a1c57..3a1e8f5b4a2 100644 --- a/src/plugins/coreplugin/stylehelper.h +++ b/src/plugins/coreplugin/stylehelper.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/tabpositionindicator.cpp b/src/plugins/coreplugin/tabpositionindicator.cpp index 2de5da922b7..ae292a785a4 100644 --- a/src/plugins/coreplugin/tabpositionindicator.cpp +++ b/src/plugins/coreplugin/tabpositionindicator.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/tabpositionindicator.h b/src/plugins/coreplugin/tabpositionindicator.h index 4c5290596f2..55162cb838f 100644 --- a/src/plugins/coreplugin/tabpositionindicator.h +++ b/src/plugins/coreplugin/tabpositionindicator.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/uniqueidmanager.cpp b/src/plugins/coreplugin/uniqueidmanager.cpp index b06d6a7e590..475448935b1 100644 --- a/src/plugins/coreplugin/uniqueidmanager.cpp +++ b/src/plugins/coreplugin/uniqueidmanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/uniqueidmanager.h b/src/plugins/coreplugin/uniqueidmanager.h index 1aa8489685b..0a8ed6fcd07 100644 --- a/src/plugins/coreplugin/uniqueidmanager.h +++ b/src/plugins/coreplugin/uniqueidmanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/variablemanager.cpp b/src/plugins/coreplugin/variablemanager.cpp index 9a5c9dd783f..793ca04f1b7 100644 --- a/src/plugins/coreplugin/variablemanager.cpp +++ b/src/plugins/coreplugin/variablemanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/variablemanager.h b/src/plugins/coreplugin/variablemanager.h index 10a0efde9de..dc85e8dc3ff 100644 --- a/src/plugins/coreplugin/variablemanager.h +++ b/src/plugins/coreplugin/variablemanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/vcsmanager.cpp b/src/plugins/coreplugin/vcsmanager.cpp index c2f18a0b1cd..1ac0d698e1a 100644 --- a/src/plugins/coreplugin/vcsmanager.cpp +++ b/src/plugins/coreplugin/vcsmanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/vcsmanager.h b/src/plugins/coreplugin/vcsmanager.h index 753db773805..3947fc8cb62 100644 --- a/src/plugins/coreplugin/vcsmanager.h +++ b/src/plugins/coreplugin/vcsmanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/versiondialog.cpp b/src/plugins/coreplugin/versiondialog.cpp index 52810c00efc..a61e29e50d7 100644 --- a/src/plugins/coreplugin/versiondialog.cpp +++ b/src/plugins/coreplugin/versiondialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -76,7 +76,7 @@ VersionDialog::VersionDialog(QWidget *parent) #endif "
" "
" - "Copyright 2006-%3 %4. All rights reserved.
" + "Copyright 2008-%3 %4. All rights reserved.
" "
" "The program is provided AS IS with NO WARRANTY OF ANY KIND, " "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A " diff --git a/src/plugins/coreplugin/versiondialog.h b/src/plugins/coreplugin/versiondialog.h index c7ba26db0e9..bfa61f1d52d 100644 --- a/src/plugins/coreplugin/versiondialog.h +++ b/src/plugins/coreplugin/versiondialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/viewmanager.cpp b/src/plugins/coreplugin/viewmanager.cpp index 5032d45b4d4..0db47634729 100644 --- a/src/plugins/coreplugin/viewmanager.cpp +++ b/src/plugins/coreplugin/viewmanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -38,8 +38,8 @@ #include "uniqueidmanager.h" #include "iview.h" -#include -#include +#include +#include #include #include diff --git a/src/plugins/coreplugin/viewmanager.h b/src/plugins/coreplugin/viewmanager.h index c22e68d891d..80d24ed775c 100644 --- a/src/plugins/coreplugin/viewmanager.h +++ b/src/plugins/coreplugin/viewmanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/viewmanagerinterface.h b/src/plugins/coreplugin/viewmanagerinterface.h index 0eb21187ccb..24813cc9414 100644 --- a/src/plugins/coreplugin/viewmanagerinterface.h +++ b/src/plugins/coreplugin/viewmanagerinterface.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/welcomemode.cpp b/src/plugins/coreplugin/welcomemode.cpp index a0f5f98b998..ee66ac7f33c 100644 --- a/src/plugins/coreplugin/welcomemode.cpp +++ b/src/plugins/coreplugin/welcomemode.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/coreplugin/welcomemode.h b/src/plugins/coreplugin/welcomemode.h index 05ba96c3eee..bcd205072f8 100644 --- a/src/plugins/coreplugin/welcomemode.h +++ b/src/plugins/coreplugin/welcomemode.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp index 548c48be7d3..1ab4daa0a4a 100644 --- a/src/plugins/cpaster/cpasterplugin.cpp +++ b/src/plugins/cpaster/cpasterplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include @@ -95,17 +95,17 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m addObject(m_settingsPage); //register actions - Core::ActionManagerInterface *actionManager = gCoreInstance->actionManager(); + Core::ActionManager *actionManager = gCoreInstance->actionManager(); - Core::IActionContainer *toolsContainer = + Core::ActionContainer *toolsContainer = actionManager->actionContainer(Core::Constants::M_TOOLS); - Core::IActionContainer *cpContainer = + Core::ActionContainer *cpContainer = actionManager->createMenu(QLatin1String("CodePaster")); cpContainer->menu()->setTitle(tr("&CodePaster")); toolsContainer->addMenu(cpContainer); - Core::ICommand *command; + Core::Command *command; m_postAction = new QAction(tr("Paste snippet..."), this); command = actionManager->registerAction(m_postAction, "CodePaster.post", globalcontext); diff --git a/src/plugins/cpaster/cpasterplugin.h b/src/plugins/cpaster/cpasterplugin.h index 9940df0840c..b6694be562c 100644 --- a/src/plugins/cpaster/cpasterplugin.h +++ b/src/plugins/cpaster/cpasterplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cpaster/settingspage.cpp b/src/plugins/cpaster/settingspage.cpp index af35e7e576d..33363063617 100644 --- a/src/plugins/cpaster/settingspage.cpp +++ b/src/plugins/cpaster/settingspage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -86,11 +86,8 @@ QWidget *SettingsPage::createPage(QWidget *parent) return w; } -void SettingsPage::finished(bool accepted) +void SettingsPage::apply() { - if (!accepted) - return; - m_username = m_ui.userEdit->text(); m_server = QUrl(m_ui.serverEdit->text()); m_copy = m_ui.clipboardBox->isChecked(); diff --git a/src/plugins/cpaster/settingspage.h b/src/plugins/cpaster/settingspage.h index 9f2b4b25f7b..a492030752c 100644 --- a/src/plugins/cpaster/settingspage.h +++ b/src/plugins/cpaster/settingspage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -59,7 +59,8 @@ public: QString trCategory() const; QWidget *createPage(QWidget *parent); - void finished(bool accepted); + void apply(); + void finish() { } QString username() const; QUrl serverUrl() const; diff --git a/src/plugins/cppeditor/cppclasswizard.cpp b/src/plugins/cppeditor/cppclasswizard.cpp index 4ecb56b884c..ecdcc110197 100644 --- a/src/plugins/cppeditor/cppclasswizard.cpp +++ b/src/plugins/cppeditor/cppclasswizard.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cppeditor/cppclasswizard.h b/src/plugins/cppeditor/cppclasswizard.h index 177d8a1fbb1..b117dc7ad09 100644 --- a/src/plugins/cppeditor/cppclasswizard.h +++ b/src/plugins/cppeditor/cppclasswizard.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index 1eb298aa378..c8e9a946b90 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -55,7 +55,7 @@ #include #include -#include +#include #include #include #include @@ -657,7 +657,7 @@ void CPPEditor::contextMenuEvent(QContextMenuEvent *e) if (lastAction->menu() && QLatin1String(lastAction->menu()->metaObject()->className()) == QLatin1String("QUnicodeControlCharacterMenu")) menu->removeAction(lastAction); - Core::IActionContainer *mcontext = + Core::ActionContainer *mcontext = m_core->actionManager()->actionContainer(CppEditor::Constants::M_CONTEXT); QMenu *contextMenu = mcontext->menu(); diff --git a/src/plugins/cppeditor/cppeditor.h b/src/plugins/cppeditor/cppeditor.h index 3667b5d6f7f..6773a5308ae 100644 --- a/src/plugins/cppeditor/cppeditor.h +++ b/src/plugins/cppeditor/cppeditor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cppeditor/cppeditor_global.h b/src/plugins/cppeditor/cppeditor_global.h index c1d8f32db72..dad179aea73 100644 --- a/src/plugins/cppeditor/cppeditor_global.h +++ b/src/plugins/cppeditor/cppeditor_global.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cppeditor/cppeditoractionhandler.cpp b/src/plugins/cppeditor/cppeditoractionhandler.cpp index 4eb4543a679..f8f2510523b 100644 --- a/src/plugins/cppeditor/cppeditoractionhandler.cpp +++ b/src/plugins/cppeditor/cppeditoractionhandler.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cppeditor/cppeditoractionhandler.h b/src/plugins/cppeditor/cppeditoractionhandler.h index 6a0391c1e8a..12428c3343e 100644 --- a/src/plugins/cppeditor/cppeditoractionhandler.h +++ b/src/plugins/cppeditor/cppeditoractionhandler.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cppeditor/cppeditorconstants.h b/src/plugins/cppeditor/cppeditorconstants.h index 96359b0bb65..f0c7bff4c34 100644 --- a/src/plugins/cppeditor/cppeditorconstants.h +++ b/src/plugins/cppeditor/cppeditorconstants.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cppeditor/cppeditorenums.h b/src/plugins/cppeditor/cppeditorenums.h index 07398bac9d4..9b4ce75c0d7 100644 --- a/src/plugins/cppeditor/cppeditorenums.h +++ b/src/plugins/cppeditor/cppeditorenums.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cppeditor/cppfilewizard.cpp b/src/plugins/cppeditor/cppfilewizard.cpp index df464aa576f..d65fed17669 100644 --- a/src/plugins/cppeditor/cppfilewizard.cpp +++ b/src/plugins/cppeditor/cppfilewizard.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cppeditor/cppfilewizard.h b/src/plugins/cppeditor/cppfilewizard.h index adb94d911f4..51c91d9465c 100644 --- a/src/plugins/cppeditor/cppfilewizard.h +++ b/src/plugins/cppeditor/cppfilewizard.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cppeditor/cpphighlighter.cpp b/src/plugins/cppeditor/cpphighlighter.cpp index 0eb3b67e69b..f7d12b0add7 100644 --- a/src/plugins/cppeditor/cpphighlighter.cpp +++ b/src/plugins/cppeditor/cpphighlighter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cppeditor/cpphighlighter.h b/src/plugins/cppeditor/cpphighlighter.h index 3df54c26acb..3c74460e653 100644 --- a/src/plugins/cppeditor/cpphighlighter.h +++ b/src/plugins/cppeditor/cpphighlighter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cppeditor/cpphoverhandler.cpp b/src/plugins/cppeditor/cpphoverhandler.cpp index 6ebf51b2a2c..febf86f6510 100644 --- a/src/plugins/cppeditor/cpphoverhandler.cpp +++ b/src/plugins/cppeditor/cpphoverhandler.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cppeditor/cpphoverhandler.h b/src/plugins/cppeditor/cpphoverhandler.h index d8bd48031c3..27daccc35d7 100644 --- a/src/plugins/cppeditor/cpphoverhandler.h +++ b/src/plugins/cppeditor/cpphoverhandler.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cppeditor/cppplugin.cpp b/src/plugins/cppeditor/cppplugin.cpp index c30bc97f29d..077bea90274 100644 --- a/src/plugins/cppeditor/cppplugin.cpp +++ b/src/plugins/cppeditor/cppplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -44,8 +44,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -194,10 +194,10 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess QList context; context << m_core->uniqueIDManager()->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR); - Core::ActionManagerInterface *am = m_core->actionManager(); + Core::ActionManager *am = m_core->actionManager(); am->createMenu(CppEditor::Constants::M_CONTEXT); - Core::ICommand *cmd; + Core::Command *cmd; QAction *jumpToDefinition = new QAction(tr("Follow Symbol under Cursor"), this); cmd = am->registerAction(jumpToDefinition, diff --git a/src/plugins/cppeditor/cppplugin.h b/src/plugins/cppeditor/cppplugin.h index 42dae09c6f6..52655e6ae70 100644 --- a/src/plugins/cppeditor/cppplugin.h +++ b/src/plugins/cppeditor/cppplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cpptools/completionsettingspage.cpp b/src/plugins/cpptools/completionsettingspage.cpp index a885f45e06d..589b1b399e4 100644 --- a/src/plugins/cpptools/completionsettingspage.cpp +++ b/src/plugins/cpptools/completionsettingspage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -78,11 +78,8 @@ QWidget *CompletionSettingsPage::createPage(QWidget *parent) return w; } -void CompletionSettingsPage::finished(bool accepted) +void CompletionSettingsPage::apply() { - if (!accepted) - return; - m_completion->setCaseSensitivity( m_page->caseSensitive->isChecked() ? Qt::CaseSensitive : Qt::CaseInsensitive); m_completion->setAutoInsertBraces(m_page->autoInsertBraces->isChecked()); diff --git a/src/plugins/cpptools/completionsettingspage.h b/src/plugins/cpptools/completionsettingspage.h index b241ccd3b12..c59ed87e17d 100644 --- a/src/plugins/cpptools/completionsettingspage.h +++ b/src/plugins/cpptools/completionsettingspage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -56,7 +56,8 @@ public: QString trCategory() const; QWidget *createPage(QWidget *parent); - void finished(bool accepted); + void apply(); + void finish() { } private: CppCodeCompletion *m_completion; diff --git a/src/plugins/cpptools/cppclassesfilter.cpp b/src/plugins/cpptools/cppclassesfilter.cpp index 04c3bffd87b..212db82700b 100644 --- a/src/plugins/cpptools/cppclassesfilter.cpp +++ b/src/plugins/cpptools/cppclassesfilter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cpptools/cppclassesfilter.h b/src/plugins/cpptools/cppclassesfilter.h index 9cf52ac6829..a84931d64c7 100644 --- a/src/plugins/cpptools/cppclassesfilter.h +++ b/src/plugins/cpptools/cppclassesfilter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp index 2cd859ecb9e..573c9a25466 100644 --- a/src/plugins/cpptools/cppcodecompletion.cpp +++ b/src/plugins/cpptools/cppcodecompletion.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -77,7 +77,7 @@ namespace Internal { class FunctionArgumentWidget : public QLabel { public: FunctionArgumentWidget(Core::ICore *core); - void showFunctionHint(Function *functionSymbol); + void showFunctionHint(Function *functionSymbol, const Snapshot &snapshot); protected: bool eventFilter(QObject *obj, QEvent *e); @@ -94,6 +94,7 @@ private: QFrame *m_popupFrame; Function *m_item; + Snapshot m_snapshot; }; class ConvertToCompletionItem: protected NameVisitor @@ -212,9 +213,11 @@ FunctionArgumentWidget::FunctionArgumentWidget(Core::ICore *core) setMargin(1); } -void FunctionArgumentWidget::showFunctionHint(Function *functionSymbol) +void FunctionArgumentWidget::showFunctionHint(Function *functionSymbol, + const Snapshot &snapshot) { m_item = functionSymbol; + m_snapshot = snapshot; m_startpos = m_editor->position(); // update the text @@ -762,7 +765,7 @@ bool CppCodeCompletion::completeScope(const QList &res void CppCodeCompletion::addKeywords() { // keyword completion items. - for (int i = T_FIRST_KEYWORD; i < T_FIRST_QT_KEYWORD; ++i) { + for (int i = T_FIRST_KEYWORD; i < T_FIRST_OBJC_AT_KEYWORD; ++i) { TextEditor::CompletionItem item(this); item.m_text = QLatin1String(Token::name(i)); item.m_icon = m_icons.keywordIcon(); @@ -913,7 +916,7 @@ bool CppCodeCompletion::completeQtMethod(CPlusPlus::FullySpecifiedType, if (TextEditor::CompletionItem item = toCompletionItem(fun)) { unsigned count = fun->argumentCount(); while (true) { - TextEditor::CompletionItem i = item; + TextEditor::CompletionItem ci = item; QString signature; signature += overview.prettyName(fun->name()); @@ -934,8 +937,8 @@ bool CppCodeCompletion::completeQtMethod(CPlusPlus::FullySpecifiedType, if (! signatures.contains(signature)) { signatures.insert(signature); - i.m_text = signature; // fix the completion item. - m_completions.append(i); + ci.m_text = signature; // fix the completion item. + m_completions.append(ci); } if (count && fun->argumentAt(count - 1)->asArgument()->hasInitializer()) @@ -1023,7 +1026,7 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item) QTC_ASSERT(function, return); m_functionArgumentWidget = new FunctionArgumentWidget(m_core); - m_functionArgumentWidget->showFunctionHint(function); + m_functionArgumentWidget->showFunctionHint(function, typeOfExpression.snapshot()); } } else if (m_completionOperator == T_SIGNAL || m_completionOperator == T_SLOT) { QString toInsert = item.m_text; diff --git a/src/plugins/cpptools/cppcodecompletion.h b/src/plugins/cpptools/cppcodecompletion.h index 5720adbbc51..6d4690babca 100644 --- a/src/plugins/cpptools/cppcodecompletion.h +++ b/src/plugins/cpptools/cppcodecompletion.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cpptools/cppfunctionsfilter.cpp b/src/plugins/cpptools/cppfunctionsfilter.cpp index 3bf2137dff6..f9b031c68ae 100644 --- a/src/plugins/cpptools/cppfunctionsfilter.cpp +++ b/src/plugins/cpptools/cppfunctionsfilter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cpptools/cppfunctionsfilter.h b/src/plugins/cpptools/cppfunctionsfilter.h index f8476001d72..43145c95b49 100644 --- a/src/plugins/cpptools/cppfunctionsfilter.h +++ b/src/plugins/cpptools/cppfunctionsfilter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index df611294751..49e7cbfc7db 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -606,7 +606,7 @@ QFuture CppModelManager::refreshSourceFiles(const QStringList &sourceFiles if (sourceFiles.count() > 1) { m_core->progressManager()->addTask(result, tr("Indexing"), CppTools::Constants::TASK_INDEX, - Core::ProgressManagerInterface::CloseOnSuccess); + Core::ProgressManager::CloseOnSuccess); } return result; } diff --git a/src/plugins/cpptools/cppmodelmanager.h b/src/plugins/cpptools/cppmodelmanager.h index 570ee58f451..361c714fee7 100644 --- a/src/plugins/cpptools/cppmodelmanager.h +++ b/src/plugins/cpptools/cppmodelmanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cpptools/cppmodelmanagerinterface.h b/src/plugins/cpptools/cppmodelmanagerinterface.h index 0247c9c514e..ca1c57f8635 100644 --- a/src/plugins/cpptools/cppmodelmanagerinterface.h +++ b/src/plugins/cpptools/cppmodelmanagerinterface.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cpptools/cppquickopenfilter.cpp b/src/plugins/cpptools/cppquickopenfilter.cpp index 03bd8d78bb2..135876cf7d7 100644 --- a/src/plugins/cpptools/cppquickopenfilter.cpp +++ b/src/plugins/cpptools/cppquickopenfilter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cpptools/cppquickopenfilter.h b/src/plugins/cpptools/cppquickopenfilter.h index b867194f689..d52aee62ba6 100644 --- a/src/plugins/cpptools/cppquickopenfilter.h +++ b/src/plugins/cpptools/cppquickopenfilter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cpptools/cpptools_global.h b/src/plugins/cpptools/cpptools_global.h index 7b63a15b813..1793c738769 100644 --- a/src/plugins/cpptools/cpptools_global.h +++ b/src/plugins/cpptools/cpptools_global.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cpptools/cpptoolsconstants.h b/src/plugins/cpptools/cpptoolsconstants.h index 8279eef501d..42a0def4d6a 100644 --- a/src/plugins/cpptools/cpptoolsconstants.h +++ b/src/plugins/cpptools/cpptoolsconstants.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cpptools/cpptoolseditorsupport.cpp b/src/plugins/cpptools/cpptoolseditorsupport.cpp index 73e34e41132..5a907a2d175 100644 --- a/src/plugins/cpptools/cpptoolseditorsupport.cpp +++ b/src/plugins/cpptools/cpptoolseditorsupport.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cpptools/cpptoolseditorsupport.h b/src/plugins/cpptools/cpptoolseditorsupport.h index 042e5dcd1cf..2bce101e523 100644 --- a/src/plugins/cpptools/cpptoolseditorsupport.h +++ b/src/plugins/cpptools/cpptoolseditorsupport.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp index 866a3d05c94..5ec67bf4a35 100644 --- a/src/plugins/cpptools/cpptoolsplugin.cpp +++ b/src/plugins/cpptools/cpptoolsplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include @@ -81,7 +81,7 @@ CppToolsPlugin::~CppToolsPlugin() bool CppToolsPlugin::initialize(const QStringList & /*arguments*/, QString *) { m_core = ExtensionSystem::PluginManager::instance()->getObject(); - Core::ActionManagerInterface *am = m_core->actionManager(); + Core::ActionManager *am = m_core->actionManager(); // Objects m_modelManager = new CppModelManager(this); @@ -96,8 +96,8 @@ bool CppToolsPlugin::initialize(const QStringList & /*arguments*/, QString *) addAutoReleasedObject(new CompletionSettingsPage(m_completion)); // Menus - Core::IActionContainer *mtools = am->actionContainer(Core::Constants::M_TOOLS); - Core::IActionContainer *mcpptools = am->createMenu(CppTools::Constants::M_TOOLS_CPP); + Core::ActionContainer *mtools = am->actionContainer(Core::Constants::M_TOOLS); + Core::ActionContainer *mcpptools = am->createMenu(CppTools::Constants::M_TOOLS_CPP); QMenu *menu = mcpptools->menu(); menu->setTitle(tr("&C++")); menu->setEnabled(true); @@ -108,7 +108,7 @@ bool CppToolsPlugin::initialize(const QStringList & /*arguments*/, QString *) QList context = QList() << m_context; QAction *switchAction = new QAction(tr("Switch Header/Source"), this); - Core::ICommand *command = am->registerAction(switchAction, Constants::SWITCH_HEADER_SOURCE, context); + Core::Command *command = am->registerAction(switchAction, Constants::SWITCH_HEADER_SOURCE, context); command->setDefaultKeySequence(QKeySequence(Qt::Key_F4)); mcpptools->addAction(command); connect(switchAction, SIGNAL(triggered()), this, SLOT(switchHeaderSource())); diff --git a/src/plugins/cpptools/cpptoolsplugin.h b/src/plugins/cpptools/cpptoolsplugin.h index 39af36e86f1..a55630e6c04 100644 --- a/src/plugins/cpptools/cpptoolsplugin.h +++ b/src/plugins/cpptools/cpptoolsplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cpptools/searchsymbols.cpp b/src/plugins/cpptools/searchsymbols.cpp index 1d555fd6265..9e5c1160772 100644 --- a/src/plugins/cpptools/searchsymbols.cpp +++ b/src/plugins/cpptools/searchsymbols.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/cpptools/searchsymbols.h b/src/plugins/cpptools/searchsymbols.h index e3cba1f30fd..9e4fd1c2529 100644 --- a/src/plugins/cpptools/searchsymbols.h +++ b/src/plugins/cpptools/searchsymbols.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/attachexternaldialog.cpp b/src/plugins/debugger/attachexternaldialog.cpp index 7ca50470fb5..5177605ac81 100644 --- a/src/plugins/debugger/attachexternaldialog.cpp +++ b/src/plugins/debugger/attachexternaldialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/attachexternaldialog.h b/src/plugins/debugger/attachexternaldialog.h index d04d1bd61b5..83e5fbdc88b 100644 --- a/src/plugins/debugger/attachexternaldialog.h +++ b/src/plugins/debugger/attachexternaldialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/attachremotedialog.cpp b/src/plugins/debugger/attachremotedialog.cpp index e13d7b6ebc2..f7868bab0da 100644 --- a/src/plugins/debugger/attachremotedialog.cpp +++ b/src/plugins/debugger/attachremotedialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/attachremotedialog.h b/src/plugins/debugger/attachremotedialog.h index 5e0bee93490..7558284f04c 100644 --- a/src/plugins/debugger/attachremotedialog.h +++ b/src/plugins/debugger/attachremotedialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index 7f8d48da732..a03586e55e2 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/breakhandler.h b/src/plugins/debugger/breakhandler.h index 9d4c82ec205..31c24d352f2 100644 --- a/src/plugins/debugger/breakhandler.h +++ b/src/plugins/debugger/breakhandler.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/breakwindow.cpp b/src/plugins/debugger/breakwindow.cpp index a86f1b2e827..16ff2bcfd62 100644 --- a/src/plugins/debugger/breakwindow.cpp +++ b/src/plugins/debugger/breakwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/breakwindow.h b/src/plugins/debugger/breakwindow.h index 1db2175e8bb..4915b7fc5fa 100644 --- a/src/plugins/debugger/breakwindow.h +++ b/src/plugins/debugger/breakwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/debugger.pro b/src/plugins/debugger/debugger.pro index b47e7d5ee02..c9256caaa5f 100644 --- a/src/plugins/debugger/debugger.pro +++ b/src/plugins/debugger/debugger.pro @@ -22,7 +22,6 @@ HEADERS += attachexternaldialog.h \ debuggeroutputwindow.h \ debuggerplugin.h \ debuggerrunner.h \ - mode.h \ disassemblerhandler.h \ disassemblerwindow.h \ gdbengine.h \ @@ -52,7 +51,6 @@ SOURCES += attachexternaldialog.cpp \ debuggeroutputwindow.cpp \ debuggerplugin.cpp \ debuggerrunner.cpp \ - mode.cpp \ disassemblerhandler.cpp \ disassemblerwindow.cpp \ gdbengine.cpp \ diff --git a/src/plugins/debugger/debuggerconstants.h b/src/plugins/debugger/debuggerconstants.h index 5215870976a..7cec9b8ba59 100644 --- a/src/plugins/debugger/debuggerconstants.h +++ b/src/plugins/debugger/debuggerconstants.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -50,9 +50,7 @@ const char * const NEXT = "Debugger.NextLine"; const char * const STEPI = "Debugger.StepInstruction"; const char * const NEXTI = "Debugger.NextInstruction"; -const char * const M_VIEW_DEBUG = "Debugger.Menu.View.Debug"; -const char * const G_DEBUG = "Debugger.Group.Debug"; -const char * const G_VIEW_DEBUG = "Debugger.Group.View.Debug"; +const char * const M_DEBUG_VIEWS = "Debugger.Menu.View.Debug"; const char * const C_GDBDEBUGGER = "Gdb Debugger"; const char * const GDBRUNNING = "Gdb.Running"; diff --git a/src/plugins/debugger/debuggermanager.cpp b/src/plugins/debugger/debuggermanager.cpp index 2d6def04da4..f268fbb3dda 100644 --- a/src/plugins/debugger/debuggermanager.cpp +++ b/src/plugins/debugger/debuggermanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -483,11 +483,6 @@ IDebuggerManagerAccessForEngines *DebuggerManager::engineInterface() return dynamic_cast(this); } -IDebuggerManagerAccessForDebugMode *DebuggerManager::debugModeInterface() -{ - return dynamic_cast(this); -} - void DebuggerManager::createDockWidgets() { QSplitter *localsAndWatchers = new QSplitter(Qt::Vertical, 0); diff --git a/src/plugins/debugger/debuggermanager.h b/src/plugins/debugger/debuggermanager.h index 4ae7e66a87d..bde8ce449b1 100644 --- a/src/plugins/debugger/debuggermanager.h +++ b/src/plugins/debugger/debuggermanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -180,32 +180,12 @@ private: }; -// -// IDebuggerManagerAccessForDebugMode -// - -class IDebuggerManagerAccessForDebugMode -{ -public: - virtual ~IDebuggerManagerAccessForDebugMode() {} - -private: - friend class DebugMode; - - virtual QWidget *threadsWindow() const = 0; - virtual QLabel *statusLabel() const = 0; - virtual QList dockWidgets() const = 0; - virtual void createDockWidgets() = 0; -}; - - // // DebuggerManager // class DebuggerManager : public QObject, - public IDebuggerManagerAccessForEngines, - public IDebuggerManagerAccessForDebugMode + public IDebuggerManagerAccessForEngines { Q_OBJECT @@ -214,7 +194,6 @@ public: ~DebuggerManager(); IDebuggerManagerAccessForEngines *engineInterface(); - IDebuggerManagerAccessForDebugMode *debugModeInterface(); QMainWindow *mainWindow() const { return m_mainWindow; } QLabel *statusLabel() const { return m_statusLabel; } diff --git a/src/plugins/debugger/debuggeroutputwindow.cpp b/src/plugins/debugger/debuggeroutputwindow.cpp index 6818ee9620b..3a8afcde2aa 100644 --- a/src/plugins/debugger/debuggeroutputwindow.cpp +++ b/src/plugins/debugger/debuggeroutputwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/debuggeroutputwindow.h b/src/plugins/debugger/debuggeroutputwindow.h index d530d501e4b..5df743923a6 100644 --- a/src/plugins/debugger/debuggeroutputwindow.h +++ b/src/plugins/debugger/debuggeroutputwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index d65f9ac9acd..80acb59b92f 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -38,14 +38,19 @@ #include "debuggerrunner.h" #include "gdboptionpage.h" #include "gdbengine.h" -#include "mode.h" -#include +#include +#include #include #include +#include #include #include +#include #include +#include +#include +#include #include #include @@ -68,17 +73,18 @@ #include #include +#include +#include #include #include #include -using namespace Debugger::Internal; -using namespace Debugger::Constants; -using namespace TextEditor; using namespace Core; +using namespace Debugger::Constants; +using namespace Debugger::Internal; using namespace ProjectExplorer; -using namespace CPlusPlus; +using namespace TextEditor; namespace Debugger { @@ -137,6 +143,41 @@ const char * const ADD_TO_WATCH_KEY = "Ctrl+Alt+Q"; } // namespace Debugger +namespace Debugger { +namespace Internal { + +class DebugMode : public Core::BaseMode +{ + Q_OBJECT + +public: + DebugMode(QObject *parent = 0); + ~DebugMode(); + + // IMode + void activated() {} + void shutdown() {} +}; + +} // namespace Internal +} // namespace Debugger + +DebugMode::DebugMode(QObject *parent) + : BaseMode(parent) +{ + setName(tr("Debug")); + setUniqueModeName(Constants::MODE_DEBUG); + setIcon(QIcon(":/fancyactionbar/images/mode_Debug.png")); + setPriority(Constants::P_MODE_DEBUG); +} + +DebugMode::~DebugMode() +{ + // Make sure the editor manager does not get deleted + EditorManager::instance()->setParent(0); +} + + /////////////////////////////////////////////////////////////////////// // // LocationMark @@ -171,6 +212,7 @@ QIcon LocationMark::icon() const return icon; } + /////////////////////////////////////////////////////////////////////// // // DebuggerPlugin @@ -183,11 +225,17 @@ DebuggerPlugin::DebuggerPlugin() m_generalOptionPage = 0; m_locationMark = 0; m_manager = 0; + m_debugMode = 0; } DebuggerPlugin::~DebuggerPlugin() {} +static QSettings *settings() +{ + return ExtensionSystem::PluginManager::instance()->getObject()->settings(); +} + void DebuggerPlugin::shutdown() { if (m_debugMode) @@ -196,6 +244,8 @@ void DebuggerPlugin::shutdown() if (m_manager) m_manager->shutdown(); + writeSettings(); + //qDebug() << "DebuggerPlugin::~DebuggerPlugin"; removeObject(m_debugMode); removeObject(m_generalOptionPage); @@ -227,8 +277,8 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes ICore *core = m_pm->getObject(); QTC_ASSERT(core, return false); - Core::ActionManagerInterface *actionManager = core->actionManager(); - QTC_ASSERT(actionManager, return false); + Core::ActionManager *am = core->actionManager(); + QTC_ASSERT(am, return false); Core::UniqueIDManager *uidm = core->uniqueIDManager(); QTC_ASSERT(uidm, return false); @@ -256,151 +306,176 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes connect(m_breakpointMarginAction, SIGNAL(triggered()), this, SLOT(breakpointMarginActionTriggered())); - //Core::IActionContainer *mcppcontext = - // actionManager->actionContainer(CppEditor::Constants::M_CONTEXT); + //Core::ActionContainer *mcppcontext = + // am->actionContainer(CppEditor::Constants::M_CONTEXT); - Core::IActionContainer *mdebug = - actionManager->actionContainer(ProjectExplorer::Constants::M_DEBUG); + Core::ActionContainer *mdebug = + am->actionContainer(ProjectExplorer::Constants::M_DEBUG); - Core::ICommand *cmd = 0; - cmd = actionManager->registerAction(m_manager->m_startExternalAction, + Core::Command *cmd = 0; + cmd = am->registerAction(m_manager->m_startExternalAction, Constants::STARTEXTERNAL, globalcontext); mdebug->addAction(cmd, Core::Constants::G_DEFAULT_ONE); #ifndef Q_OS_WIN - cmd = actionManager->registerAction(m_manager->m_attachExternalAction, + cmd = am->registerAction(m_manager->m_attachExternalAction, Constants::ATTACHEXTERNAL, globalcontext); mdebug->addAction(cmd, Core::Constants::G_DEFAULT_ONE); #endif - cmd = actionManager->registerAction(m_manager->m_continueAction, + cmd = am->registerAction(m_manager->m_continueAction, ProjectExplorer::Constants::DEBUG, QList()<< m_gdbRunningContext); - cmd = actionManager->registerAction(m_manager->m_stopAction, + cmd = am->registerAction(m_manager->m_stopAction, Constants::INTERRUPT, globalcontext); - cmd->setAttribute(Core::ICommand::CA_UpdateText); - cmd->setAttribute(Core::ICommand::CA_UpdateIcon); + cmd->setAttribute(Core::Command::CA_UpdateText); + cmd->setAttribute(Core::Command::CA_UpdateIcon); cmd->setDefaultKeySequence(QKeySequence(Constants::INTERRUPT_KEY)); cmd->setDefaultText(tr("Stop Debugger/Interrupt Debugger")); mdebug->addAction(cmd, Core::Constants::G_DEFAULT_ONE); - cmd = actionManager->registerAction(m_manager->m_resetAction, + cmd = am->registerAction(m_manager->m_resetAction, Constants::RESET, globalcontext); - cmd->setAttribute(Core::ICommand::CA_UpdateText); + cmd->setAttribute(Core::Command::CA_UpdateText); cmd->setDefaultKeySequence(QKeySequence(Constants::RESET_KEY)); cmd->setDefaultText(tr("Reset Debugger")); //disabled mdebug->addAction(cmd, Core::Constants::G_DEFAULT_ONE); QAction *sep = new QAction(this); sep->setSeparator(true); - cmd = actionManager->registerAction(sep, - QLatin1String("GdbDebugger.Sep1"), globalcontext); + cmd = am->registerAction(sep, QLatin1String("Debugger.Sep1"), globalcontext); mdebug->addAction(cmd); - cmd = actionManager->registerAction(m_manager->m_nextAction, + cmd = am->registerAction(m_manager->m_nextAction, Constants::NEXT, debuggercontext); cmd->setDefaultKeySequence(QKeySequence(Constants::NEXT_KEY)); mdebug->addAction(cmd); - cmd = actionManager->registerAction(m_manager->m_stepAction, + cmd = am->registerAction(m_manager->m_stepAction, Constants::STEP, debuggercontext); cmd->setDefaultKeySequence(QKeySequence(Constants::STEP_KEY)); mdebug->addAction(cmd); - cmd = actionManager->registerAction(m_manager->m_stepOutAction, + cmd = am->registerAction(m_manager->m_stepOutAction, Constants::STEPOUT, debuggercontext); cmd->setDefaultKeySequence(QKeySequence(Constants::STEPOUT_KEY)); mdebug->addAction(cmd); - cmd = actionManager->registerAction(m_manager->m_nextIAction, + cmd = am->registerAction(m_manager->m_nextIAction, Constants::NEXTI, debuggercontext); cmd->setDefaultKeySequence(QKeySequence(Constants::NEXTI_KEY)); mdebug->addAction(cmd); - cmd = actionManager->registerAction(m_manager->m_stepIAction, + cmd = am->registerAction(m_manager->m_stepIAction, Constants::STEPI, debuggercontext); cmd->setDefaultKeySequence(QKeySequence(Constants::STEPI_KEY)); mdebug->addAction(cmd); - cmd = actionManager->registerAction(m_manager->m_runToLineAction, + cmd = am->registerAction(m_manager->m_runToLineAction, Constants::RUN_TO_LINE, debuggercontext); cmd->setDefaultKeySequence(QKeySequence(Constants::RUN_TO_LINE_KEY)); mdebug->addAction(cmd); - cmd = actionManager->registerAction(m_manager->m_runToFunctionAction, + cmd = am->registerAction(m_manager->m_runToFunctionAction, Constants::RUN_TO_FUNCTION, debuggercontext); cmd->setDefaultKeySequence(QKeySequence(Constants::RUN_TO_FUNCTION_KEY)); mdebug->addAction(cmd); - cmd = actionManager->registerAction(m_manager->m_jumpToLineAction, + cmd = am->registerAction(m_manager->m_jumpToLineAction, Constants::JUMP_TO_LINE, debuggercontext); mdebug->addAction(cmd); sep = new QAction(this); sep->setSeparator(true); - cmd = actionManager->registerAction(sep, - QLatin1String("GdbDebugger.Sep3"), globalcontext); + cmd = am->registerAction(sep, QLatin1String("Debugger.Sep3"), globalcontext); mdebug->addAction(cmd); - cmd = actionManager->registerAction(m_manager->m_breakAction, + cmd = am->registerAction(m_manager->m_breakAction, Constants::TOGGLE_BREAK, cppeditorcontext); cmd->setDefaultKeySequence(QKeySequence(Constants::TOGGLE_BREAK_KEY)); mdebug->addAction(cmd); //mcppcontext->addAction(cmd); - cmd = actionManager->registerAction(m_manager->m_breakByFunctionAction, + cmd = am->registerAction(m_manager->m_breakByFunctionAction, Constants::BREAK_BY_FUNCTION, globalcontext); mdebug->addAction(cmd); - cmd = actionManager->registerAction(m_manager->m_breakAtMainAction, + cmd = am->registerAction(m_manager->m_breakAtMainAction, Constants::BREAK_AT_MAIN, globalcontext); mdebug->addAction(cmd); sep = new QAction(this); sep->setSeparator(true); - cmd = actionManager->registerAction(sep, - QLatin1String("GdbDebugger.Sep2"), globalcontext); + cmd = am->registerAction(sep, QLatin1String("Debugger.Sep2"), globalcontext); mdebug->addAction(cmd); - cmd = actionManager->registerAction(m_manager->m_skipKnownFramesAction, + cmd = am->registerAction(m_manager->m_skipKnownFramesAction, Constants::SKIP_KNOWN_FRAMES, globalcontext); mdebug->addAction(cmd); - cmd = actionManager->registerAction(m_manager->m_useCustomDumpersAction, + cmd = am->registerAction(m_manager->m_useCustomDumpersAction, Constants::USE_CUSTOM_DUMPERS, globalcontext); mdebug->addAction(cmd); - cmd = actionManager->registerAction(m_manager->m_useFastStartAction, + cmd = am->registerAction(m_manager->m_useFastStartAction, Constants::USE_FAST_START, globalcontext); mdebug->addAction(cmd); - cmd = actionManager->registerAction(m_manager->m_useToolTipsAction, + cmd = am->registerAction(m_manager->m_useToolTipsAction, Constants::USE_TOOL_TIPS, globalcontext); mdebug->addAction(cmd); #ifdef QT_DEBUG - cmd = actionManager->registerAction(m_manager->m_dumpLogAction, + cmd = am->registerAction(m_manager->m_dumpLogAction, Constants::DUMP_LOG, globalcontext); //cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+D,Ctrl+L"))); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+F11"))); mdebug->addAction(cmd); - cmd = actionManager->registerAction(m_manager->m_debugDumpersAction, + cmd = am->registerAction(m_manager->m_debugDumpersAction, Constants::DEBUG_DUMPERS, debuggercontext); mdebug->addAction(cmd); #endif sep = new QAction(this); sep->setSeparator(true); - cmd = actionManager->registerAction(sep, - QLatin1String("GdbDebugger.Sep4"), globalcontext); + cmd = am->registerAction(sep, QLatin1String("Debugger.Sep4"), globalcontext); mdebug->addAction(cmd); - cmd = actionManager->registerAction(m_manager->m_watchAction, + cmd = am->registerAction(m_manager->m_watchAction, Constants::ADD_TO_WATCH, cppeditorcontext); //cmd->setDefaultKeySequence(QKeySequence(tr("ALT+D,ALT+W"))); mdebug->addAction(cmd); + // Views menu + cmd = am->registerAction(sep, QLatin1String("Debugger.Sep5"), globalcontext); + mdebug->addAction(cmd); + ActionContainer *viewsMenu = am->createMenu(Constants::M_DEBUG_VIEWS); + QMenu *m = viewsMenu->menu(); + m->setEnabled(true); + m->setTitle(tr("&Views")); + mdebug->addMenu(viewsMenu, Core::Constants::G_DEFAULT_THREE); + + m_toggleLockedAction = new QAction(tr("Locked"), this); + m_toggleLockedAction->setCheckable(true); + m_toggleLockedAction->setChecked(true); + connect(m_toggleLockedAction, SIGNAL(toggled(bool)), + m_manager, SLOT(setLocked(bool))); + foreach (QDockWidget *dockWidget, m_manager->dockWidgets()) { + cmd = am->registerAction(dockWidget->toggleViewAction(), + "Debugger." + dockWidget->objectName(), debuggercontext); + viewsMenu->addAction(cmd); + //m->addAction(dockWidget->toggleViewAction()); + } + m->addSeparator(); + m->addAction(m_toggleLockedAction); + m->addSeparator(); + + QAction *resetToSimpleAction = viewsMenu->menu()->addAction(tr("Reset to default layout")); + connect(resetToSimpleAction, SIGNAL(triggered()), + m_manager, SLOT(setSimpleDockWidgetArrangement())); + + m_generalOptionPage = 0; // FIXME: @@ -409,12 +484,98 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes m_locationMark = 0; - m_debugMode = new DebugMode(m_manager, this); + + // + // Debug mode setup + // + m_debugMode = new DebugMode(this); //addAutoReleasedObject(m_debugMode); - addObject(m_debugMode); addAutoReleasedObject(new DebuggerRunner(m_manager)); + QList context; + context.append(uidm->uniqueIdentifier(Core::Constants::C_EDITORMANAGER)); + context.append(uidm->uniqueIdentifier(Debugger::Constants::C_GDBDEBUGGER)); + context.append(uidm->uniqueIdentifier(Core::Constants::C_NAVIGATION_PANE)); + m_debugMode->setContext(context); + + QBoxLayout *editorHolderLayout = new QVBoxLayout; + editorHolderLayout->setMargin(0); + editorHolderLayout->setSpacing(0); + editorHolderLayout->addWidget(new EditorManagerPlaceHolder(m_debugMode)); + editorHolderLayout->addWidget(new FindToolBarPlaceHolder(m_debugMode)); + + QWidget *editorAndFindWidget = new QWidget; + editorAndFindWidget->setLayout(editorHolderLayout); + + MiniSplitter *rightPaneSplitter = new MiniSplitter; + rightPaneSplitter->addWidget(editorAndFindWidget); + rightPaneSplitter->addWidget(new RightPanePlaceHolder(m_debugMode)); + rightPaneSplitter->setStretchFactor(0, 1); + rightPaneSplitter->setStretchFactor(1, 0); + + QWidget *centralWidget = new QWidget; + + m_manager->mainWindow()->setCentralWidget(centralWidget); + + MiniSplitter *splitter = new MiniSplitter; + splitter->addWidget(m_manager->mainWindow()); + splitter->addWidget(new OutputPanePlaceHolder(m_debugMode)); + splitter->setStretchFactor(0, 10); + splitter->setStretchFactor(1, 0); + splitter->setOrientation(Qt::Vertical); + + MiniSplitter *splitter2 = new MiniSplitter; + splitter2 = new MiniSplitter; + splitter2->addWidget(new NavigationWidgetPlaceHolder(m_debugMode)); + splitter2->addWidget(splitter); + splitter2->setStretchFactor(0, 0); + splitter2->setStretchFactor(1, 1); + + m_debugMode->setWidget(splitter2); + + QToolBar *debugToolBar = new QToolBar; + debugToolBar->addAction(am->command(ProjectExplorer::Constants::DEBUG)->action()); + debugToolBar->addAction(am->command(Constants::INTERRUPT)->action()); + debugToolBar->addAction(am->command(Constants::NEXT)->action()); + debugToolBar->addAction(am->command(Constants::STEP)->action()); + debugToolBar->addAction(am->command(Constants::STEPOUT)->action()); + debugToolBar->addSeparator(); + debugToolBar->addAction(am->command(Constants::STEPI)->action()); + debugToolBar->addAction(am->command(Constants::NEXTI)->action()); + debugToolBar->addSeparator(); + debugToolBar->addWidget(new QLabel(tr("Threads:"))); + + QComboBox *threadBox = new QComboBox; + threadBox->setModel(m_manager->threadsModel()); + connect(threadBox, SIGNAL(activated(int)), + m_manager->threadsWindow(), SIGNAL(threadSelected(int))); + debugToolBar->addWidget(threadBox); + debugToolBar->addWidget(m_manager->statusLabel()); + + QWidget *stretch = new QWidget; + stretch->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); + debugToolBar->addWidget(stretch); + + QBoxLayout *toolBarAddingLayout = new QVBoxLayout(centralWidget); + toolBarAddingLayout->setMargin(0); + toolBarAddingLayout->setSpacing(0); + toolBarAddingLayout->addWidget(rightPaneSplitter); + toolBarAddingLayout->addWidget(debugToolBar); + + m_manager->createDockWidgets(); + m_manager->setSimpleDockWidgetArrangement(); + readSettings(); + + connect(ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)), + this, SLOT(focusCurrentEditor(Core::IMode*))); + m_debugMode->widget()->setFocusProxy(EditorManager::instance()); + addObject(m_debugMode); + + // + // Connections + // + // ProjectExplorer connect(projectExplorer()->session(), SIGNAL(sessionLoaded()), m_manager, SLOT(sessionLoaded())); @@ -567,7 +728,7 @@ void DebuggerPlugin::showToolTip(TextEditor::ITextEditor *editor, tc.movePosition(QTextCursor::EndOfWord); // Fetch the expression's code. - ExpressionUnderCursor expressionUnderCursor; + CPlusPlus::ExpressionUnderCursor expressionUnderCursor; expr = expressionUnderCursor(tc); } //qDebug() << " TOOLTIP EXPR " << expr; @@ -595,13 +756,13 @@ void DebuggerPlugin::querySessionValue(const QString &name, QVariant *value) void DebuggerPlugin::setConfigValue(const QString &name, const QVariant &value) { QTC_ASSERT(m_debugMode, return); - m_debugMode->settings()->setValue(name, value); + settings()->setValue(name, value); } void DebuggerPlugin::queryConfigValue(const QString &name, QVariant *value) { QTC_ASSERT(m_debugMode, return); - *value = m_debugMode->settings()->value(name); + *value = settings()->value(name); } void DebuggerPlugin::resetLocation() @@ -636,6 +797,37 @@ void DebuggerPlugin::changeStatus(int status) } } +void DebuggerPlugin::writeSettings() const +{ + QSettings *s = settings(); + QTC_ASSERT(m_manager, return); + QTC_ASSERT(m_manager->mainWindow(), return); + s->beginGroup(QLatin1String("DebugMode")); + s->setValue(QLatin1String("State"), m_manager->mainWindow()->saveState()); + s->setValue(QLatin1String("Locked"), m_toggleLockedAction->isChecked()); + s->endGroup(); +} + +void DebuggerPlugin::readSettings() +{ + QSettings *s = settings(); + s->beginGroup(QLatin1String("DebugMode")); + m_manager->mainWindow()->restoreState(s->value(QLatin1String("State"), QByteArray()).toByteArray()); + m_toggleLockedAction->setChecked(s->value(QLatin1String("Locked"), true).toBool()); + s->endGroup(); +} + +void DebuggerPlugin::focusCurrentEditor(IMode *mode) +{ + if (mode != m_debugMode) + return; + + EditorManager *editorManager = EditorManager::instance(); + + if (editorManager->currentEditor()) + editorManager->currentEditor()->widget()->setFocus(); +} + #include "debuggerplugin.moc" Q_EXPORT_PLUGIN(DebuggerPlugin) diff --git a/src/plugins/debugger/debuggerplugin.h b/src/plugins/debugger/debuggerplugin.h index 6dbc64ee74c..53f8490cfc3 100644 --- a/src/plugins/debugger/debuggerplugin.h +++ b/src/plugins/debugger/debuggerplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -90,8 +90,12 @@ private slots: void gotoLocation(const QString &fileName, int line, bool setMarker); void breakpointMarginActionTriggered(); + void focusCurrentEditor(Core::IMode *mode); private: + void readSettings(); + void writeSettings() const; + friend class DebuggerManager; friend class DebugMode; // FIXME: Just a hack now so that it can access the views @@ -108,6 +112,7 @@ private: int m_gdbRunningContext; QAction *m_breakpointMarginAction; + QAction *m_toggleLockedAction; int m_breakpointMarginActionLineNumber; QString m_breakpointMarginActionFileName; }; diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index e3e8728fde8..45eecd6514e 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/debuggerrunner.h b/src/plugins/debugger/debuggerrunner.h index 94ccddf8d14..c10a84e4795 100644 --- a/src/plugins/debugger/debuggerrunner.h +++ b/src/plugins/debugger/debuggerrunner.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/disassemblerhandler.cpp b/src/plugins/debugger/disassemblerhandler.cpp index c3ddd5fa506..ff935dabfdf 100644 --- a/src/plugins/debugger/disassemblerhandler.cpp +++ b/src/plugins/debugger/disassemblerhandler.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/disassemblerhandler.h b/src/plugins/debugger/disassemblerhandler.h index 0074be9217f..106b414eeb1 100644 --- a/src/plugins/debugger/disassemblerhandler.h +++ b/src/plugins/debugger/disassemblerhandler.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/disassemblerwindow.cpp b/src/plugins/debugger/disassemblerwindow.cpp index f23cd1b7a90..4545965e88b 100644 --- a/src/plugins/debugger/disassemblerwindow.cpp +++ b/src/plugins/debugger/disassemblerwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/disassemblerwindow.h b/src/plugins/debugger/disassemblerwindow.h index 28b49eb93d4..925081003d3 100644 --- a/src/plugins/debugger/disassemblerwindow.h +++ b/src/plugins/debugger/disassemblerwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp index fa6f9ab3250..3190d1612a3 100644 --- a/src/plugins/debugger/gdbengine.cpp +++ b/src/plugins/debugger/gdbengine.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/gdbengine.h b/src/plugins/debugger/gdbengine.h index 000c0b84a95..f5a7c658b76 100644 --- a/src/plugins/debugger/gdbengine.h +++ b/src/plugins/debugger/gdbengine.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/gdbmi.cpp b/src/plugins/debugger/gdbmi.cpp index 5f20b217317..88060d7b350 100644 --- a/src/plugins/debugger/gdbmi.cpp +++ b/src/plugins/debugger/gdbmi.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/gdbmi.h b/src/plugins/debugger/gdbmi.h index dbe2ef73c37..0e6c36e9756 100644 --- a/src/plugins/debugger/gdbmi.h +++ b/src/plugins/debugger/gdbmi.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/gdboptionpage.cpp b/src/plugins/debugger/gdboptionpage.cpp index efbb959fcf0..7c7a2700b6a 100644 --- a/src/plugins/debugger/gdboptionpage.cpp +++ b/src/plugins/debugger/gdboptionpage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -122,11 +122,8 @@ void GdbOptionPage::onScriptFileChanged() m_settings->m_scriptFile = m_ui.scriptFileChooser->path(); } -void GdbOptionPage::finished(bool accepted) +void GdbOptionPage::apply() { - if (!accepted) - return; - m_settings->m_gdbCmd = m_ui.gdbLocationChooser->path(); m_settings->m_gdbEnv = m_ui.environmentEdit->text(); m_settings->m_autoRun = m_ui.autoStartBox->isChecked(); diff --git a/src/plugins/debugger/gdboptionpage.h b/src/plugins/debugger/gdboptionpage.h index bb48d9e3492..c4c3ade9e31 100644 --- a/src/plugins/debugger/gdboptionpage.h +++ b/src/plugins/debugger/gdboptionpage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -59,7 +59,8 @@ public: QString trCategory() const; QWidget *createPage(QWidget *parent); - void finished(bool accepted); + void apply(); + void finish() { } public slots: void onGdbLocationChanged(); diff --git a/src/plugins/debugger/gdbtypemacros.cpp b/src/plugins/debugger/gdbtypemacros.cpp index 26d7aebf441..d392a836f0e 100644 --- a/src/plugins/debugger/gdbtypemacros.cpp +++ b/src/plugins/debugger/gdbtypemacros.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/idebuggerengine.h b/src/plugins/debugger/idebuggerengine.h index 5ab4ce066bc..50fbafda559 100644 --- a/src/plugins/debugger/idebuggerengine.h +++ b/src/plugins/debugger/idebuggerengine.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/imports.h b/src/plugins/debugger/imports.h index 644067d4f35..fa8e7413f86 100644 --- a/src/plugins/debugger/imports.h +++ b/src/plugins/debugger/imports.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/mode.cpp b/src/plugins/debugger/mode.cpp deleted file mode 100644 index 44994148583..00000000000 --- a/src/plugins/debugger/mode.cpp +++ /dev/null @@ -1,239 +0,0 @@ -/*************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Qt Software Information (qt-info@nokia.com) -** -** -** Non-Open Source Usage -** -** Licensees may use this file in accordance with the Qt Beta Version -** License Agreement, Agreement version 2.2 provided with the Software or, -** alternatively, in accordance with the terms contained in a written -** agreement between you and Nokia. -** -** GNU General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the packaging -** of this file. Please review the following information to ensure GNU -** General Public Licensing requirements will be met: -** -** http://www.fsf.org/licensing/licenses/info/GPLv2.html and -** http://www.gnu.org/copyleft/gpl.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt GPL Exception -** version 1.3, included in the file GPL_EXCEPTION.txt in this package. -** -***************************************************************************/ - -#include "mode.h" - -#include "debuggerconstants.h" -#include "debuggermanager.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include -#include - -#include -#include -#include -#include -#include - -using namespace Core; -using namespace ExtensionSystem; -using namespace Debugger; -using namespace Debugger::Internal; -using namespace Debugger::Constants; - - -DebugMode::DebugMode(DebuggerManager *manager, QObject *parent) - : BaseMode(tr("Debug"), Constants::MODE_DEBUG, - QIcon(":/fancyactionbar/images/mode_Debug.png"), - Constants::P_MODE_DEBUG, 0, parent), - m_manager(manager) -{ - IDebuggerManagerAccessForDebugMode *managerAccess = - m_manager->debugModeInterface(); - UniqueIDManager *uidm = - PluginManager::instance()->getObject()->uniqueIDManager(); - QList context; - context.append(uidm->uniqueIdentifier(Core::Constants::C_EDITORMANAGER)); - context.append(uidm->uniqueIdentifier(Constants::C_GDBDEBUGGER)); - context.append(uidm->uniqueIdentifier(Core::Constants::C_NAVIGATION_PANE)); - setContext(context); - - QBoxLayout *editorHolderLayout = new QVBoxLayout; - editorHolderLayout->setMargin(0); - editorHolderLayout->setSpacing(0); - editorHolderLayout->addWidget(new EditorManagerPlaceHolder(this)); - editorHolderLayout->addWidget(new FindToolBarPlaceHolder(this)); - - QWidget *editorAndFindWidget = new QWidget; - editorAndFindWidget->setLayout(editorHolderLayout); - - MiniSplitter *rightPaneSplitter = new MiniSplitter; - rightPaneSplitter->addWidget(editorAndFindWidget); - rightPaneSplitter->addWidget(new RightPanePlaceHolder(this)); - rightPaneSplitter->setStretchFactor(0, 1); - rightPaneSplitter->setStretchFactor(1, 0); - - QWidget *centralWidget = new QWidget; - QBoxLayout *toolBarAddingLayout = new QVBoxLayout(centralWidget); - toolBarAddingLayout->setMargin(0); - toolBarAddingLayout->setSpacing(0); - toolBarAddingLayout->addWidget(rightPaneSplitter); - - m_manager->mainWindow()->setCentralWidget(centralWidget); - - MiniSplitter *splitter = new MiniSplitter; - splitter->addWidget(m_manager->mainWindow()); - splitter->addWidget(new OutputPanePlaceHolder(this)); - splitter->setStretchFactor(0, 10); - splitter->setStretchFactor(1, 0); - splitter->setOrientation(Qt::Vertical); - - MiniSplitter *splitter2 = new MiniSplitter; - splitter2 = new MiniSplitter; - splitter2->addWidget(new NavigationWidgetPlaceHolder(this)); - splitter2->addWidget(splitter); - splitter2->setStretchFactor(0, 0); - splitter2->setStretchFactor(1, 1); - - setWidget(splitter2); - - QToolBar *toolBar = createToolBar(); - toolBarAddingLayout->addWidget(toolBar); - - managerAccess->createDockWidgets(); - m_manager->setSimpleDockWidgetArrangement(); - readSettings(); - - connect(ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)), - this, SLOT(focusCurrentEditor(Core::IMode*))); - widget()->setFocusProxy(EditorManager::instance()); -} - -DebugMode::~DebugMode() -{ - // Make sure the editor manager does not get deleted - EditorManager::instance()->setParent(0); -} - -void DebugMode::shutdown() -{ - writeSettings(); -} - -QToolBar *DebugMode::createToolBar() -{ - IDebuggerManagerAccessForDebugMode *managerAccess = - m_manager->debugModeInterface(); - - Core::ActionManagerInterface *am = - ExtensionSystem::PluginManager::instance() - ->getObject()->actionManager(); - QToolBar *debugToolBar = new QToolBar; - debugToolBar->addAction(am->command(ProjectExplorer::Constants::DEBUG)->action()); - debugToolBar->addAction(am->command(Constants::INTERRUPT)->action()); - debugToolBar->addAction(am->command(Constants::NEXT)->action()); - debugToolBar->addAction(am->command(Constants::STEP)->action()); - debugToolBar->addAction(am->command(Constants::STEPOUT)->action()); - debugToolBar->addSeparator(); - debugToolBar->addAction(am->command(Constants::STEPI)->action()); - debugToolBar->addAction(am->command(Constants::NEXTI)->action()); - debugToolBar->addSeparator(); - debugToolBar->addWidget(new QLabel(tr("Threads:"))); - - QComboBox *threadBox = new QComboBox; - threadBox->setModel(m_manager->threadsModel()); - connect(threadBox, SIGNAL(activated(int)), - managerAccess->threadsWindow(), SIGNAL(threadSelected(int))); - debugToolBar->addWidget(threadBox); - - debugToolBar->addWidget(managerAccess->statusLabel()); - - QWidget *stretch = new QWidget; - stretch->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); - debugToolBar->addWidget(stretch); - - QMenu *viewMenu = new QMenu(debugToolBar); - m_toggleLockedAction = new QAction(tr("Locked"), viewMenu); - m_toggleLockedAction->setCheckable(true); - m_toggleLockedAction->setChecked(true); - connect(m_toggleLockedAction, SIGNAL(toggled(bool)), - m_manager, SLOT(setLocked(bool))); - foreach (QDockWidget *dockWidget, managerAccess->dockWidgets()) - viewMenu->addAction(dockWidget->toggleViewAction()); - viewMenu->addSeparator(); - viewMenu->addAction(m_toggleLockedAction); - viewMenu->addSeparator(); - - QAction *resetToSimpleAction = viewMenu->addAction(tr("Reset to default layout")); - connect(resetToSimpleAction, SIGNAL(triggered()), - m_manager, SLOT(setSimpleDockWidgetArrangement())); - QToolButton *viewMenuButton = new QToolButton(debugToolBar); - viewMenuButton->setText(tr("View ")); - viewMenuButton->setPopupMode(QToolButton::InstantPopup); - viewMenuButton->setMenu(viewMenu); - debugToolBar->addWidget(viewMenuButton); - - return debugToolBar; -} - -void DebugMode::focusCurrentEditor(IMode *mode) -{ - if (mode != this) - return; - - EditorManager *editorManager = EditorManager::instance(); - - if (editorManager->currentEditor()) - editorManager->currentEditor()->widget()->setFocus(); -} - -void DebugMode::writeSettings() const -{ - QSettings *s = settings(); - QTC_ASSERT(m_manager, return); - QTC_ASSERT(m_manager->mainWindow(), return); - s->beginGroup(QLatin1String("DebugMode")); - s->setValue(QLatin1String("State"), m_manager->mainWindow()->saveState()); - s->setValue(QLatin1String("Locked"), m_toggleLockedAction->isChecked()); - s->endGroup(); -} - -void DebugMode::readSettings() -{ - QSettings *s = settings(); - s->beginGroup(QLatin1String("DebugMode")); - m_manager->mainWindow()->restoreState(s->value(QLatin1String("State"), QByteArray()).toByteArray()); - m_toggleLockedAction->setChecked(s->value(QLatin1String("Locked"), true).toBool()); - s->endGroup(); -} - -QSettings *DebugMode::settings() -{ - return PluginManager::instance()->getObject()->settings(); -} diff --git a/src/plugins/debugger/moduleshandler.cpp b/src/plugins/debugger/moduleshandler.cpp index 782fb6f9f7f..e87c92a73d2 100644 --- a/src/plugins/debugger/moduleshandler.cpp +++ b/src/plugins/debugger/moduleshandler.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/moduleshandler.h b/src/plugins/debugger/moduleshandler.h index 9c7a3570b75..4db8c6fe7ad 100644 --- a/src/plugins/debugger/moduleshandler.h +++ b/src/plugins/debugger/moduleshandler.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/moduleswindow.cpp b/src/plugins/debugger/moduleswindow.cpp index 1e2d2c492c9..5a1273c2942 100644 --- a/src/plugins/debugger/moduleswindow.cpp +++ b/src/plugins/debugger/moduleswindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/moduleswindow.h b/src/plugins/debugger/moduleswindow.h index e2b9b57e568..95dfec746a7 100644 --- a/src/plugins/debugger/moduleswindow.h +++ b/src/plugins/debugger/moduleswindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/procinterrupt.cpp b/src/plugins/debugger/procinterrupt.cpp index 801dbbc8dc3..08f7d392805 100644 --- a/src/plugins/debugger/procinterrupt.cpp +++ b/src/plugins/debugger/procinterrupt.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/procinterrupt.h b/src/plugins/debugger/procinterrupt.h index 9af88d33578..c98f780a3fb 100644 --- a/src/plugins/debugger/procinterrupt.h +++ b/src/plugins/debugger/procinterrupt.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/registerhandler.cpp b/src/plugins/debugger/registerhandler.cpp index b37fe752e8f..e594326009a 100644 --- a/src/plugins/debugger/registerhandler.cpp +++ b/src/plugins/debugger/registerhandler.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/registerhandler.h b/src/plugins/debugger/registerhandler.h index 0b580d22d9f..4c038f41eee 100644 --- a/src/plugins/debugger/registerhandler.h +++ b/src/plugins/debugger/registerhandler.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/registerwindow.cpp b/src/plugins/debugger/registerwindow.cpp index 1721aa09fba..339b09609e5 100644 --- a/src/plugins/debugger/registerwindow.cpp +++ b/src/plugins/debugger/registerwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/registerwindow.h b/src/plugins/debugger/registerwindow.h index 773ee93108a..958535378f7 100644 --- a/src/plugins/debugger/registerwindow.h +++ b/src/plugins/debugger/registerwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/scriptengine.cpp b/src/plugins/debugger/scriptengine.cpp index 14b0d8a49de..b868dcd99ad 100644 --- a/src/plugins/debugger/scriptengine.cpp +++ b/src/plugins/debugger/scriptengine.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/scriptengine.h b/src/plugins/debugger/scriptengine.h index 8330826ef8e..0f7cc47ac1f 100644 --- a/src/plugins/debugger/scriptengine.h +++ b/src/plugins/debugger/scriptengine.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/stackhandler.cpp b/src/plugins/debugger/stackhandler.cpp index 85abf6f7488..70d0b22ab06 100644 --- a/src/plugins/debugger/stackhandler.cpp +++ b/src/plugins/debugger/stackhandler.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/stackhandler.h b/src/plugins/debugger/stackhandler.h index 53c941881e4..1e68d001f3b 100644 --- a/src/plugins/debugger/stackhandler.h +++ b/src/plugins/debugger/stackhandler.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/stackwindow.cpp b/src/plugins/debugger/stackwindow.cpp index 2ef86a3d3b1..d40f8a3c5ff 100644 --- a/src/plugins/debugger/stackwindow.cpp +++ b/src/plugins/debugger/stackwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/stackwindow.h b/src/plugins/debugger/stackwindow.h index 7955b7f4eb5..cea4dcffa4a 100644 --- a/src/plugins/debugger/stackwindow.h +++ b/src/plugins/debugger/stackwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/startexternaldialog.cpp b/src/plugins/debugger/startexternaldialog.cpp index ba88f5f74c2..465b8acec04 100644 --- a/src/plugins/debugger/startexternaldialog.cpp +++ b/src/plugins/debugger/startexternaldialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/startexternaldialog.h b/src/plugins/debugger/startexternaldialog.h index 0707252774d..12074057307 100644 --- a/src/plugins/debugger/startexternaldialog.h +++ b/src/plugins/debugger/startexternaldialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/threadswindow.cpp b/src/plugins/debugger/threadswindow.cpp index 99cb74d93bf..bf418cd0fc5 100644 --- a/src/plugins/debugger/threadswindow.cpp +++ b/src/plugins/debugger/threadswindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/threadswindow.h b/src/plugins/debugger/threadswindow.h index 373bb0804ec..afc50a7638f 100644 --- a/src/plugins/debugger/threadswindow.h +++ b/src/plugins/debugger/threadswindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 25fa770823d..b2c43b28f64 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/watchhandler.h b/src/plugins/debugger/watchhandler.h index 4c2a20b167f..763d04b89b2 100644 --- a/src/plugins/debugger/watchhandler.h +++ b/src/plugins/debugger/watchhandler.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index 97d27d5f016..f357c451061 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/debugger/watchwindow.h b/src/plugins/debugger/watchwindow.h index 4a13ac65955..42a2928974f 100644 --- a/src/plugins/debugger/watchwindow.h +++ b/src/plugins/debugger/watchwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/cpp/formclasswizard.cpp b/src/plugins/designer/cpp/formclasswizard.cpp index be21968a58c..b4e618490d4 100644 --- a/src/plugins/designer/cpp/formclasswizard.cpp +++ b/src/plugins/designer/cpp/formclasswizard.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/cpp/formclasswizard.h b/src/plugins/designer/cpp/formclasswizard.h index 028ed199cc3..39b99c92037 100644 --- a/src/plugins/designer/cpp/formclasswizard.h +++ b/src/plugins/designer/cpp/formclasswizard.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/cpp/formclasswizarddialog.cpp b/src/plugins/designer/cpp/formclasswizarddialog.cpp index 3250961d63d..748e1b1d021 100644 --- a/src/plugins/designer/cpp/formclasswizarddialog.cpp +++ b/src/plugins/designer/cpp/formclasswizarddialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/cpp/formclasswizarddialog.h b/src/plugins/designer/cpp/formclasswizarddialog.h index f4f3d947cc7..4c61e5f09c7 100644 --- a/src/plugins/designer/cpp/formclasswizarddialog.h +++ b/src/plugins/designer/cpp/formclasswizarddialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/cpp/formclasswizardpage.cpp b/src/plugins/designer/cpp/formclasswizardpage.cpp index 3a0e0065926..6cc0ced4215 100644 --- a/src/plugins/designer/cpp/formclasswizardpage.cpp +++ b/src/plugins/designer/cpp/formclasswizardpage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/cpp/formclasswizardpage.h b/src/plugins/designer/cpp/formclasswizardpage.h index b5270fa42de..8643c67dd99 100644 --- a/src/plugins/designer/cpp/formclasswizardpage.h +++ b/src/plugins/designer/cpp/formclasswizardpage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/cpp/formclasswizardparameters.cpp b/src/plugins/designer/cpp/formclasswizardparameters.cpp index 2441cddc3a0..81c67331de3 100644 --- a/src/plugins/designer/cpp/formclasswizardparameters.cpp +++ b/src/plugins/designer/cpp/formclasswizardparameters.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/cpp/formclasswizardparameters.h b/src/plugins/designer/cpp/formclasswizardparameters.h index 169ff2446bc..e68ce952304 100644 --- a/src/plugins/designer/cpp/formclasswizardparameters.h +++ b/src/plugins/designer/cpp/formclasswizardparameters.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/designerconstants.h b/src/plugins/designer/designerconstants.h index f2458816d2f..0f4024f2b9a 100644 --- a/src/plugins/designer/designerconstants.h +++ b/src/plugins/designer/designerconstants.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/editorwidget.cpp b/src/plugins/designer/editorwidget.cpp index a6654411acc..71e28de7ba2 100644 --- a/src/plugins/designer/editorwidget.cpp +++ b/src/plugins/designer/editorwidget.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/editorwidget.h b/src/plugins/designer/editorwidget.h index e144f486982..83a7b264197 100644 --- a/src/plugins/designer/editorwidget.h +++ b/src/plugins/designer/editorwidget.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/formeditorfactory.cpp b/src/plugins/designer/formeditorfactory.cpp index 684ad07e8a9..81d910ee9df 100644 --- a/src/plugins/designer/formeditorfactory.cpp +++ b/src/plugins/designer/formeditorfactory.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/formeditorfactory.h b/src/plugins/designer/formeditorfactory.h index 8de03dc4e53..02ad78fdb2d 100644 --- a/src/plugins/designer/formeditorfactory.h +++ b/src/plugins/designer/formeditorfactory.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/formeditorplugin.cpp b/src/plugins/designer/formeditorplugin.cpp index 3f1895e0fe1..bc9f6a23337 100644 --- a/src/plugins/designer/formeditorplugin.cpp +++ b/src/plugins/designer/formeditorplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/formeditorplugin.h b/src/plugins/designer/formeditorplugin.h index fdcdfdb84f9..5743ab3f763 100644 --- a/src/plugins/designer/formeditorplugin.h +++ b/src/plugins/designer/formeditorplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/formeditorw.cpp b/src/plugins/designer/formeditorw.cpp index b0274ad27e1..e302eabb3c1 100644 --- a/src/plugins/designer/formeditorw.cpp +++ b/src/plugins/designer/formeditorw.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -41,7 +41,7 @@ #include #include -#include +#include #include #include @@ -99,8 +99,8 @@ static inline QIcon designerIcon(const QString &iconName) // Create an action to activate a designer tool static inline QAction *createEditModeAction(QActionGroup *ag, const QList &context, - Core::ActionManagerInterface *am, - Core::IActionContainer *medit, + Core::ActionManager *am, + Core::ActionContainer *medit, const QString &actionName, const QString &name, int toolNumber, @@ -111,10 +111,10 @@ static inline QAction *createEditModeAction(QActionGroup *ag, rc->setCheckable(true); if (!iconName.isEmpty()) rc->setIcon(designerIcon(iconName)); - Core::ICommand *command = am->registerAction(rc, name, context); + Core::Command *command = am->registerAction(rc, name, context); if (!keySequence.isEmpty()) command->setDefaultKeySequence(QKeySequence(keySequence)); - command->setAttribute(Core::ICommand::CA_Hide); + command->setAttribute(Core::Command::CA_Hide); medit->addAction(command, Core::Constants::G_EDIT_OTHER); rc->setData(toolNumber); ag->addAction(rc); @@ -124,28 +124,28 @@ static inline QAction *createEditModeAction(QActionGroup *ag, // Create a menu separato static inline QAction * createSeparator(QObject *parent, - Core::ActionManagerInterface *am, + Core::ActionManager *am, const QList &context, - Core::IActionContainer *container, + Core::ActionContainer *container, const QString &name = QString(), const QString &group = QString()) { QAction *actSeparator = new QAction(parent); actSeparator->setSeparator(true); - Core::ICommand *command = am->registerAction(actSeparator, name, context); + Core::Command *command = am->registerAction(actSeparator, name, context); container->addAction(command, group); return actSeparator; } // Create a tool action static inline void addToolAction(QAction *a, - Core::ActionManagerInterface *am, + Core::ActionManager *am, const QList &context, const QString &name, - Core::IActionContainer *c1, + Core::ActionContainer *c1, const QString &keySequence = QString()) { - Core::ICommand *command = am->registerAction(a, name, context); + Core::Command *command = am->registerAction(a, name, context); if (!keySequence.isEmpty()) command->setDefaultKeySequence(QKeySequence(keySequence)); c1->addAction(command); @@ -305,16 +305,16 @@ void FormEditorW::deleteInstance() void FormEditorW::setupActions() { - Core::ActionManagerInterface *am = m_core->actionManager(); - Core::ICommand *command; + Core::ActionManager *am = m_core->actionManager(); + Core::Command *command; //menus - Core::IActionContainer *medit = + Core::ActionContainer *medit = am->actionContainer(Core::Constants::M_EDIT); - Core::IActionContainer *mtools = + Core::ActionContainer *mtools = am->actionContainer(Core::Constants::M_TOOLS); - Core::IActionContainer *mformtools = + Core::ActionContainer *mformtools = am->createMenu(M_FORMEDITOR); mformtools->menu()->setTitle(tr("For&m editor")); mtools->addMenu(mformtools); @@ -334,7 +334,7 @@ void FormEditorW::setupActions() //'delete' action command = am->registerAction(m_fwm->actionDelete(), QLatin1String("FormEditor.Edit.Delete"), m_context); command->setDefaultKeySequence(QKeySequence::Delete); - command->setAttribute(Core::ICommand::CA_Hide); + command->setAttribute(Core::Command::CA_Hide); medit->addAction(command, Core::Constants::G_EDIT_COPYPASTE); //editor Modes. Store ids for editor tool bars @@ -443,10 +443,10 @@ QToolBar *FormEditorW::createEditorToolBar() const { QToolBar *rc = new QToolBar; rc->addSeparator(); - Core::ActionManagerInterface *am = m_core->actionManager(); + Core::ActionManager *am = m_core->actionManager(); const QStringList::const_iterator cend = m_toolActionIds.constEnd(); for (QStringList::const_iterator it = m_toolActionIds.constBegin(); it != cend; ++it) { - Core::ICommand *cmd = am->command(*it); + Core::Command *cmd = am->command(*it); QTC_ASSERT(cmd, continue); QAction *action = cmd->action(); if (!action->icon().isNull()) // Simplify grid has no action yet @@ -457,11 +457,11 @@ QToolBar *FormEditorW::createEditorToolBar() const return rc; } -Core::IActionContainer *FormEditorW::createPreviewStyleMenu(Core::ActionManagerInterface *am, +Core::ActionContainer *FormEditorW::createPreviewStyleMenu(Core::ActionManager *am, QActionGroup *actionGroup) { const QString menuId = QLatin1String(M_FORMEDITOR_PREVIEW); - Core::IActionContainer *menuPreviewStyle = am->createMenu(menuId); + Core::ActionContainer *menuPreviewStyle = am->createMenu(menuId); menuPreviewStyle->menu()->setTitle(tr("Preview in")); // The preview menu is a list of invisible actions for the embedded design @@ -483,10 +483,10 @@ Core::IActionContainer *FormEditorW::createPreviewStyleMenu(Core::ActionManagerI name += dot; } name += data.toString(); - Core::ICommand *command = am->registerAction(a, name, m_context); + Core::Command *command = am->registerAction(a, name, m_context); if (isDeviceProfile) { - command->setAttribute(Core::ICommand::CA_UpdateText); - command->setAttribute(Core::ICommand::CA_NonConfigureable); + command->setAttribute(Core::Command::CA_UpdateText); + command->setAttribute(Core::Command::CA_NonConfigureable); } menuPreviewStyle->addAction(command); } @@ -715,7 +715,7 @@ void FormEditorW::print() painter.drawPixmap(0, 0, pixmap); m_core->mainWindow()->setCursor(oldCursor); - m_core->statusBar()->showMessage(tr("Printed %1...").arg(QFileInfo(fw->fileName()).fileName())); +// m_core->statusBar()->showMessage(tr("Printed %1...").arg(QFileInfo(fw->fileName()).fileName())); } while (false); m_core->printer()->setFullPage(oldFullPage); m_core->printer()->setOrientation(oldOrientation); diff --git a/src/plugins/designer/formeditorw.h b/src/plugins/designer/formeditorw.h index 8263fbb622d..6aaca2c5924 100644 --- a/src/plugins/designer/formeditorw.h +++ b/src/plugins/designer/formeditorw.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -65,8 +65,8 @@ namespace qdesigner_internal { QT_END_NAMESPACE namespace Core { -class ActionManagerInterface; -class IActionContainer; +class ActionManager; +class ActionContainer; class ICore; class IEditor; } @@ -89,7 +89,7 @@ class SettingsPage; * Requesting an editor via instance() will fully initialize the class. * This is based on the assumption that the Designer settings work with * no plugins loaded. If that does not work, full initialization can be - * triggered by connection to the ICore::settingsDialogRequested() signal. + * triggered by connection to the ICore::optionsDialogRequested() signal. */ class FormEditorW : public QObject { @@ -142,7 +142,7 @@ private: typedef QList EditorList; void setupActions(); - Core::IActionContainer *createPreviewStyleMenu(Core::ActionManagerInterface *am, + Core::ActionContainer *createPreviewStyleMenu(Core::ActionManager *am, QActionGroup *actionGroup); void critical(const QString &errorMessage); diff --git a/src/plugins/designer/formtemplatewizardpage.cpp b/src/plugins/designer/formtemplatewizardpage.cpp index e6ed5a1da5d..4a8c9907009 100644 --- a/src/plugins/designer/formtemplatewizardpage.cpp +++ b/src/plugins/designer/formtemplatewizardpage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/formtemplatewizardpage.h b/src/plugins/designer/formtemplatewizardpage.h index d123b52998c..6b375386b58 100644 --- a/src/plugins/designer/formtemplatewizardpage.h +++ b/src/plugins/designer/formtemplatewizardpage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/formwindoweditor.cpp b/src/plugins/designer/formwindoweditor.cpp index 9bc3340299d..1c142c483e0 100644 --- a/src/plugins/designer/formwindoweditor.cpp +++ b/src/plugins/designer/formwindoweditor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/formwindoweditor.h b/src/plugins/designer/formwindoweditor.h index 518f3e63488..e448d8a6514 100644 --- a/src/plugins/designer/formwindoweditor.h +++ b/src/plugins/designer/formwindoweditor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/formwindowfile.cpp b/src/plugins/designer/formwindowfile.cpp index b5a145736da..49387adb45b 100644 --- a/src/plugins/designer/formwindowfile.cpp +++ b/src/plugins/designer/formwindowfile.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/formwindowfile.h b/src/plugins/designer/formwindowfile.h index 54468c388f7..c94e25da5b7 100644 --- a/src/plugins/designer/formwindowfile.h +++ b/src/plugins/designer/formwindowfile.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/formwindowhost.cpp b/src/plugins/designer/formwindowhost.cpp index c54ed911429..e1de87af80e 100644 --- a/src/plugins/designer/formwindowhost.cpp +++ b/src/plugins/designer/formwindowhost.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/formwindowhost.h b/src/plugins/designer/formwindowhost.h index fc31d65847c..411949c27ed 100644 --- a/src/plugins/designer/formwindowhost.h +++ b/src/plugins/designer/formwindowhost.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/formwizard.cpp b/src/plugins/designer/formwizard.cpp index 5c3f84a8349..4bb492ce354 100644 --- a/src/plugins/designer/formwizard.cpp +++ b/src/plugins/designer/formwizard.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/formwizard.h b/src/plugins/designer/formwizard.h index e4274a8a7be..b49fea1eb7a 100644 --- a/src/plugins/designer/formwizard.h +++ b/src/plugins/designer/formwizard.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/formwizarddialog.cpp b/src/plugins/designer/formwizarddialog.cpp index 958d627503d..67ed8160198 100644 --- a/src/plugins/designer/formwizarddialog.cpp +++ b/src/plugins/designer/formwizarddialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/formwizarddialog.h b/src/plugins/designer/formwizarddialog.h index 234d3ce42bd..52aaed4cd02 100644 --- a/src/plugins/designer/formwizarddialog.h +++ b/src/plugins/designer/formwizarddialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/settingsmanager.cpp b/src/plugins/designer/settingsmanager.cpp index 56ae6f0236f..3edad0921b8 100644 --- a/src/plugins/designer/settingsmanager.cpp +++ b/src/plugins/designer/settingsmanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/settingsmanager.h b/src/plugins/designer/settingsmanager.h index 30bb51dd31f..ba6c89e133a 100644 --- a/src/plugins/designer/settingsmanager.h +++ b/src/plugins/designer/settingsmanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/settingspage.cpp b/src/plugins/designer/settingspage.cpp index 7e0952ae763..8de4cad5dc2 100644 --- a/src/plugins/designer/settingspage.cpp +++ b/src/plugins/designer/settingspage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -67,7 +67,12 @@ QWidget *SettingsPage::createPage(QWidget *parent) return m_designerPage->createPage(parent); } -void SettingsPage::finished(bool accepted) +void SettingsPage::apply() { - m_designerPage->finish(accepted); + m_designerPage->apply(); +} + +void SettingsPage::finish() +{ + m_designerPage->finish(); } diff --git a/src/plugins/designer/settingspage.h b/src/plugins/designer/settingspage.h index 397bb36b3a0..8ad707dd769 100644 --- a/src/plugins/designer/settingspage.h +++ b/src/plugins/designer/settingspage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -58,8 +58,9 @@ public: QString category() const; QString trCategory() const; - QWidget *createPage(QWidget *parent); - void finished(bool accepted); + virtual QWidget *createPage(QWidget *parent); + virtual void apply(); + virtual void finish(); private: QDesignerOptionsPageInterface *m_designerPage; diff --git a/src/plugins/designer/workbenchintegration.cpp b/src/plugins/designer/workbenchintegration.cpp index 0291bd21058..42043c3cd20 100644 --- a/src/plugins/designer/workbenchintegration.cpp +++ b/src/plugins/designer/workbenchintegration.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/designer/workbenchintegration.h b/src/plugins/designer/workbenchintegration.h index 10732865b04..55acd931ec6 100644 --- a/src/plugins/designer/workbenchintegration.h +++ b/src/plugins/designer/workbenchintegration.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/fakevim/FakeVim.pluginspec b/src/plugins/fakevim/FakeVim.pluginspec index 66a091e283d..a420040ac8a 100644 --- a/src/plugins/fakevim/FakeVim.pluginspec +++ b/src/plugins/fakevim/FakeVim.pluginspec @@ -6,6 +6,7 @@ http://www.trolltech.com/ + diff --git a/src/plugins/fakevim/fakevim.pro b/src/plugins/fakevim/fakevim.pro index 2165ffed202..2c85f8c50b2 100644 --- a/src/plugins/fakevim/fakevim.pro +++ b/src/plugins/fakevim/fakevim.pro @@ -2,10 +2,13 @@ TEMPLATE = lib TARGET = FakeVim # CONFIG += single +include(../../libs/cplusplus/cplusplus.pri) include(../../qworkbenchplugin.pri) include(../../plugins/projectexplorer/projectexplorer.pri) include(../../plugins/coreplugin/coreplugin.pri) include(../../plugins/texteditor/texteditor.pri) +include(../../plugins/texteditor/cppeditor.pri) +include(../../../shared/indenter/indenter.pri) # DEFINES += QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII QT += gui diff --git a/src/plugins/fakevim/fakevimconstants.h b/src/plugins/fakevim/fakevimconstants.h index 13c71695434..93472b66d30 100644 --- a/src/plugins/fakevim/fakevimconstants.h +++ b/src/plugins/fakevim/fakevimconstants.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -45,6 +45,7 @@ const char * const ConfigTabStop = "tabstop"; const char * const ConfigSmartTab = "smarttab"; const char * const ConfigShiftWidth = "shiftwidth"; const char * const ConfigExpandTab = "expandtab"; +const char * const ConfigAutoIndent = "autoindent"; } // namespace Constants } // namespace FakeVim diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 3f6bb103c59..4a69ff97ea6 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -53,6 +53,11 @@ #include #include +//#include +//#include +//#include + +//#include using namespace FakeVim::Internal; using namespace FakeVim::Constants; @@ -97,6 +102,9 @@ enum SubMode ChangeSubMode, DeleteSubMode, FilterSubMode, + ReplaceSubMode, + YankSubMode, + IndentSubMode, ZSubMode, }; @@ -179,8 +187,16 @@ private: int linesInDocument() const; void scrollToLineInDocument(int line); + // helper functions for indenting + bool isElectricCharacter(QChar c) const { return (c == '{' || c == '}' || c == '#'); } + int indentDist() const; + void indentRegion(QTextBlock first, QTextBlock last, QChar typedChar=0); + void indentCurrentLine(QChar typedChar); + void moveToFirstNonBlankOnLine(); + void moveToDesiredColumn(); void moveToNextWord(bool simple); + void moveToMatchingParanthesis(); void moveToWordBoundary(bool simple, bool forward); void handleFfTt(int key); @@ -263,6 +279,10 @@ public: // vi style configuration QHash m_config; + + // for restoring cursor position + int m_savedPosition; + int m_desiredColumn; }; FakeVimHandler::Private::Private(FakeVimHandler *parent) @@ -279,12 +299,14 @@ FakeVimHandler::Private::Private(FakeVimHandler *parent) m_textedit = 0; m_plaintextedit = 0; m_visualMode = NoVisualMode; + m_desiredColumn = 0; m_config[ConfigStartOfLine] = ConfigOn; m_config[ConfigTabStop] = "8"; m_config[ConfigSmartTab] = ConfigOff; m_config[ConfigShiftWidth] = "8"; m_config[ConfigExpandTab] = ConfigOff; + m_config[ConfigAutoIndent] = ConfigOff; } bool FakeVimHandler::Private::handleEvent(QKeyEvent *ev) @@ -306,15 +328,18 @@ bool FakeVimHandler::Private::handleEvent(QKeyEvent *ev) // Fake "End of line" m_tc = EDITOR(textCursor()); + m_tc.setVisualNavigation(true); if (m_fakeEnd) m_tc.movePosition(Right, MoveAnchor, 1); - if (key >= Key_A && key <= Key_Z - && (ev->modifiers() & Qt::ShiftModifier) == 0) - key += 32; - if ((ev->modifiers() & Qt::ControlModifier) != 0) + if ((ev->modifiers() & Qt::ControlModifier) != 0) { key += 256; + key += 32; // make it lower case + } else if (key >= Key_A && key <= Key_Z + && (ev->modifiers() & Qt::ShiftModifier) == 0) { + key += 32; + } bool handled = handleKey(key, ev->text()); // We fake vi-style end-of-line behaviour @@ -332,6 +357,7 @@ bool FakeVimHandler::Private::handleKey(int key, const QString &text) { //qDebug() << "KEY: " << key << text << "POS: " << m_tc.position(); //qDebug() << "\nUNDO: " << m_undoStack << "\nREDO: " << m_redoStack; + m_savedPosition = m_tc.position(); if (m_mode == InsertMode) return handleInsertMode(key, text); if (m_mode == CommandMode) @@ -372,6 +398,23 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand) m_submode = NoSubMode; if (atEol()) m_tc.movePosition(Left, MoveAnchor, 1); + } else if (m_submode == YankSubMode) { + m_registers[m_register] = m_tc.selectedText(); + m_tc.setPosition(m_savedPosition); + m_submode = NoSubMode; + } else if (m_submode == ReplaceSubMode) { + m_submode = NoSubMode; + } else if (m_submode == IndentSubMode) { + QTextDocument *doc = EDITOR(document()); + int start = m_tc.selectionStart(); + int end = m_tc.selectionEnd(); + if (start > end) + std::swap(start, end); + QTextBlock startBlock = doc->findBlock(start); + indentRegion(doc->findBlock(start), doc->findBlock(end).next()); + m_tc.setPosition(startBlock.position()); + moveToFirstNonBlankOnLine(); + m_submode = NoSubMode; } m_mvcount.clear(); m_opcount.clear(); @@ -381,6 +424,7 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand) updateSelection(); updateMiniBuffer(); + m_desiredColumn = leftDist(); } void FakeVimHandler::Private::updateSelection() @@ -430,7 +474,7 @@ void FakeVimHandler::Private::updateSelection() } } } - EDITOR(setExtraSelections(selections)); + emit q->selectionChanged(editor(), selections); } void FakeVimHandler::Private::updateMiniBuffer() @@ -502,7 +546,7 @@ void FakeVimHandler::Private::showBlackMessage(const QString &msg) bool FakeVimHandler::Private::handleCommandMode(int key, const QString &text) { - Q_UNUSED(text) + bool handled = true; if (m_submode == RegisterSubMode) { m_register = key; @@ -517,6 +561,20 @@ bool FakeVimHandler::Private::handleCommandMode(int key, const QString &text) m_tc.movePosition(Down, KeepAnchor, count()); m_registers[m_register] = m_tc.selectedText(); finishMovement("d"); + } else if (m_submode == YankSubMode && key == 'y') { + m_tc.movePosition(StartOfLine, MoveAnchor); + m_tc.movePosition(Down, KeepAnchor, count()); + m_registers[m_register] = m_tc.selectedText(); + finishMovement(); + } else if (m_submode == ReplaceSubMode) { + if (atEol()) + m_tc.movePosition(Left, KeepAnchor, 1); + else + m_tc.deleteChar(); + m_tc.insertText(text); + } else if (m_submode == IndentSubMode && key == '=') { + indentRegion(m_tc.block(), m_tc.block().next()); + finishMovement(); } else if (m_submode == ZSubMode) { if (key == Key_Return) { // cursor line to top of window, cursor on first non-blank @@ -590,12 +648,16 @@ bool FakeVimHandler::Private::handleCommandMode(int key, const QString &text) } else if (key == Key_Return) { m_tc.movePosition(StartOfLine); m_tc.movePosition(Down); + finishMovement(); } else if (key == Key_Home) { m_tc.movePosition(StartOfLine, KeepAnchor); finishMovement(); } else if (key == '$' || key == Key_End) { + int submode = m_submode; m_tc.movePosition(EndOfLine, KeepAnchor); finishMovement(); + if (submode == NoSubMode) + m_desiredColumn = -1; } else if (key == ',') { // FIXME: use some other mechanism m_mode = PassingMode; @@ -605,6 +667,11 @@ bool FakeVimHandler::Private::handleCommandMode(int key, const QString &text) for (int i = count(); --i >= 0; ) foreach (QChar c, m_dotCommand) handleKey(c.unicode(), QString(c)); + } else if (key == '=') { + m_submode = IndentSubMode; + } else if (key == '%') { + moveToMatchingParanthesis(); + finishMovement(); } else if (key == 'a') { m_mode = InsertMode; m_lastInsertion.clear(); @@ -656,7 +723,7 @@ bool FakeVimHandler::Private::handleCommandMode(int key, const QString &text) m_gflag = true; } else if (key == 'G') { int n = m_mvcount.isEmpty() ? linesInDocument() : count(); - m_tc.setPosition(positionForLine(n), MoveAnchor); + m_tc.setPosition(positionForLine(n), KeepAnchor); if (m_config.contains(ConfigStartOfLine)) moveToFirstNonBlankOnLine(); finishMovement(); @@ -674,6 +741,8 @@ bool FakeVimHandler::Private::handleCommandMode(int key, const QString &text) } else if (key == 'i') { enterInsertMode(); updateMiniBuffer(); + if (atEol()) + m_tc.movePosition(Left, MoveAnchor, 1); } else if (key == 'I') { enterInsertMode(); if (m_gflag) @@ -681,8 +750,16 @@ bool FakeVimHandler::Private::handleCommandMode(int key, const QString &text) else moveToFirstNonBlankOnLine(); } else if (key == 'j' || key == Key_Down) { - m_tc.movePosition(Down, KeepAnchor, count()); + int savedColumn = m_desiredColumn; + if (m_submode == NoSubMode || m_submode == ZSubMode || m_submode == RegisterSubMode) { + m_tc.movePosition(Down, KeepAnchor, count()); + moveToDesiredColumn(); + } else { + m_tc.movePosition(StartOfLine, MoveAnchor); + m_tc.movePosition(Down, KeepAnchor, count()+1); + } finishMovement(); + m_desiredColumn = savedColumn; } else if (key == 'J') { EditOperation op; if (m_submode == NoSubMode) { @@ -696,8 +773,17 @@ bool FakeVimHandler::Private::handleCommandMode(int key, const QString &text) m_tc.movePosition(Left, MoveAnchor, 1); } } else if (key == 'k' || key == Key_Up) { - m_tc.movePosition(Up, KeepAnchor, count()); + int savedColumn = m_desiredColumn; + if (m_submode == NoSubMode || m_submode == ZSubMode || m_submode == RegisterSubMode) { + m_tc.movePosition(Up, KeepAnchor, count()); + moveToDesiredColumn(); + } else { + m_tc.movePosition(StartOfLine, MoveAnchor); + m_tc.movePosition(Down, MoveAnchor); + m_tc.movePosition(Up, KeepAnchor, count()+1); + } finishMovement(); + m_desiredColumn = savedColumn; } else if (key == 'l' || key == Key_Right) { m_tc.movePosition(Right, KeepAnchor, qMin(count(), rightDist())); finishMovement(); @@ -716,15 +802,20 @@ bool FakeVimHandler::Private::handleCommandMode(int key, const QString &text) search(lastSearchString(), m_lastSearchForward); } else if (key == 'N') { search(lastSearchString(), !m_lastSearchForward); - } else if (key == 'o') { + } else if (key == 'o' || key == 'O') { enterInsertMode(); + moveToFirstNonBlankOnLine(); + int numSpaces = leftDist(); + m_tc.movePosition(Up, MoveAnchor, 1); + if (key == 'o') + m_tc.movePosition(Down, MoveAnchor, 1); m_tc.movePosition(EndOfLine, MoveAnchor); m_tc.insertText("\n"); - } else if (key == 'O') { - enterInsertMode(); m_tc.movePosition(StartOfLine, MoveAnchor); - m_tc.movePosition(Left, MoveAnchor, 1); - m_tc.insertText("\n"); + if (m_config[ConfigAutoIndent] == ConfigOn) + m_tc.insertText(QString(indentDist(), ' ')); + else + m_tc.insertText(QString(numSpaces, ' ')); } else if (key == 'p' || key == 'P') { QString text = m_registers[m_register]; int n = text.count(QChar(ParagraphSeparator)); @@ -741,6 +832,13 @@ bool FakeVimHandler::Private::handleCommandMode(int key, const QString &text) m_tc.movePosition(Left); } m_dotCommand = "p"; + } else if (key == 'r') { + m_submode = ReplaceSubMode; + m_dotCommand = "r"; + } else if (key == 'R') { + m_mode = InsertMode; + m_submode = ReplaceSubMode; + m_dotCommand = "R"; } else if (key == control('r')) { redo(); } else if (key == 's') { @@ -779,6 +877,10 @@ bool FakeVimHandler::Private::handleCommandMode(int key, const QString &text) m_tc.deleteChar(); } finishMovement(); + } else if (key == 'y') { + if (atEol()) + m_tc.movePosition(Left, MoveAnchor, 1); + m_submode = YankSubMode; } else if (key == 'z') { m_submode = ZSubMode; } else if (key == '~' && !atEol()) { @@ -805,9 +907,11 @@ bool FakeVimHandler::Private::handleCommandMode(int key, const QString &text) leaveVisualMode(); } else { qDebug() << "Ignored in command mode: " << key << text; - return false; + if (text.isEmpty()) + handled = false; } - return true; + + return handled; } bool FakeVimHandler::Private::handleInsertMode(int key, const QString &text) @@ -827,17 +931,21 @@ bool FakeVimHandler::Private::handleInsertMode(int key, const QString &text) m_tc.movePosition(Left, MoveAnchor, 1); m_lastInsertion.clear(); } else if (key == Key_Down) { + m_submode = NoSubMode; m_tc.movePosition(Down, MoveAnchor, 1); m_lastInsertion.clear(); } else if (key == Key_Up) { + m_submode = NoSubMode; m_tc.movePosition(Up, MoveAnchor, 1); m_lastInsertion.clear(); } else if (key == Key_Right) { m_tc.movePosition(Right, MoveAnchor, 1); m_lastInsertion.clear(); } else if (key == Key_Return) { + m_submode = NoSubMode; m_tc.insertBlock(); m_lastInsertion += "\n"; + indentRegion(m_tc.block(), m_tc.block().next()); } else if (key == Key_Backspace || key == control('h')) { m_tc.deletePreviousChar(); m_lastInsertion = m_lastInsertion.left(m_lastInsertion.size() - 1); @@ -856,7 +964,30 @@ bool FakeVimHandler::Private::handleInsertMode(int key, const QString &text) m_tc.insertText(str); } else if (!text.isEmpty()) { m_lastInsertion.append(text); + if (m_submode == ReplaceSubMode) { + if (atEol()) + m_submode = NoSubMode; + else + m_tc.deleteChar(); + } m_tc.insertText(text); + if (m_config[ConfigAutoIndent] == ConfigOn + && isElectricCharacter(text.at(0))) { + const QString leftText = m_tc.block().text() + .left(m_tc.position() - 1 - m_tc.block().position()); + if (leftText.simplified().isEmpty()) { + if (m_tc.hasSelection()) { + QTextDocument *doc = EDITOR(document()); + QTextBlock block = doc->findBlock(qMin(m_tc.selectionStart(), + m_tc.selectionEnd())); + const QTextBlock end = doc->findBlock(qMax(m_tc.selectionStart(), + m_tc.selectionEnd())).next(); + indentRegion(block, end, text.at(0)); + } else { + indentCurrentLine(text.at(0)); + } + } + } } else { return false; } @@ -942,6 +1073,17 @@ int FakeVimHandler::Private::readLineCode(QString &cmd) return cursorLineInDocument() + 1; if (c == '$') return linesInDocument(); + if (c == '\'' && !cmd.isEmpty()) { + int mark = m_marks.value(cmd.at(0).unicode()); + if (!mark) { + showRedMessage(tr("E20: Mark '%1' not set").arg(cmd.at(0))); + return -1; + } + cmd = cmd.mid(1); + QTextCursor tc = m_tc; + tc.setPosition(mark); + return tc.block().blockNumber() + 1; + } if (c == '-') { int n = readLineCode(cmd); return cursorLineInDocument() + 1 - (n == -1 ? 1 : n); @@ -1159,7 +1301,7 @@ void FakeVimHandler::Private::moveToFirstNonBlankOnLine() { QTextBlock block = m_tc.block(); QTextDocument *doc = m_tc.document(); - m_tc.movePosition(StartOfLine); + m_tc.movePosition(StartOfLine, KeepAnchor); int firstPos = m_tc.position(); for (int i = firstPos, n = firstPos + block.length(); i < n; ++i) { if (!doc->characterAt(i).isSpace()) { @@ -1169,6 +1311,72 @@ void FakeVimHandler::Private::moveToFirstNonBlankOnLine() } } +int FakeVimHandler::Private::indentDist() const +{ +#if 0 + // FIXME: Make independent of TextEditor + if (!m_texteditor) + return 0; + + TextEditor::TabSettings ts = m_texteditor->tabSettings(); + typedef SharedTools::Indenter Indenter; + Indenter &indenter = Indenter::instance(); + indenter.setIndentSize(ts.m_indentSize); + indenter.setTabSize(ts.m_tabSize); + + QTextDocument *doc = EDITOR(document()); + const TextEditor::TextBlockIterator current(m_tc.block()); + const TextEditor::TextBlockIterator begin(doc->begin()); + const TextEditor::TextBlockIterator end(m_tc.block().next()); + return indenter.indentForBottomLine(current, begin, end, QChar(' ')); +#endif + return 0; +} + +void FakeVimHandler::Private::indentRegion(QTextBlock begin, QTextBlock end, QChar typedChar) +{ +#if 0 + // FIXME: Make independent of TextEditor + if (!m_texteditor) + return 0; + typedef SharedTools::Indenter Indenter; + Indenter &indenter = Indenter::instance(); + indenter.setIndentSize(m_config[ConfigShiftWidth].toInt()); + indenter.setTabSize(m_config[ConfigTabStop].toInt()); + + QTextDocument *doc = EDITOR(document()); + const TextEditor::TextBlockIterator docStart(doc->begin()); + for(QTextBlock cur = begin; cur != end; cur = cur.next()) { + if (typedChar != 0 && cur.text().simplified().isEmpty()) { + m_tc.setPosition(cur.position(), KeepAnchor); + while (!m_tc.atBlockEnd()) + m_tc.deleteChar(); + } else { + const TextEditor::TextBlockIterator current(cur); + const TextEditor::TextBlockIterator next(cur.next()); + const int indent = indenter.indentForBottomLine(current, docStart, next, typedChar); + ts.indentLine(cur, indent); + } + } +#endif + Q_UNUSED(begin); + Q_UNUSED(end); + Q_UNUSED(typedChar); +} + +void FakeVimHandler::Private::indentCurrentLine(QChar typedChar) +{ + indentRegion(m_tc.block(), m_tc.block().next(), typedChar); +} + +void FakeVimHandler::Private::moveToDesiredColumn() +{ + if (m_desiredColumn == -1 || m_tc.block().length() <= m_desiredColumn) + m_tc.movePosition(EndOfLine, KeepAnchor); + else + m_tc.setPosition(m_tc.block().position() + m_desiredColumn, KeepAnchor); +} + static int charClass(QChar c, bool simple) { if (simple) @@ -1262,6 +1470,38 @@ void FakeVimHandler::Private::moveToNextWord(bool simple) } } +void FakeVimHandler::Private::moveToMatchingParanthesis() +{ +#if 0 + // FIXME: remove TextEditor dependency + bool undoFakeEOL = false; + if (atEol()) { + m_tc.movePosition(Left, KeepAnchor, 1); + undoFakeEOL = true; + } + TextEditor::TextBlockUserData::MatchType match + = TextEditor::TextBlockUserData::matchCursorForward(&m_tc); + if (match == TextEditor::TextBlockUserData::Match) { + if (m_submode == NoSubMode || m_submode == ZSubMode || m_submode == RegisterSubMode) + m_tc.movePosition(Left, KeepAnchor, 1); + } else { + if (undoFakeEOL) + m_tc.movePosition(Right, KeepAnchor, 1); + if (match == TextEditor::TextBlockUserData::NoMatch) { + // backward matching is according to the character before the cursor + bool undoMove = false; + if (!m_tc.atBlockEnd()) { + m_tc.movePosition(Right, KeepAnchor, 1); + undoMove = true; + } + match = TextEditor::TextBlockUserData::matchCursorBackward(&m_tc); + if (match != TextEditor::TextBlockUserData::Match && undoMove) + m_tc.movePosition(Left, KeepAnchor, 1); + } + } +#endif +} + int FakeVimHandler::Private::cursorLineOnScreen() const { if (!editor()) diff --git a/src/plugins/fakevim/fakevimhandler.h b/src/plugins/fakevim/fakevimhandler.h index 69bb363015f..08df6d21b12 100644 --- a/src/plugins/fakevim/fakevimhandler.h +++ b/src/plugins/fakevim/fakevimhandler.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -34,7 +34,8 @@ #ifndef FAKEVIM_HANDLER_H #define FAKEVIM_HANDLER_H -#include +#include +#include QT_BEGIN_NAMESPACE class QString; @@ -69,6 +70,8 @@ signals: void statusDataChanged(const QString &msg); void extraInformationChanged(const QString &msg); void quitRequested(QWidget *); + void selectionChanged(QWidget *widget, + const QList &selection); private: bool eventFilter(QObject *ob, QEvent *ev); diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index 9524e618e09..0a06fe7c112 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -36,7 +36,7 @@ #include "fakevimconstants.h" #include "fakevimhandler.h" -#include +#include #include #include #include @@ -57,7 +57,7 @@ #include #include -#include +#include #include #include #include @@ -66,6 +66,7 @@ #include #include #include +#include using namespace FakeVim::Internal; @@ -87,26 +88,65 @@ const char * const INSTALL_KEY = "Alt+V,Alt+V"; /////////////////////////////////////////////////////////////////////// // -// FakeVimPlugin +// FakeVimPluginPrivate // /////////////////////////////////////////////////////////////////////// -FakeVimPlugin::FakeVimPlugin() +namespace FakeVim { +namespace Internal { + +class FakeVimPluginPrivate : public QObject { - m_core = 0; + Q_OBJECT + +public: + FakeVimPluginPrivate(FakeVimPlugin *); + ~FakeVimPluginPrivate(); + friend class FakeVimPlugin; + + bool initialize(const QStringList &arguments, QString *error_message); + void shutdown(); + +private slots: + void installHandler(); + void installHandler(QWidget *widget); + void removeHandler(QWidget *widget); + void showCommandBuffer(const QString &contents); + void showExtraInformation(const QString &msg); + void editorOpened(Core::IEditor *); + void editorAboutToClose(Core::IEditor *); + void changeSelection(QWidget *widget, + const QList &selections); + +private: + FakeVimPlugin *q; + FakeVimHandler *m_handler; + QAction *m_installHandlerAction; + Core::ICore *m_core; +}; + +} // namespace Internal +} // namespace FakeVim + +FakeVimPluginPrivate::FakeVimPluginPrivate(FakeVimPlugin *plugin) +{ + q = plugin; m_handler = 0; + m_installHandlerAction = 0; + m_core = 0; } -FakeVimPlugin::~FakeVimPlugin() -{} +FakeVimPluginPrivate::~FakeVimPluginPrivate() +{ +} -void FakeVimPlugin::shutdown() +void FakeVimPluginPrivate::shutdown() { delete m_handler; m_handler = 0; } -bool FakeVimPlugin::initialize(const QStringList &arguments, QString *error_message) +bool FakeVimPluginPrivate::initialize(const QStringList &arguments, QString *error_message) { Q_UNUSED(arguments); Q_UNUSED(error_message); @@ -116,7 +156,7 @@ bool FakeVimPlugin::initialize(const QStringList &arguments, QString *error_mess m_core = ExtensionSystem::PluginManager::instance()->getObject(); QTC_ASSERT(m_core, return false); - Core::ActionManagerInterface *actionManager = m_core->actionManager(); + Core::ActionManager *actionManager = m_core->actionManager(); QTC_ASSERT(actionManager, return false); QList globalcontext; @@ -125,12 +165,12 @@ bool FakeVimPlugin::initialize(const QStringList &arguments, QString *error_mess m_installHandlerAction = new QAction(this); m_installHandlerAction->setText(tr("Set vi-Style Keyboard Action Handler")); - Core::ICommand *cmd = 0; + Core::Command *cmd = 0; cmd = actionManager->registerAction(m_installHandlerAction, Constants::INSTALL_HANDLER, globalcontext); cmd->setDefaultKeySequence(QKeySequence(Constants::INSTALL_KEY)); - IActionContainer *advancedMenu = + ActionContainer *advancedMenu = actionManager->actionContainer(Core::Constants::M_EDIT_ADVANCED); advancedMenu->addAction(cmd); @@ -147,17 +187,13 @@ bool FakeVimPlugin::initialize(const QStringList &arguments, QString *error_mess return true; } -void FakeVimPlugin::extensionsInitialized() -{ -} - -void FakeVimPlugin::installHandler() +void FakeVimPluginPrivate::installHandler() { if (Core::IEditor *editor = m_core->editorManager()->currentEditor()) installHandler(editor->widget()); } -void FakeVimPlugin::installHandler(QWidget *widget) +void FakeVimPluginPrivate::installHandler(QWidget *widget) { connect(m_handler, SIGNAL(extraInformationChanged(QString)), this, SLOT(showExtraInformation(QString))); @@ -165,14 +201,17 @@ void FakeVimPlugin::installHandler(QWidget *widget) this, SLOT(showCommandBuffer(QString))); connect(m_handler, SIGNAL(quitRequested(QWidget *)), this, SLOT(removeHandler(QWidget *))); + connect(m_handler, + SIGNAL(selectionChanged(QWidget*,QList)), + this, SLOT(changeSelection(QWidget*,QList))); m_handler->addWidget(widget); - BaseTextEditor *baseTextEditor = qobject_cast(widget); - if (baseTextEditor) { + BaseTextEditor *bt = qobject_cast(widget); + if (bt) { using namespace TextEditor; using namespace FakeVim::Constants; - TabSettings settings = baseTextEditor->tabSettings(); + TabSettings settings = bt->tabSettings(); m_handler->setConfigValue(ConfigTabStop, QString::number(settings.m_tabSize)); m_handler->setConfigValue(ConfigShiftWidth, @@ -181,42 +220,81 @@ void FakeVimPlugin::installHandler(QWidget *widget) settings.m_spacesForTabs ? ConfigOn : ConfigOff); m_handler->setConfigValue(ConfigSmartTab, settings.m_smartBackspace ? ConfigOn : ConfigOff); - //m_handler->setConfigValue(ConfigSmartTab, - // settings.m_autoIndent ? ConfigOn : ConfigOff); + m_handler->setConfigValue(ConfigAutoIndent, + settings.m_autoIndent ? ConfigOn : ConfigOff); } } -void FakeVimPlugin::removeHandler(QWidget *widget) +void FakeVimPluginPrivate::removeHandler(QWidget *widget) { - //m_handler->removeWidget(widget); + Q_UNUSED(widget); + m_handler->removeWidget(widget); Core::EditorManager::instance()->hideEditorInfoBar( QLatin1String(Constants::MINI_BUFFER)); } -void FakeVimPlugin::editorOpened(Core::IEditor *editor) +void FakeVimPluginPrivate::editorOpened(Core::IEditor *editor) { + Q_UNUSED(editor); //qDebug() << "OPENING: " << editor << editor->widget(); //installHandler(editor->widget()); } -void FakeVimPlugin::editorAboutToClose(Core::IEditor *editor) +void FakeVimPluginPrivate::editorAboutToClose(Core::IEditor *editor) { //qDebug() << "CLOSING: " << editor << editor->widget(); removeHandler(editor->widget()); } -void FakeVimPlugin::showCommandBuffer(const QString &contents) +void FakeVimPluginPrivate::showCommandBuffer(const QString &contents) { Core::EditorManager::instance()->showEditorInfoBar( QLatin1String(Constants::MINI_BUFFER), contents, tr("Quit FakeVim"), m_handler, SLOT(quit())); } -void FakeVimPlugin::showExtraInformation(const QString &text) +void FakeVimPluginPrivate::showExtraInformation(const QString &text) { QMessageBox::information(0, tr("FakeVim Information"), text); } -//#include "fakevimplugin.moc" +void FakeVimPluginPrivate::changeSelection(QWidget *widget, + const QList &selection) +{ + if (BaseTextEditor *bt = qobject_cast(widget)) + bt->setExtraSelections(BaseTextEditor::FakeVimSelection, selection); +} + + +/////////////////////////////////////////////////////////////////////// +// +// FakeVimPlugin +// +/////////////////////////////////////////////////////////////////////// + +FakeVimPlugin::FakeVimPlugin() + : d(new FakeVimPluginPrivate(this)) +{} + +FakeVimPlugin::~FakeVimPlugin() +{ + delete d; +} + +bool FakeVimPlugin::initialize(const QStringList &arguments, QString *error_message) +{ + return d->initialize(arguments, error_message); +} + +void FakeVimPlugin::shutdown() +{ + d->shutdown(); +} + +void FakeVimPlugin::extensionsInitialized() +{ +} + +#include "fakevimplugin.moc" Q_EXPORT_PLUGIN(FakeVimPlugin) diff --git a/src/plugins/fakevim/fakevimplugin.h b/src/plugins/fakevim/fakevimplugin.h index 793c2264d00..33876d21eca 100644 --- a/src/plugins/fakevim/fakevimplugin.h +++ b/src/plugins/fakevim/fakevimplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -36,33 +36,13 @@ #include -#include - -QT_BEGIN_NAMESPACE -class QAction; -QT_END_NAMESPACE - - -namespace Core { - -class ICore; -class IEditor; - -} // namespace Core - - -namespace TextEditor { - -class ITextEditor; - -} // namespace TextEditor - - namespace FakeVim { namespace Internal { class FakeVimHandler; +class FakeVimPluginPrivate; + class FakeVimPlugin : public ExtensionSystem::IPlugin { Q_OBJECT @@ -72,23 +52,14 @@ public: ~FakeVimPlugin(); private: + // implementation of ExtensionSystem::IPlugin bool initialize(const QStringList &arguments, QString *error_message); void shutdown(); void extensionsInitialized(); -private slots: - void installHandler(); - void installHandler(QWidget *widget); - void removeHandler(QWidget *widget); - void showCommandBuffer(const QString &contents); - void showExtraInformation(const QString &msg); - void editorOpened(Core::IEditor *); - void editorAboutToClose(Core::IEditor *); - private: - FakeVimHandler *m_handler; - QAction *m_installHandlerAction; - Core::ICore *m_core; + friend class FakeVimPluginPrivate; + FakeVimPluginPrivate *d; }; } // namespace Internal diff --git a/src/plugins/find/basetextfind.cpp b/src/plugins/find/basetextfind.cpp index 8b83975cb49..2428d25fbe5 100644 --- a/src/plugins/find/basetextfind.cpp +++ b/src/plugins/find/basetextfind.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/basetextfind.h b/src/plugins/find/basetextfind.h index aa1fe59ec24..c1b66381f1f 100644 --- a/src/plugins/find/basetextfind.h +++ b/src/plugins/find/basetextfind.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/currentdocumentfind.cpp b/src/plugins/find/currentdocumentfind.cpp index dd25564a437..b51504db7df 100644 --- a/src/plugins/find/currentdocumentfind.cpp +++ b/src/plugins/find/currentdocumentfind.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/currentdocumentfind.h b/src/plugins/find/currentdocumentfind.h index 6951cee5e71..2f41acbe7b0 100644 --- a/src/plugins/find/currentdocumentfind.h +++ b/src/plugins/find/currentdocumentfind.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/find_global.h b/src/plugins/find/find_global.h index c6c0ac5b105..7da22f39fcf 100644 --- a/src/plugins/find/find_global.h +++ b/src/plugins/find/find_global.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/findplugin.cpp b/src/plugins/find/findplugin.cpp index 0bf2ec4fdb9..b3c417debd3 100644 --- a/src/plugins/find/findplugin.cpp +++ b/src/plugins/find/findplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -38,9 +38,9 @@ #include "findtoolwindow.h" #include "searchresultwindow.h" -#include -#include -#include +#include +#include +#include #include #include @@ -126,16 +126,16 @@ void FindPlugin::openFindFilter() void FindPlugin::setupMenu() { - Core::ActionManagerInterface *am = m_core->actionManager(); - Core::IActionContainer *medit = am->actionContainer(Core::Constants::M_EDIT); - Core::IActionContainer *mfind = am->createMenu(Constants::M_FIND); + Core::ActionManager *am = m_core->actionManager(); + Core::ActionContainer *medit = am->actionContainer(Core::Constants::M_EDIT); + Core::ActionContainer *mfind = am->createMenu(Constants::M_FIND); medit->addMenu(mfind, Core::Constants::G_EDIT_FIND); mfind->menu()->setTitle(tr("&Find/Replace")); mfind->appendGroup(Constants::G_FIND_FILTERS); mfind->appendGroup(Constants::G_FIND_FLAGS); mfind->appendGroup(Constants::G_FIND_ACTIONS); QList globalcontext = QList() << Core::Constants::C_GLOBAL_ID; - Core::ICommand *cmd; + Core::Command *cmd; QAction *separator; separator = new QAction(this); separator->setSeparator(true); @@ -149,13 +149,13 @@ void FindPlugin::setupMenu() void FindPlugin::setupFilterMenuItems() { - Core::ActionManagerInterface *am = m_core->actionManager(); + Core::ActionManager *am = m_core->actionManager(); QList findInterfaces = ExtensionSystem::PluginManager::instance()->getObjects(); - Core::ICommand *cmd; + Core::Command *cmd; QList globalcontext = QList() << Core::Constants::C_GLOBAL_ID; - Core::IActionContainer *mfind = am->actionContainer(Constants::M_FIND); + Core::ActionContainer *mfind = am->actionContainer(Constants::M_FIND); m_filterActions.clear(); foreach (IFindFilter *filter, findInterfaces) { QAction *action = new QAction(filter->name(), this); diff --git a/src/plugins/find/findplugin.h b/src/plugins/find/findplugin.h index 4a380791376..caad6daa0cc 100644 --- a/src/plugins/find/findplugin.h +++ b/src/plugins/find/findplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/findtoolbar.cpp b/src/plugins/find/findtoolbar.cpp index edfb5015baa..323fdbac58c 100644 --- a/src/plugins/find/findtoolbar.cpp +++ b/src/plugins/find/findtoolbar.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -37,9 +37,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include @@ -138,9 +138,9 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen QList globalcontext; globalcontext << Core::Constants::C_GLOBAL_ID; - Core::ActionManagerInterface *am = ExtensionSystem::PluginManager::instance()->getObject()->actionManager(); - Core::IActionContainer *mfind = am->actionContainer(Constants::M_FIND); - Core::ICommand *cmd; + Core::ActionManager *am = ExtensionSystem::PluginManager::instance()->getObject()->actionManager(); + Core::ActionContainer *mfind = am->actionContainer(Constants::M_FIND); + Core::Command *cmd; m_findInDocumentAction = new QAction(tr("Current Document"), this); cmd = am->registerAction(m_findInDocumentAction, Constants::FIND_IN_DOCUMENT, globalcontext); diff --git a/src/plugins/find/findtoolbar.h b/src/plugins/find/findtoolbar.h index a0055bc18c9..030a57876a3 100644 --- a/src/plugins/find/findtoolbar.h +++ b/src/plugins/find/findtoolbar.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/findtoolwindow.cpp b/src/plugins/find/findtoolwindow.cpp index b448e47ba96..f45c99b2aa3 100644 --- a/src/plugins/find/findtoolwindow.cpp +++ b/src/plugins/find/findtoolwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/findtoolwindow.h b/src/plugins/find/findtoolwindow.h index bbb82cdd27a..f633c641bd6 100644 --- a/src/plugins/find/findtoolwindow.h +++ b/src/plugins/find/findtoolwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/ifindfilter.h b/src/plugins/find/ifindfilter.h index 2fc7b5f02a9..54bfa2f3672 100644 --- a/src/plugins/find/ifindfilter.h +++ b/src/plugins/find/ifindfilter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/ifindsupport.h b/src/plugins/find/ifindsupport.h index 532568471f1..0a525ed8caf 100644 --- a/src/plugins/find/ifindsupport.h +++ b/src/plugins/find/ifindsupport.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/searchresulttreeitemdelegate.cpp b/src/plugins/find/searchresulttreeitemdelegate.cpp index 920e0065033..1f375422607 100644 --- a/src/plugins/find/searchresulttreeitemdelegate.cpp +++ b/src/plugins/find/searchresulttreeitemdelegate.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/searchresulttreeitemdelegate.h b/src/plugins/find/searchresulttreeitemdelegate.h index 37e2413aabf..894fad525fc 100644 --- a/src/plugins/find/searchresulttreeitemdelegate.h +++ b/src/plugins/find/searchresulttreeitemdelegate.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/searchresulttreeitemroles.h b/src/plugins/find/searchresulttreeitemroles.h index b6affc361f3..2ce7128d673 100644 --- a/src/plugins/find/searchresulttreeitemroles.h +++ b/src/plugins/find/searchresulttreeitemroles.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/searchresulttreeitems.cpp b/src/plugins/find/searchresulttreeitems.cpp index b73adf506b6..31242ba092e 100644 --- a/src/plugins/find/searchresulttreeitems.cpp +++ b/src/plugins/find/searchresulttreeitems.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/searchresulttreeitems.h b/src/plugins/find/searchresulttreeitems.h index 7154ed1e46b..f4fa84d9c9e 100644 --- a/src/plugins/find/searchresulttreeitems.h +++ b/src/plugins/find/searchresulttreeitems.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/searchresulttreemodel.cpp b/src/plugins/find/searchresulttreemodel.cpp index 0cabff49995..8fe4f2bbb8c 100644 --- a/src/plugins/find/searchresulttreemodel.cpp +++ b/src/plugins/find/searchresulttreemodel.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/searchresulttreemodel.h b/src/plugins/find/searchresulttreemodel.h index c12196b306d..ea01dc296f8 100644 --- a/src/plugins/find/searchresulttreemodel.h +++ b/src/plugins/find/searchresulttreemodel.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/searchresulttreeview.cpp b/src/plugins/find/searchresulttreeview.cpp index 15ce04b74f5..ea950fb949c 100644 --- a/src/plugins/find/searchresulttreeview.cpp +++ b/src/plugins/find/searchresulttreeview.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/searchresulttreeview.h b/src/plugins/find/searchresulttreeview.h index 9c69c951909..6d546cc2f34 100644 --- a/src/plugins/find/searchresulttreeview.h +++ b/src/plugins/find/searchresulttreeview.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/searchresultwindow.cpp b/src/plugins/find/searchresultwindow.cpp index ffbc1ba4e5b..57cd669515b 100644 --- a/src/plugins/find/searchresultwindow.cpp +++ b/src/plugins/find/searchresultwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/searchresultwindow.h b/src/plugins/find/searchresultwindow.h index 82b88671282..c167727ea05 100644 --- a/src/plugins/find/searchresultwindow.h +++ b/src/plugins/find/searchresultwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/find/textfindconstants.h b/src/plugins/find/textfindconstants.h index a5ac526b9de..334960bb544 100644 --- a/src/plugins/find/textfindconstants.h +++ b/src/plugins/find/textfindconstants.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/git/annotationhighlighter.cpp b/src/plugins/git/annotationhighlighter.cpp index 6fff26f6bfd..9959002fe9c 100644 --- a/src/plugins/git/annotationhighlighter.cpp +++ b/src/plugins/git/annotationhighlighter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/git/annotationhighlighter.h b/src/plugins/git/annotationhighlighter.h index 336942178cb..1873b05c1c4 100644 --- a/src/plugins/git/annotationhighlighter.h +++ b/src/plugins/git/annotationhighlighter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/git/changeselectiondialog.cpp b/src/plugins/git/changeselectiondialog.cpp index cd520aba700..c19b9e94a53 100644 --- a/src/plugins/git/changeselectiondialog.cpp +++ b/src/plugins/git/changeselectiondialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/git/changeselectiondialog.h b/src/plugins/git/changeselectiondialog.h index cef4478e838..68be160c10e 100644 --- a/src/plugins/git/changeselectiondialog.h +++ b/src/plugins/git/changeselectiondialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/git/commitdata.cpp b/src/plugins/git/commitdata.cpp index 8b96fe23c97..1041d7573c0 100644 --- a/src/plugins/git/commitdata.cpp +++ b/src/plugins/git/commitdata.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -32,8 +32,12 @@ ***************************************************************************/ #include "commitdata.h" +#include #include +#include + +const char *const kBranchIndicatorC = "# On branch"; namespace Git { namespace Internal { @@ -85,6 +89,135 @@ void CommitData::clear() untrackedFiles.clear(); } +// Split a state/file spec from git status output +// '#modified:git .pro' +// into state and file ('modified', 'git .pro'). +CommitData::StateFilePair splitStateFileSpecification(const QString &line) +{ + QPair rc; + const int statePos = 2; + const int colonIndex = line.indexOf(QLatin1Char(':'), statePos); + if (colonIndex == -1) + return rc; + rc.first = line.mid(statePos, colonIndex - statePos); + int filePos = colonIndex + 1; + const QChar blank = QLatin1Char(' '); + while (line.at(filePos) == blank) + filePos++; + if (filePos < line.size()) + rc.second = line.mid(filePos, line.size() - filePos); + return rc; +} + +// Convenience to add a state/file spec to a list +static inline bool addStateFileSpecification(const QString &line, QList *list) +{ + const CommitData::StateFilePair sf = splitStateFileSpecification(line); + if (sf.first.isEmpty() || sf.second.isEmpty()) + return false; + list->push_back(sf); + return true; +} + +/* Parse a git status file list: + * \code + # Changes to be committed: + #modified:git.pro + # Changed but not updated: + #modified:git.pro + # Untracked files: + #git.pro + \endcode +*/ + +bool CommitData::filesEmpty() const +{ + return stagedFiles.empty() && unstagedFiles.empty() && untrackedFiles.empty(); +} + +bool CommitData::parseFilesFromStatus(const QString &output) +{ + enum State { None, CommitFiles, NotUpdatedFiles, UntrackedFiles }; + + const QStringList lines = output.split(QLatin1Char('\n')); + const QString branchIndicator = QLatin1String(kBranchIndicatorC); + const QString commitIndicator = QLatin1String("# Changes to be committed:"); + const QString notUpdatedIndicator = QLatin1String("# Changed but not updated:"); + const QString untrackedIndicator = QLatin1String("# Untracked files:"); + + State s = None; + // Match added/changed-not-updated files: "#modified: foo.cpp" + QRegExp filesPattern(QLatin1String("#\\t[^:]+:\\s+.+")); + QTC_ASSERT(filesPattern.isValid(), return false); + + const QStringList::const_iterator cend = lines.constEnd(); + for (QStringList::const_iterator it = lines.constBegin(); it != cend; ++it) { + const QString line = *it; + if (line.startsWith(branchIndicator)) { + panelInfo.branch = line.mid(branchIndicator.size() + 1); + } else { + if (line.startsWith(commitIndicator)) { + s = CommitFiles; + } else { + if (line.startsWith(notUpdatedIndicator)) { + s = NotUpdatedFiles; + } else { + if (line.startsWith(untrackedIndicator)) { + // Now match untracked: "#foo.cpp" + s = UntrackedFiles; + filesPattern = QRegExp(QLatin1String("#\\t.+")); + QTC_ASSERT(filesPattern.isValid(), return false); + } else { + if (filesPattern.exactMatch(line)) { + switch (s) { + case CommitFiles: + addStateFileSpecification(line, &stagedFiles); + break; + case NotUpdatedFiles: + addStateFileSpecification(line, &unstagedFiles); + break; + case UntrackedFiles: + untrackedFiles.push_back(line.mid(2).trimmed()); + break; + case None: + break; + } + } + } + } + } + } + } + return true; +} + +// Convert a spec pair list to a list of file names, optionally +// filter for a state +static QStringList specToFileNames(const QList &files, + const QString &stateFilter) +{ + typedef QList::const_iterator ConstIterator; + if (files.empty()) + return QStringList(); + const bool emptyFilter = stateFilter.isEmpty(); + QStringList rc; + const ConstIterator cend = files.constEnd(); + for (ConstIterator it = files.constBegin(); it != cend; ++it) + if (emptyFilter || stateFilter == it->first) + rc.push_back(it->second); + return rc; +} + +QStringList CommitData::stagedFileNames(const QString &stateFilter) const +{ + return specToFileNames(stagedFiles, stateFilter); +} + +QStringList CommitData::unstagedFileNames(const QString &stateFilter) const +{ + return specToFileNames(unstagedFiles, stateFilter); +} + QDebug operator<<(QDebug d, const CommitData &data) { d << data.panelInfo << data.panelData; diff --git a/src/plugins/git/commitdata.h b/src/plugins/git/commitdata.h index a1dc05ef425..069b9589fcc 100644 --- a/src/plugins/git/commitdata.h +++ b/src/plugins/git/commitdata.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -35,6 +35,7 @@ #define COMMITDATA_H #include +#include QT_BEGIN_NAMESPACE class QDebug; @@ -68,11 +69,26 @@ QDebug operator<<(QDebug d, const GitSubmitEditorPanelData &); struct CommitData { + // A pair of state string/file name ('modified', 'file.cpp'). + typedef QPair StateFilePair; + void clear(); + // Parse the files and the branch of panelInfo + // from a git status output + bool parseFilesFromStatus(const QString &output); + + bool filesEmpty() const; + + // Convenience to retrieve the file names from + // the specification list. Optionally filter for a certain state + QStringList stagedFileNames(const QString &stateFilter = QString()) const; + QStringList unstagedFileNames(const QString &stateFilter = QString()) const; + GitSubmitEditorPanelInfo panelInfo; GitSubmitEditorPanelData panelData; - QStringList stagedFiles; - QStringList unstagedFiles; + + QList stagedFiles; + QList unstagedFiles; QStringList untrackedFiles; }; diff --git a/src/plugins/git/git.pro b/src/plugins/git/git.pro index 7f4ed2fc0cc..2bd1d00d9c4 100644 --- a/src/plugins/git/git.pro +++ b/src/plugins/git/git.pro @@ -20,7 +20,8 @@ HEADERS += gitplugin.h \ gitversioncontrol.h \ gitsettings.h \ branchdialog.h \ - branchmodel.h + branchmodel.h \ + gitcommand.h SOURCES += gitplugin.cpp \ gitoutputwindow.cpp \ gitclient.cpp \ @@ -34,7 +35,8 @@ SOURCES += gitplugin.cpp \ gitversioncontrol.cpp \ gitsettings.cpp \ branchdialog.cpp \ - branchmodel.cpp + branchmodel.cpp \ + gitcommand.cpp FORMS += changeselectiondialog.ui \ settingspage.ui \ gitsubmitpanel.ui \ diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 281a9572a21..81820b8fa0f 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -32,24 +32,24 @@ ***************************************************************************/ #include "gitclient.h" +#include "gitcommand.h" #include "commitdata.h" #include "gitconstants.h" #include "gitplugin.h" #include "gitsubmiteditor.h" -#include +#include #include #include #include #include -#include +#include #include #include #include #include -#include #include #include #include @@ -61,7 +61,6 @@ using namespace Git; using namespace Git::Internal; -const char *const kGitCommand = "git"; const char *const kGitDirectoryC = ".git"; const char *const kBranchIndicatorC = "# On branch"; @@ -184,29 +183,59 @@ VCSBase::VCSBaseEditor return rc; } -void GitClient::diff(const QString &workingDirectory, const QStringList &fileNames) +void GitClient::diff(const QString &workingDirectory, + const QStringList &diffArgs, + const QStringList &unstagedFileNames, + const QStringList &stagedFileNames) { - if (Git::Constants::debug) - qDebug() << "diff" << workingDirectory << fileNames; - QStringList arguments; - arguments << QLatin1String("diff") << QLatin1String("--") << fileNames; + if (Git::Constants::debug) + qDebug() << "diff" << workingDirectory << unstagedFileNames << stagedFileNames; + + const QString binary = QLatin1String(Constants::GIT_BINARY); const QString kind = QLatin1String(Git::Constants::GIT_DIFF_EDITOR_KIND); const QString title = tr("Git Diff"); VCSBase::VCSBaseEditor *editor = createVCSEditor(kind, title, workingDirectory, true, "originalFileName", workingDirectory); - executeGit(workingDirectory, arguments, editor); + // Create a batch of 2 commands to be run after each other in case + // we have a mixture of staged/unstaged files as is the case + // when using the submit dialog. + GitCommand *command = createCommand(workingDirectory, editor); + // Directory diff? + if (unstagedFileNames.empty() && stagedFileNames.empty()) { + QStringList arguments; + arguments << QLatin1String("diff") << diffArgs; + m_plugin->outputWindow()->append(formatCommand(binary, arguments)); + command->addJob(arguments); + } else { + // Files diff. + if (!unstagedFileNames.empty()) { + QStringList arguments; + arguments << QLatin1String("diff") << diffArgs << QLatin1String("--") << unstagedFileNames; + m_plugin->outputWindow()->append(formatCommand(binary, arguments)); + command->addJob(arguments); + } + if (!stagedFileNames.empty()) { + QStringList arguments; + arguments << QLatin1String("diff") << QLatin1String("--cached") << diffArgs << QLatin1String("--") << stagedFileNames; + m_plugin->outputWindow()->append(formatCommand(binary, arguments)); + command->addJob(arguments); + } + } + command->execute(); } -void GitClient::diff(const QString &workingDirectory, const QString &fileName) +void GitClient::diff(const QString &workingDirectory, + const QStringList &diffArgs, + const QString &fileName) { if (Git::Constants::debug) qDebug() << "diff" << workingDirectory << fileName; QStringList arguments; arguments << QLatin1String("diff"); if (!fileName.isEmpty()) - arguments << QLatin1String("--") << fileName; + arguments << diffArgs << QLatin1String("--") << fileName; const QString kind = QLatin1String(Git::Constants::GIT_DIFF_EDITOR_KIND); const QString title = tr("Git Diff %1").arg(fileName); @@ -435,42 +464,47 @@ bool GitClient::synchronousShow(const QString &workingDirectory, const QString & return true; } - -void GitClient::executeGit(const QString &workingDirectory, const QStringList &arguments, - VCSBase::VCSBaseEditor* editor, - bool outputToWindow) +// Factory function to create an asynchronous command +GitCommand *GitClient::createCommand(const QString &workingDirectory, + VCSBase::VCSBaseEditor* editor, + bool outputToWindow) { if (Git::Constants::debug) - qDebug() << "executeGit" << workingDirectory << arguments << editor; + qDebug() << Q_FUNC_INFO << workingDirectory << editor; GitOutputWindow *outputWindow = m_plugin->outputWindow(); - outputWindow->append(formatCommand(QLatin1String(kGitCommand), arguments)); - QProcess process; ProjectExplorer::Environment environment = ProjectExplorer::Environment::systemEnvironment(); - if (m_settings.adoptPath) environment.set(QLatin1String("PATH"), m_settings.path); - GitCommand* command = new GitCommand(); + GitCommand* command = new GitCommand(workingDirectory, environment); if (outputToWindow) { if (!editor) { // assume that the commands output is the important thing - connect(command, SIGNAL(outputText(QString)), this, SLOT(appendAndPopup(QString))); connect(command, SIGNAL(outputData(QByteArray)), this, SLOT(appendDataAndPopup(QByteArray))); } else { - connect(command, SIGNAL(outputText(QString)), outputWindow, SLOT(append(QString))); connect(command, SIGNAL(outputData(QByteArray)), outputWindow, SLOT(appendData(QByteArray))); } } else { QTC_ASSERT(editor, /**/); - connect(command, SIGNAL(outputText(QString)), editor, SLOT(setPlainText(QString))); connect(command, SIGNAL(outputData(QByteArray)), editor, SLOT(setPlainTextData(QByteArray))); } if (outputWindow) connect(command, SIGNAL(errorText(QString)), this, SLOT(appendAndPopup(QString))); + return command; +} - command->execute(arguments, workingDirectory, environment); +// Execute a single command +void GitClient::executeGit(const QString &workingDirectory, + const QStringList &arguments, + VCSBase::VCSBaseEditor* editor, + bool outputToWindow) +{ + m_plugin->outputWindow()->append(formatCommand(QLatin1String(Constants::GIT_BINARY), arguments)); + GitCommand *command = createCommand(workingDirectory, editor, outputToWindow); + command->addJob(arguments); + command->execute(); } void GitClient::appendDataAndPopup(const QByteArray &data) @@ -493,7 +527,7 @@ bool GitClient::synchronousGit(const QString &workingDirectory, { if (Git::Constants::debug) qDebug() << "synchronousGit" << workingDirectory << arguments; - const QString binary = QLatin1String(kGitCommand); + const QString binary = QLatin1String(Constants::GIT_BINARY); if (logCommandToWindow) m_plugin->outputWindow()->append(formatCommand(binary, arguments)); @@ -622,73 +656,6 @@ GitClient::StatusResult GitClient::gitStatus(const QString &workingDirectory, return StatusChanged; } -/* Parse a git status file list: - * \code - # Changes to be committed: - #modified:git.pro - # Changed but not updated: - #modified:git.pro - # Untracked files: - #git.pro - \endcode -*/ -static bool parseFiles(const QString &output, CommitData *d) -{ - enum State { None, CommitFiles, NotUpdatedFiles, UntrackedFiles }; - - const QStringList lines = output.split(QLatin1Char('\n')); - const QString branchIndicator = QLatin1String(kBranchIndicatorC); - const QString commitIndicator = QLatin1String("# Changes to be committed:"); - const QString notUpdatedIndicator = QLatin1String("# Changed but not updated:"); - const QString untrackedIndicator = QLatin1String("# Untracked files:"); - - State s = None; - // Match added/changed-not-updated files: "#modified: foo.cpp" - QRegExp filesPattern(QLatin1String("#\\t[^:]+:\\s+.+")); - QTC_ASSERT(filesPattern.isValid(), return false); - - const QStringList::const_iterator cend = lines.constEnd(); - for (QStringList::const_iterator it = lines.constBegin(); it != cend; ++it) { - const QString line = *it; - if (line.startsWith(branchIndicator)) { - d->panelInfo.branch = line.mid(branchIndicator.size() + 1); - } else { - if (line.startsWith(commitIndicator)) { - s = CommitFiles; - } else { - if (line.startsWith(notUpdatedIndicator)) { - s = NotUpdatedFiles; - } else { - if (line.startsWith(untrackedIndicator)) { - // Now match untracked: "#foo.cpp" - s = UntrackedFiles; - filesPattern = QRegExp(QLatin1String("#\\t.+")); - QTC_ASSERT(filesPattern.isValid(), return false); - } else { - if (filesPattern.exactMatch(line)) { - const QString fileSpec = line.mid(2).trimmed(); - switch (s) { - case CommitFiles: - d->stagedFiles.push_back(trimFileSpecification(fileSpec)); - break; - case NotUpdatedFiles: - d->unstagedFiles.push_back(trimFileSpecification(fileSpec)); - break; - case UntrackedFiles: - d->untrackedFiles.push_back(fileSpec); - break; - case None: - break; - } - } - } - } - } - } - } - return !d->stagedFiles.empty() || !d->unstagedFiles.empty() || !d->untrackedFiles.empty(); -} - // Filter out untracked files that are not part of the project static void filterUntrackedFilesOfProject(const QString &repoDir, QStringList *l) { @@ -771,19 +738,15 @@ bool GitClient::getCommitData(const QString &workingDirectory, // # // # list of files... - if (!parseFiles(output, d)) { + if (!d->parseFilesFromStatus(output)) { *errorMessage = msgParseFilesFailed(); return false; } - // Filter out untracked files that are not part of the project and, - // for symmetry, insert the prefix "untracked:" (as "added:" or ":modified" - // for staged files). + // Filter out untracked files that are not part of the project filterUntrackedFilesOfProject(repoDirectory, &d->untrackedFiles); - if (!d->untrackedFiles.empty()) { - const QString untrackedPrefix = QLatin1String("untracked: "); - const QStringList::iterator pend = d->untrackedFiles.end(); - for (QStringList::iterator it = d->untrackedFiles.begin(); it != pend; ++it) - it->insert(0, untrackedPrefix); + if (d->filesEmpty()) { + *errorMessage = msgNoChangedFiles(); + return false; } d->panelData.author = readConfigValue(workingDirectory, QLatin1String("user.name")); @@ -881,7 +844,7 @@ GitClient::RevertResult GitClient::revertI(QStringList files, bool *ptrToIsDirec return RevertFailed; } CommitData data; - if (!parseFiles(output, &data)) { + if (!data.parseFilesFromStatus(output)) { *errorMessage = msgParseFilesFailed(); return RevertFailed; } @@ -896,9 +859,9 @@ GitClient::RevertResult GitClient::revertI(QStringList files, bool *ptrToIsDirec } // From the status output, determine all modified [un]staged files. - const QString modifiedPattern = QLatin1String("modified: "); - const QStringList allStagedFiles = GitSubmitEditor::statusListToFileList(data.stagedFiles.filter(modifiedPattern)); - const QStringList allUnstagedFiles = GitSubmitEditor::statusListToFileList(data.unstagedFiles.filter(modifiedPattern)); + const QString modifiedState = QLatin1String("modified"); + const QStringList allStagedFiles = data.stagedFileNames(modifiedState); + const QStringList allUnstagedFiles = data.unstagedFileNames(modifiedState); // Unless a directory was passed, filter all modified files for the // argument file list. QStringList stagedFiles = allStagedFiles; @@ -1040,67 +1003,3 @@ void GitClient::setSettings(const GitSettings &s) } } -// ------------------------ GitCommand -GitCommand::GitCommand() -{ -} - -GitCommand::~GitCommand() -{ -} - -void GitCommand::execute(const QStringList &arguments, - const QString &workingDirectory, - const ProjectExplorer::Environment &environment) -{ - if (Git::Constants::debug) - qDebug() << "GitCommand::execute" << workingDirectory << arguments; - - // For some reason QtConcurrent::run() only works on this - QFuture task = QtConcurrent::run(this, &GitCommand::run - , arguments - , workingDirectory - , environment); - QString taskName = QLatin1String("Git ") + arguments[0]; - - Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject(); - core->progressManager()->addTask(task, taskName - , QLatin1String("Git.action") - , Core::ProgressManagerInterface::CloseOnSuccess); -} - -void GitCommand::run(const QStringList &arguments, - const QString &workingDirectory, - const ProjectExplorer::Environment &environment) -{ - if (Git::Constants::debug) - qDebug() << "GitCommand::run" << workingDirectory << arguments; - QProcess process; - if (!workingDirectory.isEmpty()) - process.setWorkingDirectory(workingDirectory); - - ProjectExplorer::Environment env = environment; - if (env.toStringList().isEmpty()) - env = ProjectExplorer::Environment::systemEnvironment(); - process.setEnvironment(env.toStringList()); - - process.start(QLatin1String(kGitCommand), arguments); - if (!process.waitForFinished()) { - emit errorText(QLatin1String("Error: Git timed out")); - return; - } - - const QByteArray output = process.readAllStandardOutput(); - if (output.isEmpty()) { - if (arguments.at(0) == QLatin1String("diff")) - emit outputText(tr("The file does not differ from HEAD")); - } else { - emit outputData(output); - } - const QByteArray error = process.readAllStandardError(); - if (!error.isEmpty()) - emit errorText(QString::fromLocal8Bit(error)); - - // As it is used asynchronously, we need to delete ourselves - this->deleteLater(); -} diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h index f09daa00ab8..aa4ad97015a 100644 --- a/src/plugins/git/gitclient.h +++ b/src/plugins/git/gitclient.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -38,7 +38,6 @@ #include #include -#include #include #include @@ -78,8 +77,9 @@ public: static QString findRepositoryForFile(const QString &fileName); static QString findRepositoryForDirectory(const QString &dir); - void diff(const QString &workingDirectory, const QString &fileName); - void diff(const QString &workingDirectory, const QStringList &fileNames); + void diff(const QString &workingDirectory, const QStringList &diffArgs, const QString &fileName); + void diff(const QString &workingDirectory, const QStringList &diffArgs, + const QStringList &unstagedFileNames, const QStringList &stagedFileNames= QStringList()); void status(const QString &workingDirectory); void log(const QString &workingDirectory, const QString &fileName); @@ -154,11 +154,14 @@ private: const char *registerDynamicProperty, const QString &dynamicPropertyValue) const; + GitCommand *createCommand(const QString &workingDirectory, + VCSBase::VCSBaseEditor* editor = 0, + bool outputToWindow = false); void executeGit(const QString &workingDirectory, - const QStringList &arguments, - VCSBase::VCSBaseEditor* editor = 0, - bool outputToWindow = false); + const QStringList &arguments, + VCSBase::VCSBaseEditor* editor = 0, + bool outputToWindow = false); bool synchronousGit(const QString &workingDirectory, const QStringList &arguments, @@ -175,24 +178,6 @@ private: GitSettings m_settings; }; -class GitCommand : public QObject -{ - Q_OBJECT -public: - GitCommand(); - ~GitCommand(); - void execute(const QStringList &arguments, - const QString &workingDirectory, - const ProjectExplorer::Environment &environment); - void run(const QStringList &arguments, - const QString &workingDirectory, - const ProjectExplorer::Environment &environment); - -Q_SIGNALS: - void outputData(const QByteArray&); - void outputText(const QString&); - void errorText(const QString&); -}; } // namespace Internal } // namespace Git diff --git a/src/plugins/git/gitcommand.cpp b/src/plugins/git/gitcommand.cpp new file mode 100644 index 00000000000..703e42a8668 --- /dev/null +++ b/src/plugins/git/gitcommand.cpp @@ -0,0 +1,138 @@ +/*************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** +** Non-Open Source Usage +** +** Licensees may use this file in accordance with the Qt Beta Version +** License Agreement, Agreement version 2.2 provided with the Software or, +** alternatively, in accordance with the terms contained in a written +** agreement between you and Nokia. +** +** GNU General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the packaging +** of this file. Please review the following information to ensure GNU +** General Public Licensing requirements will be met: +** +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt GPL Exception +** version 1.3, included in the file GPL_EXCEPTION.txt in this package. +** +***************************************************************************/ + +#include "gitcommand.h" +#include "gitconstants.h" + +#include +#include + +#include +#include +#include +#include + +namespace Git { +namespace Internal { + +// Convert environment to list, default to system one. +static inline QStringList environmentToList(const ProjectExplorer::Environment &environment) +{ + const QStringList list = environment.toStringList(); + if (!list.empty()) + return list; + return ProjectExplorer::Environment::systemEnvironment().toStringList(); +} + +GitCommand::Job::Job(const QStringList &a) : + arguments(a) +{ +} + +GitCommand::GitCommand(const QString &workingDirectory, + ProjectExplorer::Environment &environment) : + m_workingDirectory(workingDirectory), + m_environment(environmentToList(environment)) +{ +} + +void GitCommand::addJob(const QStringList &arguments) +{ + m_jobs.push_back(Job(arguments)); +} + +void GitCommand::execute() +{ + if (Git::Constants::debug) + qDebug() << "GitCommand::execute" << m_workingDirectory << m_jobs.size(); + + if (m_jobs.empty()) + return; + + // For some reason QtConcurrent::run() only works on this + QFuture task = QtConcurrent::run(this, &GitCommand::run); + const QString taskName = QLatin1String("Git ") + m_jobs.front().arguments.at(0); + + Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject(); + core->progressManager()->addTask(task, taskName, + QLatin1String("Git.action"), + Core::ProgressManager::CloseOnSuccess); +} + +void GitCommand::run() +{ + if (Git::Constants::debug) + qDebug() << "GitCommand::run" << m_workingDirectory << m_jobs.size(); + QProcess process; + if (!m_workingDirectory.isEmpty()) + process.setWorkingDirectory(m_workingDirectory); + + process.setEnvironment(m_environment); + + QByteArray output; + QString error; + + const int count = m_jobs.size(); + bool ok = true; + for (int j = 0; j < count; j++) { + if (Git::Constants::debug) + qDebug() << "GitCommand::run" << j << '/' << count << m_jobs.at(j).arguments; + + process.start(QLatin1String(Constants::GIT_BINARY), m_jobs.at(j).arguments); + if (!process.waitForFinished()) { + ok = false; + error += QLatin1String("Error: Git timed out"); + break; + } + + output += process.readAllStandardOutput(); + error += QString::fromLocal8Bit(process.readAllStandardError()); + } + + // Special hack: Always produce output for diff + if (ok && output.isEmpty() && m_jobs.front().arguments.at(0) == QLatin1String("diff")) { + output += "The file does not differ from HEAD"; + } + + if (ok && !output.isEmpty()) + emit outputData(output); + + if (!error.isEmpty()) + emit errorText(error); + + // As it is used asynchronously, we need to delete ourselves + this->deleteLater(); +} + +} // namespace Internal +} // namespace Git diff --git a/src/plugins/coreplugin/scriptmanager/scriptmanagerinterface.h b/src/plugins/git/gitcommand.h similarity index 51% rename from src/plugins/coreplugin/scriptmanager/scriptmanagerinterface.h rename to src/plugins/git/gitcommand.h index df145822e2a..a587b748761 100644 --- a/src/plugins/coreplugin/scriptmanager/scriptmanagerinterface.h +++ b/src/plugins/git/gitcommand.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -31,46 +31,49 @@ ** ***************************************************************************/ -#ifndef SCRIPTMANAGERINTERFACE_H -#define SCRIPTMANAGERINTERFACE_H +#ifndef GITCOMMAND_H +#define GITCOMMAND_H -#include +#include #include -#include -#include -namespace Core { +namespace Git { +namespace Internal { -/* Script Manager. - * Provides a script engine that is initialized with - * QWorkBenchs interfaces and allows for running scripts. - * @{todo} Should it actually manage script files, too? */ - -class CORE_EXPORT ScriptManagerInterface : public QObject +class GitCommand : public QObject { Q_OBJECT public: - // A stack frame as returned by a failed invocation (exception) - // fileName may be empty. lineNumber can be 0 for the top frame (goof-up?). - struct StackFrame { - QString function; - QString fileName; - int lineNumber; + explicit GitCommand(const QString &workingDirectory, + ProjectExplorer::Environment &environment); + + + void addJob(const QStringList &arguments); + void execute(); + +private: + void run(); + +Q_SIGNALS: + void outputData(const QByteArray&); + void errorText(const QString&); + +private: + struct Job { + explicit Job(const QStringList &a); + + QStringList arguments; }; - typedef QList Stack; - ScriptManagerInterface(QObject *parent = 0) : QObject(parent) {} - virtual ~ScriptManagerInterface() { } + QStringList environment() const; - // Access the engine (for plugins to wrap additional interfaces). - virtual QScriptEngine &scriptEngine() = 0; + const QString m_workingDirectory; + const QStringList m_environment; - // Run a script - virtual bool runScript(const QString &script, QString *errorMessage, Stack *errorStack) = 0; - virtual bool runScript(const QString &script, QString *errorMessage) = 0; + QList m_jobs; }; -} // namespace Core - -#endif // SCRIPTMANAGERINTERFACE_H +} // namespace Internal +} // namespace Git +#endif // GITCOMMAND_H diff --git a/src/plugins/git/gitconstants.h b/src/plugins/git/gitconstants.h index 6719221f4c0..b539046ffb5 100644 --- a/src/plugins/git/gitconstants.h +++ b/src/plugins/git/gitconstants.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -47,6 +47,7 @@ const char * const GITSUBMITEDITOR_KIND = "Git Submit Editor"; const char * const SUBMIT_CURRENT = "Nokia.Git.SubmitCurrentLog"; const char * const DIFF_SELECTED = "Nokia.Git.DiffSelectedFilesInLog"; const char * const SUBMIT_MIMETYPE = "application/vnd.nokia.text.git.submit"; +const char * const GIT_BINARY = "git"; const char * const DIFF_FILE_INDICATOR = "--- "; enum { debug = 0 }; diff --git a/src/plugins/git/giteditor.cpp b/src/plugins/git/giteditor.cpp index e45029d1aa6..1a8ff4d09ba 100644 --- a/src/plugins/git/giteditor.cpp +++ b/src/plugins/git/giteditor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/git/giteditor.h b/src/plugins/git/giteditor.h index 23a6953dd18..d9490b87130 100644 --- a/src/plugins/git/giteditor.h +++ b/src/plugins/git/giteditor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/git/gitoutputwindow.cpp b/src/plugins/git/gitoutputwindow.cpp index a1d76e7553e..b5ae4d129c5 100644 --- a/src/plugins/git/gitoutputwindow.cpp +++ b/src/plugins/git/gitoutputwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/git/gitoutputwindow.h b/src/plugins/git/gitoutputwindow.h index 898381a3d90..b539d6cef5a 100644 --- a/src/plugins/git/gitoutputwindow.h +++ b/src/plugins/git/gitoutputwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index fe2d93adbff..e71ccfea45e 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include @@ -210,14 +210,10 @@ GitPlugin *GitPlugin::instance() static const VCSBase::VCSBaseSubmitEditorParameters submitParameters = { Git::Constants::SUBMIT_MIMETYPE, Git::Constants::GITSUBMITEDITOR_KIND, - Git::Constants::C_GITSUBMITEDITOR, - Core::Constants::UNDO, - Core::Constants::REDO, - Git::Constants::SUBMIT_CURRENT, - Git::Constants::DIFF_SELECTED + Git::Constants::C_GITSUBMITEDITOR }; -static Core::ICommand *createSeparator(Core::ActionManagerInterface *am, +static Core::Command *createSeparator(Core::ActionManager *am, const QList &context, const QString &id, QObject *parent) @@ -267,12 +263,12 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message) addObject(m_versionControl); //register actions - Core::ActionManagerInterface *actionManager = m_core->actionManager(); + Core::ActionManager *actionManager = m_core->actionManager(); - Core::IActionContainer *toolsContainer = + Core::ActionContainer *toolsContainer = actionManager->actionContainer(Core::Constants::M_TOOLS); - Core::IActionContainer *gitContainer = + Core::ActionContainer *gitContainer = actionManager->createMenu(QLatin1String("Git")); gitContainer->menu()->setTitle(tr("&Git")); toolsContainer->addMenu(gitContainer); @@ -281,11 +277,11 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message) connect(m_versionControl, SIGNAL(enabledChanged(bool)), ma, SLOT(setVisible(bool))); } - Core::ICommand *command; + Core::Command *command; m_diffAction = new QAction(tr("Diff current file"), this); command = actionManager->registerAction(m_diffAction, "Git.Diff", globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+D"))); connect(m_diffAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile())); gitContainer->addAction(command); @@ -293,47 +289,47 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message) m_statusAction = new QAction(tr("File Status"), this); command = actionManager->registerAction(m_statusAction, "Git.Status", globalcontext); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+S"))); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_statusAction, SIGNAL(triggered()), this, SLOT(statusFile())); gitContainer->addAction(command); m_logAction = new QAction(tr("Log File"), this); command = actionManager->registerAction(m_logAction, "Git.Log", globalcontext); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+L"))); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_logAction, SIGNAL(triggered()), this, SLOT(logFile())); gitContainer->addAction(command); m_blameAction = new QAction(tr("Blame"), this); command = actionManager->registerAction(m_blameAction, "Git.Blame", globalcontext); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+B"))); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_blameAction, SIGNAL(triggered()), this, SLOT(blameFile())); gitContainer->addAction(command); m_undoFileAction = new QAction(tr("Undo Changes"), this); command = actionManager->registerAction(m_undoFileAction, "Git.Undo", globalcontext); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+U"))); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_undoFileAction, SIGNAL(triggered()), this, SLOT(undoFileChanges())); gitContainer->addAction(command); m_stageAction = new QAction(tr("Stage file for commit"), this); command = actionManager->registerAction(m_stageAction, "Git.Stage", globalcontext); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+A"))); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_stageAction, SIGNAL(triggered()), this, SLOT(stageFile())); gitContainer->addAction(command); m_unstageAction = new QAction(tr("Unstage file from commit"), this); command = actionManager->registerAction(m_unstageAction, "Git.Unstage", globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_unstageAction, SIGNAL(triggered()), this, SLOT(unstageFile())); gitContainer->addAction(command); m_revertAction = new QAction(tr("Revert..."), this); command = actionManager->registerAction(m_revertAction, "Git.Revert", globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertFile())); gitContainer->addAction(command); @@ -342,26 +338,26 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message) m_diffProjectAction = new QAction(tr("Diff current project"), this); command = actionManager->registerAction(m_diffProjectAction, "Git.DiffProject", globalcontext); command->setDefaultKeySequence(QKeySequence("Alt+G,Alt+Shift+D")); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffCurrentProject())); gitContainer->addAction(command); m_statusProjectAction = new QAction(tr("Project status"), this); command = actionManager->registerAction(m_statusProjectAction, "Git.StatusProject", globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_statusProjectAction, SIGNAL(triggered()), this, SLOT(statusProject())); gitContainer->addAction(command); m_logProjectAction = new QAction(tr("Log project"), this); command = actionManager->registerAction(m_logProjectAction, "Git.LogProject", globalcontext); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+K"))); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_logProjectAction, SIGNAL(triggered()), this, SLOT(logProject())); gitContainer->addAction(command); m_undoProjectAction = new QAction(tr("Undo Project Changes"), this); command = actionManager->registerAction(m_undoProjectAction, "Git.UndoProject", globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_undoProjectAction, SIGNAL(triggered()), this, SLOT(undoProjectChanges())); gitContainer->addAction(command); @@ -370,33 +366,33 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message) m_stashAction = new QAction(tr("Stash"), this); m_stashAction->setToolTip("Saves the current state of your work."); command = actionManager->registerAction(m_stashAction, "Git.Stash", globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_stashAction, SIGNAL(triggered()), this, SLOT(stash())); gitContainer->addAction(command); m_pullAction = new QAction(tr("Pull"), this); command = actionManager->registerAction(m_pullAction, "Git.Pull", globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_pullAction, SIGNAL(triggered()), this, SLOT(pull())); gitContainer->addAction(command); m_stashPopAction = new QAction(tr("Stash pop"), this); m_stashAction->setToolTip("Restores changes saved to the stash list using \"Stash\"."); command = actionManager->registerAction(m_stashPopAction, "Git.StashPop", globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_stashPopAction, SIGNAL(triggered()), this, SLOT(stashPop())); gitContainer->addAction(command); m_commitAction = new QAction(tr("Commit..."), this); command = actionManager->registerAction(m_commitAction, "Git.Commit", globalcontext); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+C"))); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_commitAction, SIGNAL(triggered()), this, SLOT(startCommit())); gitContainer->addAction(command); m_pushAction = new QAction(tr("Push"), this); command = actionManager->registerAction(m_pushAction, "Git.Push", globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_pushAction, SIGNAL(triggered()), this, SLOT(push())); gitContainer->addAction(command); @@ -404,19 +400,19 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message) m_branchListAction = new QAction(tr("Branches..."), this); command = actionManager->registerAction(m_branchListAction, "Git.BranchList", globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_branchListAction, SIGNAL(triggered()), this, SLOT(branchList())); gitContainer->addAction(command); m_stashListAction = new QAction(tr("List stashes"), this); command = actionManager->registerAction(m_stashListAction, "Git.StashList", globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_stashListAction, SIGNAL(triggered()), this, SLOT(stashList())); gitContainer->addAction(command); m_showAction = new QAction(tr("Show commit..."), this); command = actionManager->registerAction(m_showAction, "Git.ShowCommit", globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_showAction, SIGNAL(triggered()), this, SLOT(showCommit())); gitContainer->addAction(command); @@ -450,19 +446,17 @@ void GitPlugin::extensionsInitialized() m_projectExplorer = ExtensionSystem::PluginManager::instance()->getObject(); } -void GitPlugin::submitEditorDiff(const QStringList &files) +void GitPlugin::submitEditorDiff(const QStringList &unstaged, const QStringList &staged) { - if (files.empty()) - return; - m_gitClient->diff(m_submitRepository, files); + m_gitClient->diff(m_submitRepository, QStringList(), unstaged, staged); } void GitPlugin::diffCurrentFile() { - QFileInfo fileInfo = currentFile(); - QString fileName = fileInfo.fileName(); - QString workingDirectory = fileInfo.absolutePath(); - m_gitClient->diff(workingDirectory, fileName); + const QFileInfo fileInfo = currentFile(); + const QString fileName = fileInfo.fileName(); + const QString workingDirectory = fileInfo.absolutePath(); + m_gitClient->diff(workingDirectory, QStringList(), fileName); } void GitPlugin::diffCurrentProject() @@ -470,7 +464,7 @@ void GitPlugin::diffCurrentProject() QString workingDirectory = getWorkingDirectory(); if (workingDirectory.isEmpty()) return; - m_gitClient->diff(workingDirectory, QString()); + m_gitClient->diff(workingDirectory, QStringList(), QString()); } QFileInfo GitPlugin::currentFile() const @@ -602,7 +596,7 @@ void GitPlugin::startCommit() // Store repository for diff and the original list of // files to be able to unstage files the user unchecks m_submitRepository = data.panelInfo.repository; - m_submitOrigCommitFiles = GitSubmitEditor::statusListToFileList(data.stagedFiles); + m_submitOrigCommitFiles = data.stagedFileNames(); if (Git::Constants::debug) qDebug() << Q_FUNC_INFO << data << commitTemplate; @@ -635,12 +629,9 @@ Core::IEditor *GitPlugin::openSubmitEditor(const QString &fileName, const Commit QTC_ASSERT(submitEditor, return 0); // The actions are for some reason enabled by the context switching // mechanism. Disable them correctly. - m_submitCurrentAction->setEnabled(!cd.stagedFiles.empty()); - m_diffSelectedFilesAction->setEnabled(false); - m_undoAction->setEnabled(false); - m_redoAction->setEnabled(false); + submitEditor->registerActions(m_undoAction, m_redoAction, m_submitCurrentAction, m_diffSelectedFilesAction); submitEditor->setCommitData(cd); - connect(submitEditor, SIGNAL(diffSelectedFiles(QStringList)), this, SLOT(submitEditorDiff(QStringList))); + connect(submitEditor, SIGNAL(diff(QStringList,QStringList)), this, SLOT(submitEditorDiff(QStringList,QStringList))); return editor; } diff --git a/src/plugins/git/gitplugin.h b/src/plugins/git/gitplugin.h index 39287e1939a..22fcea7c011 100644 --- a/src/plugins/git/gitplugin.h +++ b/src/plugins/git/gitplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -108,7 +108,7 @@ public slots: private slots: void diffCurrentFile(); void diffCurrentProject(); - void submitEditorDiff(const QStringList &); + void submitEditorDiff(const QStringList &unstaged, const QStringList &staged); void submitCurrentLog(); void statusFile(); void statusProject(); diff --git a/src/plugins/git/gitsettings.cpp b/src/plugins/git/gitsettings.cpp index dff33129186..2b528a72d2a 100644 --- a/src/plugins/git/gitsettings.cpp +++ b/src/plugins/git/gitsettings.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/git/gitsettings.h b/src/plugins/git/gitsettings.h index 6b012f36f6d..59169922605 100644 --- a/src/plugins/git/gitsettings.h +++ b/src/plugins/git/gitsettings.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/git/gitsubmiteditor.cpp b/src/plugins/git/gitsubmiteditor.cpp index fe93a0c6ad1..aa304a2be07 100644 --- a/src/plugins/git/gitsubmiteditor.cpp +++ b/src/plugins/git/gitsubmiteditor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -36,15 +36,27 @@ #include "gitconstants.h" #include "commitdata.h" +#include + #include namespace Git { namespace Internal { +enum { FileTypeRole = Qt::UserRole + 1 }; +enum FileType { StagedFile , UnstagedFile, UntrackedFile }; + +/* The problem with git is that no diff can be obtained to for a random + * multiselection of staged/unstaged files; it requires the --cached + * option for staged files. So, we sort apart the diff file lists + * according to a type flag we add to the model. */ + GitSubmitEditor::GitSubmitEditor(const VCSBase::VCSBaseSubmitEditorParameters *parameters, QWidget *parent) : - VCSBaseSubmitEditor(parameters, new GitSubmitEditorWidget(parent)) + VCSBaseSubmitEditor(parameters, new GitSubmitEditorWidget(parent)), + m_model(0) { setDisplayName(tr("Git Commit")); + connect(this, SIGNAL(diffSelectedFiles(QStringList)), this, SLOT(slotDiffSelected(QStringList))); } GitSubmitEditorWidget *GitSubmitEditor::submitEditorWidget() @@ -52,14 +64,20 @@ GitSubmitEditorWidget *GitSubmitEditor::submitEditorWidget() return static_cast(widget()); } -QStringList GitSubmitEditor::statusListToFileList(const QStringList &rawList) +// Utility to add a list of state/file pairs to the model +// setting a file type. +static void addStateFileListToModel(const QList &l, + bool checked, FileType ft, + VCSBase::SubmitFileModel *model) { - if (rawList.empty()) - return rawList; - QStringList rc; - foreach (const QString &rf, rawList) - rc.push_back(fileFromStatusLine(rf)); - return rc; + + typedef QList::const_iterator ConstIterator; + if (!l.empty()) { + const ConstIterator cend = l.constEnd(); + const QVariant fileTypeData(ft); + for (ConstIterator it = l.constBegin(); it != cend; ++it) + model->addFile(it->second, it->first, checked).front()->setData(fileTypeData, FileTypeRole); + } } void GitSubmitEditor::setCommitData(const CommitData &d) @@ -67,10 +85,44 @@ void GitSubmitEditor::setCommitData(const CommitData &d) submitEditorWidget()->setPanelData(d.panelData); submitEditorWidget()->setPanelInfo(d.panelInfo); - addFiles(d.stagedFiles, true, true); - // Not Updated: Initially unchecked - addFiles(d.unstagedFiles, false, true); - addFiles(d.untrackedFiles, false, true); + m_model = new VCSBase::SubmitFileModel(this); + addStateFileListToModel(d.stagedFiles, true, StagedFile, m_model); + addStateFileListToModel(d.unstagedFiles, false, UnstagedFile, m_model); + if (!d.untrackedFiles.empty()) { + const QString untrackedSpec = QLatin1String("untracked"); + const QVariant fileTypeData(UntrackedFile); + const QStringList::const_iterator cend = d.untrackedFiles.constEnd(); + for (QStringList::const_iterator it = d.untrackedFiles.constBegin(); it != cend; ++it) + m_model->addFile(*it, untrackedSpec, false).front()->setData(fileTypeData, FileTypeRole); + } + setFileModel(m_model); +} + +void GitSubmitEditor::slotDiffSelected(const QStringList &files) +{ + // Sort it apart into staged/unstaged files + QStringList unstagedFiles; + QStringList stagedFiles; + const int fileColumn = fileNameColumn(); + const int rowCount = m_model->rowCount(); + for (int r = 0; r < rowCount; r++) { + const QString fileName = m_model->item(r, fileColumn)->text(); + if (files.contains(fileName)) { + const FileType ft = static_cast(m_model->item(r, 0)->data(FileTypeRole).toInt()); + switch (ft) { + case StagedFile: + stagedFiles.push_back(fileName); + break; + case UnstagedFile: + unstagedFiles.push_back(fileName); + break; + case UntrackedFile: + break; + } + } + } + if (!unstagedFiles.empty() || !stagedFiles.empty()) + emit diff(unstagedFiles, stagedFiles); } GitSubmitEditorPanelData GitSubmitEditor::panelData() const @@ -78,18 +130,5 @@ GitSubmitEditorPanelData GitSubmitEditor::panelData() const return const_cast(this)->submitEditorWidget()->panelData(); } -QString GitSubmitEditor::fileFromStatusLine(const QString &line) -{ - QString rc = line; - // "modified: mainwindow.cpp" - const int index = rc.indexOf(QLatin1Char(':')); - if (index != -1) - rc.remove(0, index + 1); - const QChar blank(' '); - while (rc.startsWith(blank)) - rc.remove(0, 1); - return rc; -} - } // namespace Internal } // namespace Git diff --git a/src/plugins/git/gitsubmiteditor.h b/src/plugins/git/gitsubmiteditor.h index 8199384d07f..a56d7b5eb69 100644 --- a/src/plugins/git/gitsubmiteditor.h +++ b/src/plugins/git/gitsubmiteditor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -38,6 +38,10 @@ #include +namespace VCSBase { + class SubmitFileModel; +} + namespace Git { namespace Internal { @@ -54,15 +58,16 @@ public: void setCommitData(const CommitData &); GitSubmitEditorPanelData panelData() const; - static QString fileFromStatusLine(const QString &line); - static QStringList statusListToFileList(const QStringList &); +signals: + void diff(const QStringList &unstagedFiles, const QStringList &stagedFiles); -protected: - virtual QStringList vcsFileListToFileList(const QStringList &l) const - { return statusListToFileList(l); } +private slots: + void slotDiffSelected(const QStringList &); private: inline GitSubmitEditorWidget *submitEditorWidget(); + + VCSBase::SubmitFileModel *m_model; }; } // namespace Internal diff --git a/src/plugins/git/gitsubmiteditorwidget.cpp b/src/plugins/git/gitsubmiteditorwidget.cpp index 312738968fa..20c6f78f129 100644 --- a/src/plugins/git/gitsubmiteditorwidget.cpp +++ b/src/plugins/git/gitsubmiteditorwidget.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/git/gitsubmiteditorwidget.h b/src/plugins/git/gitsubmiteditorwidget.h index 8763dd8a59b..08c07f8df17 100644 --- a/src/plugins/git/gitsubmiteditorwidget.h +++ b/src/plugins/git/gitsubmiteditorwidget.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/git/gitversioncontrol.cpp b/src/plugins/git/gitversioncontrol.cpp index 0dcf99af204..5da80ebb611 100644 --- a/src/plugins/git/gitversioncontrol.cpp +++ b/src/plugins/git/gitversioncontrol.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/git/gitversioncontrol.h b/src/plugins/git/gitversioncontrol.h index ac72e4c9bf6..f0f71127569 100644 --- a/src/plugins/git/gitversioncontrol.h +++ b/src/plugins/git/gitversioncontrol.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/git/settingspage.cpp b/src/plugins/git/settingspage.cpp index 037176b52d9..a3b82194cec 100644 --- a/src/plugins/git/settingspage.cpp +++ b/src/plugins/git/settingspage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -95,11 +95,10 @@ QWidget *SettingsPage::createPage(QWidget *parent) return m_widget; } -void SettingsPage::finished(bool accepted) +void SettingsPage::apply() { - if (!accepted || !m_widget) + if (!m_widget) return; GitPlugin::instance()->setSettings(m_widget->settings()); } - diff --git a/src/plugins/git/settingspage.h b/src/plugins/git/settingspage.h index e5cce4d34a3..7da7a9f30c9 100644 --- a/src/plugins/git/settingspage.h +++ b/src/plugins/git/settingspage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -77,7 +77,8 @@ public: QString trCategory() const; QWidget *createPage(QWidget *parent); - void finished(bool accepted); + void apply(); + void finish() { } private: QPointer m_widget; diff --git a/src/plugins/helloworld/helloworldplugin.cpp b/src/plugins/helloworld/helloworldplugin.cpp index a8eb79c0519..6dd0bc9c63f 100644 --- a/src/plugins/helloworld/helloworldplugin.cpp +++ b/src/plugins/helloworld/helloworldplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -33,7 +33,7 @@ #include "helloworldplugin.h" -#include +#include #include #include #include @@ -91,13 +91,13 @@ bool HelloWorldPlugin::initialize(const QStringList &arguments, QString *error_m connect(helloWorldAction, SIGNAL(triggered()), SLOT(sayHelloWorld())); // Register the action with the action manager - Core::ActionManagerInterface *actionManager = core->actionManager(); - Core::ICommand *command = + Core::ActionManager *actionManager = core->actionManager(); + Core::Command *command = actionManager->registerAction( helloWorldAction, "HelloWorld.HelloWorldAction", context); // Create our own menu to place in the Tools menu - Core::IActionContainer *helloWorldMenu = + Core::ActionContainer *helloWorldMenu = actionManager->createMenu("HelloWorld.HelloWorldMenu"); QMenu *menu = helloWorldMenu->menu(); menu->setTitle(tr("&Hello World")); @@ -107,7 +107,7 @@ bool HelloWorldPlugin::initialize(const QStringList &arguments, QString *error_m helloWorldMenu->addAction(command); // Request the Tools menu and add the Hello World menu to it - Core::IActionContainer *toolsMenu = + Core::ActionContainer *toolsMenu = actionManager->actionContainer(Core::Constants::M_TOOLS); toolsMenu->addMenu(helloWorldMenu); diff --git a/src/plugins/helloworld/helloworldplugin.h b/src/plugins/helloworld/helloworldplugin.h index b598cc75239..8aa2a9aa127 100644 --- a/src/plugins/helloworld/helloworldplugin.h +++ b/src/plugins/helloworld/helloworldplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/helloworld/helloworldwindow.cpp b/src/plugins/helloworld/helloworldwindow.cpp index 5524d32274b..4a76fa7ff3b 100644 --- a/src/plugins/helloworld/helloworldwindow.cpp +++ b/src/plugins/helloworld/helloworldwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/helloworld/helloworldwindow.h b/src/plugins/helloworld/helloworldwindow.h index 82c00186562..763ce22b666 100644 --- a/src/plugins/helloworld/helloworldwindow.h +++ b/src/plugins/helloworld/helloworldwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/help/centralwidget.cpp b/src/plugins/help/centralwidget.cpp index a263f361119..f18795c3d39 100644 --- a/src/plugins/help/centralwidget.cpp +++ b/src/plugins/help/centralwidget.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/help/centralwidget.h b/src/plugins/help/centralwidget.h index 41db97a2838..5532f5ded83 100644 --- a/src/plugins/help/centralwidget.h +++ b/src/plugins/help/centralwidget.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/help/contentstoolwindow.cpp b/src/plugins/help/contentstoolwindow.cpp index ef90a09344e..4e533309269 100644 --- a/src/plugins/help/contentstoolwindow.cpp +++ b/src/plugins/help/contentstoolwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/help/contentstoolwindow.h b/src/plugins/help/contentstoolwindow.h index a6eabc156b3..60e42b06188 100644 --- a/src/plugins/help/contentstoolwindow.h +++ b/src/plugins/help/contentstoolwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/help/docsettingspage.cpp b/src/plugins/help/docsettingspage.cpp index 65fd2669b46..79e915557ac 100644 --- a/src/plugins/help/docsettingspage.cpp +++ b/src/plugins/help/docsettingspage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -38,7 +38,7 @@ #include using namespace Help::Internal; - + DocSettingsPage::DocSettingsPage(QHelpEngine *helpEngine) : m_helpEngine(helpEngine), m_registeredDocs(false) @@ -64,16 +64,16 @@ QWidget *DocSettingsPage::createPage(QWidget *parent) { QWidget *w = new QWidget(parent); m_ui.setupUi(w); - + connect(m_ui.addButton, SIGNAL(clicked()), this, SLOT(addDocumentation())); connect(m_ui.removeButton, SIGNAL(clicked()), this, SLOT(removeDocumentation())); - + m_ui.docsListWidget->addItems(m_helpEngine->registeredDocumentations()); m_registeredDocs = false; m_removeDocs.clear(); - + return w; } @@ -82,7 +82,7 @@ void DocSettingsPage::addDocumentation() QStringList files = QFileDialog::getOpenFileNames(m_ui.addButton->parentWidget(), tr("Add Documentation"), QString(), tr("Qt Help Files (*.qch)")); - + if (files.isEmpty()) return; @@ -107,23 +107,20 @@ void DocSettingsPage::removeDocumentation() QListWidgetItem *item = m_ui.docsListWidget->currentItem(); if (!item) return; - + m_removeDocs.append(item->text()); int row = m_ui.docsListWidget->currentRow(); - m_ui.docsListWidget->takeItem(row); + m_ui.docsListWidget->takeItem(row); if (row > 0) --row; if (m_ui.docsListWidget->count()) m_ui.docsListWidget->setCurrentRow(row); - delete item; + delete item; } -void DocSettingsPage::finished(bool accepted) +void DocSettingsPage::apply() { - if (!accepted) - return; - emit dialogAccepted(); } diff --git a/src/plugins/help/docsettingspage.h b/src/plugins/help/docsettingspage.h index 1e74ae5404c..0f65160b764 100644 --- a/src/plugins/help/docsettingspage.h +++ b/src/plugins/help/docsettingspage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -57,7 +57,8 @@ public: QString trCategory() const; QWidget *createPage(QWidget *parent); - void finished(bool accepted); + void apply(); + void finish() { } bool applyChanges(); diff --git a/src/plugins/help/filtersettingspage.cpp b/src/plugins/help/filtersettingspage.cpp index 73a5f615d3a..43238761527 100644 --- a/src/plugins/help/filtersettingspage.cpp +++ b/src/plugins/help/filtersettingspage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -173,8 +173,10 @@ void FilterSettingsPage::removeFilter() m_ui.filterWidget->setCurrentRow(0); } -void FilterSettingsPage::finished(bool) +void FilterSettingsPage::apply() { + // This is handled via HelpPlugin::checkForHelpChanges, which is connected + // to DocSettingsPage::apply. } bool FilterSettingsPage::applyChanges() diff --git a/src/plugins/help/filtersettingspage.h b/src/plugins/help/filtersettingspage.h index 6eb12df1811..be6469900e3 100644 --- a/src/plugins/help/filtersettingspage.h +++ b/src/plugins/help/filtersettingspage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -56,7 +56,8 @@ public: QString trCategory() const; QWidget *createPage(QWidget *parent); - void finished(bool accepted); + void apply(); + void finish() { } bool applyChanges(); diff --git a/src/plugins/help/help_global.h b/src/plugins/help/help_global.h index bac0cd4afd2..cc256ac9db6 100644 --- a/src/plugins/help/help_global.h +++ b/src/plugins/help/help_global.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/help/helpengine.cpp b/src/plugins/help/helpengine.cpp index d6e4e667fc5..31debec4566 100644 --- a/src/plugins/help/helpengine.cpp +++ b/src/plugins/help/helpengine.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/help/helpengine.h b/src/plugins/help/helpengine.h index a6f2f1d5e54..cec4d9d1ffd 100644 --- a/src/plugins/help/helpengine.h +++ b/src/plugins/help/helpengine.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/help/helpfindsupport.cpp b/src/plugins/help/helpfindsupport.cpp index 78a867701ec..4c8257936e9 100644 --- a/src/plugins/help/helpfindsupport.cpp +++ b/src/plugins/help/helpfindsupport.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/help/helpfindsupport.h b/src/plugins/help/helpfindsupport.h index 602bc6b7123..421b53b846b 100644 --- a/src/plugins/help/helpfindsupport.h +++ b/src/plugins/help/helpfindsupport.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/help/helpindexfilter.cpp b/src/plugins/help/helpindexfilter.cpp index 489e2aed1ef..af90f240efb 100644 --- a/src/plugins/help/helpindexfilter.cpp +++ b/src/plugins/help/helpindexfilter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/help/helpindexfilter.h b/src/plugins/help/helpindexfilter.h index 74438ee54de..b2e92b188ba 100644 --- a/src/plugins/help/helpindexfilter.h +++ b/src/plugins/help/helpindexfilter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/help/helpmode.cpp b/src/plugins/help/helpmode.cpp index ee334af42e5..687a5f116e1 100644 --- a/src/plugins/help/helpmode.cpp +++ b/src/plugins/help/helpmode.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -41,13 +41,14 @@ using namespace Help; using namespace Help::Internal; -HelpMode::HelpMode(QWidget *widget, QWidget *centralWidget, QObject *parent): - BaseMode(tr("Help"), - Constants::ID_MODE_HELP, - QIcon((QLatin1String(":/fancyactionbar/images/mode_Reference.png"))), - Constants::P_MODE_HELP, widget, parent), - m_centralWidget(centralWidget) +HelpMode::HelpMode(QWidget *widget, QWidget *centralWidget, QObject *parent) + : BaseMode(parent), m_centralWidget(centralWidget) { + setName(tr("Help")); + setUniqueModeName(Constants::ID_MODE_HELP); + setIcon(QIcon(QLatin1String(":/fancyactionbar/images/mode_Reference.png"))); + setPriority(Constants::P_MODE_HELP); + setWidget(widget); m_centralWidget->layout()->setSpacing(0); m_centralWidget->layout()->addWidget(new Core::FindToolBarPlaceHolder(this)); } diff --git a/src/plugins/help/helpmode.h b/src/plugins/help/helpmode.h index 85edcf26daa..6e59ff144a5 100644 --- a/src/plugins/help/helpmode.h +++ b/src/plugins/help/helpmode.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 3ed3263478d..74900b6acee 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #include #include @@ -165,8 +165,8 @@ bool HelpPlugin::initialize(const QStringList & /*arguments*/, QString *) connect(m_bookmarkWidget, SIGNAL(addBookmark()), this, SLOT(addBookmark())); - Core::ActionManagerInterface *am = m_core->actionManager(); - Core::ICommand *cmd; + Core::ActionManager *am = m_core->actionManager(); + Core::Command *cmd; // Add Home, Previous and Next actions (used in the toolbar) QAction *homeAction = new QAction(QIcon(QLatin1String(":/help/images/home.png")), tr("Home"), this); @@ -251,7 +251,7 @@ bool HelpPlugin::initialize(const QStringList & /*arguments*/, QString *) copyAction->setText(cmd->action()->text()); copyAction->setIcon(cmd->action()->icon()); - QMap shortcutMap; + QMap shortcutMap; QShortcut *shortcut = new QShortcut(splitter); shortcut->setWhatsThis(tr("Activate Index in Help mode")); cmd = am->registerShortcut(shortcut, QLatin1String("Help.IndexShortcut"), modecontext); @@ -607,7 +607,7 @@ void HelpPlugin::activateSearch() QToolBar *HelpPlugin::createToolBar() { QToolBar *toolWidget = new QToolBar; - Core::ActionManagerInterface *am = m_core->actionManager(); + Core::ActionManager *am = m_core->actionManager(); toolWidget->addAction(am->command(QLatin1String("Help.Home"))->action()); toolWidget->addAction(am->command(QLatin1String("Help.Previous"))->action()); toolWidget->addAction(am->command(QLatin1String("Help.Next"))->action()); diff --git a/src/plugins/help/helpplugin.h b/src/plugins/help/helpplugin.h index 40ff127e5b1..ef56c7e3364 100644 --- a/src/plugins/help/helpplugin.h +++ b/src/plugins/help/helpplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/help/indextoolwindow.cpp b/src/plugins/help/indextoolwindow.cpp index b6086cdea23..fdae72b9596 100644 --- a/src/plugins/help/indextoolwindow.cpp +++ b/src/plugins/help/indextoolwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/help/indextoolwindow.h b/src/plugins/help/indextoolwindow.h index d891ec0cb16..fc86c7e465b 100644 --- a/src/plugins/help/indextoolwindow.h +++ b/src/plugins/help/indextoolwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/help/searchwidget.cpp b/src/plugins/help/searchwidget.cpp index bbb3a9692ad..6ea7de23a6c 100644 --- a/src/plugins/help/searchwidget.cpp +++ b/src/plugins/help/searchwidget.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/help/searchwidget.h b/src/plugins/help/searchwidget.h index a565491b782..015aeac422a 100644 --- a/src/plugins/help/searchwidget.h +++ b/src/plugins/help/searchwidget.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/perforce/annotationhighlighter.cpp b/src/plugins/perforce/annotationhighlighter.cpp index 289157df668..1a045e9c1f4 100644 --- a/src/plugins/perforce/annotationhighlighter.cpp +++ b/src/plugins/perforce/annotationhighlighter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/perforce/annotationhighlighter.h b/src/plugins/perforce/annotationhighlighter.h index 574d2781f54..fbd251127b9 100644 --- a/src/plugins/perforce/annotationhighlighter.h +++ b/src/plugins/perforce/annotationhighlighter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/perforce/changenumberdialog.cpp b/src/plugins/perforce/changenumberdialog.cpp index e310953d376..572914d449b 100644 --- a/src/plugins/perforce/changenumberdialog.cpp +++ b/src/plugins/perforce/changenumberdialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/perforce/changenumberdialog.h b/src/plugins/perforce/changenumberdialog.h index 9432f9ad0dc..559cce168a5 100644 --- a/src/plugins/perforce/changenumberdialog.h +++ b/src/plugins/perforce/changenumberdialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/perforce/p4.h b/src/plugins/perforce/p4.h index bc93ac18d8d..7e8e5a808c4 100644 --- a/src/plugins/perforce/p4.h +++ b/src/plugins/perforce/p4.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/perforce/pendingchangesdialog.cpp b/src/plugins/perforce/pendingchangesdialog.cpp index fd1b1b98aab..ee402328bee 100644 --- a/src/plugins/perforce/pendingchangesdialog.cpp +++ b/src/plugins/perforce/pendingchangesdialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/perforce/pendingchangesdialog.h b/src/plugins/perforce/pendingchangesdialog.h index d6f88efd7ec..6d5f0d7f8d0 100644 --- a/src/plugins/perforce/pendingchangesdialog.h +++ b/src/plugins/perforce/pendingchangesdialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/perforce/perforceconstants.h b/src/plugins/perforce/perforceconstants.h index 4a755b32c4a..e0feb0c58e9 100644 --- a/src/plugins/perforce/perforceconstants.h +++ b/src/plugins/perforce/perforceconstants.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/perforce/perforceeditor.cpp b/src/plugins/perforce/perforceeditor.cpp index d54ce10de5f..487603cc361 100644 --- a/src/plugins/perforce/perforceeditor.cpp +++ b/src/plugins/perforce/perforceeditor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/perforce/perforceeditor.h b/src/plugins/perforce/perforceeditor.h index 335bf8b3825..3f85281c17b 100644 --- a/src/plugins/perforce/perforceeditor.h +++ b/src/plugins/perforce/perforceeditor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/perforce/perforceoutputwindow.cpp b/src/plugins/perforce/perforceoutputwindow.cpp index 235f7da9cc5..6846aa11b30 100644 --- a/src/plugins/perforce/perforceoutputwindow.cpp +++ b/src/plugins/perforce/perforceoutputwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/perforce/perforceoutputwindow.h b/src/plugins/perforce/perforceoutputwindow.h index 9f825ae1665..db6012a4304 100644 --- a/src/plugins/perforce/perforceoutputwindow.h +++ b/src/plugins/perforce/perforceoutputwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index 0ad0224d1ca..1b9c7e094d1 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -43,7 +43,7 @@ #include "perforceversioncontrol.h" #include "settingspage.h" -#include +#include #include #include #include @@ -179,11 +179,7 @@ PerforcePlugin::PerforcePlugin() : static const VCSBase::VCSBaseSubmitEditorParameters submitParameters = { Perforce::Constants::SUBMIT_MIMETYPE, Perforce::Constants::PERFORCESUBMITEDITOR_KIND, - Perforce::Constants::C_PERFORCESUBMITEDITOR, - Core::Constants::UNDO, - Core::Constants::REDO, - Perforce::Constants::SUBMIT_CURRENT, - Perforce::Constants::DIFF_SELECTED + Perforce::Constants::C_PERFORCESUBMITEDITOR }; bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *errorMessage) @@ -229,12 +225,12 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro //register actions - Core::ActionManagerInterface *am = m_coreInstance->actionManager(); + Core::ActionManager *am = m_coreInstance->actionManager(); - Core::IActionContainer *mtools = + Core::ActionContainer *mtools = am->actionContainer(Core::Constants::M_TOOLS); - Core::IActionContainer *mperforce = + Core::ActionContainer *mperforce = am->createMenu(QLatin1String(PERFORCE_MENU)); mperforce->menu()->setTitle(tr("&Perforce")); mtools->addMenu(mperforce); @@ -250,12 +246,12 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro perforcesubmitcontext << m_coreInstance->uniqueIDManager()->uniqueIdentifier(Constants::C_PERFORCESUBMITEDITOR); - Core::ICommand *command; + Core::Command *command; QAction *tmpaction; m_editAction = new QAction(tr("Edit"), this); command = am->registerAction(m_editAction, PerforcePlugin::EDIT, globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+E"))); command->setDefaultText(tr("Edit File")); connect(m_editAction, SIGNAL(triggered()), this, SLOT(openCurrentFile())); @@ -263,7 +259,7 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro m_addAction = new QAction(tr("Add"), this); command = am->registerAction(m_addAction, PerforcePlugin::ADD, globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+A"))); command->setDefaultText(tr("Add File")); connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile())); @@ -271,14 +267,14 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro m_deleteAction = new QAction(tr("Delete"), this); command = am->registerAction(m_deleteAction, PerforcePlugin::DELETE_FILE, globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); command->setDefaultText(tr("Delete File")); connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(deleteCurrentFile())); mperforce->addAction(command); m_revertAction = new QAction(tr("Revert"), this); command = am->registerAction(m_revertAction, PerforcePlugin::REVERT, globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+R"))); command->setDefaultText(tr("Revert File")); connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertCurrentFile())); @@ -291,14 +287,14 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro m_diffCurrentAction = new QAction(tr("Diff Current File"), this); command = am->registerAction(m_diffCurrentAction, PerforcePlugin::DIFF_CURRENT, globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); command->setDefaultText(tr("Diff Current File")); connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile())); mperforce->addAction(command); m_diffProjectAction = new QAction(tr("Diff Current Project/Session"), this); command = am->registerAction(m_diffProjectAction, PerforcePlugin::DIFF_PROJECT, globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+D"))); command->setDefaultText(tr("Diff Current Project/Session")); connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffCurrentProject())); @@ -350,7 +346,7 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro m_annotateCurrentAction = new QAction(tr("Annotate Current File"), this); command = am->registerAction(m_annotateCurrentAction, PerforcePlugin::ANNOTATE_CURRENT, globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); command->setDefaultText(tr("Annotate Current File")); connect(m_annotateCurrentAction, SIGNAL(triggered()), this, SLOT(annotateCurrentFile())); mperforce->addAction(command); @@ -362,7 +358,7 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro m_filelogCurrentAction = new QAction(tr("Filelog Current File"), this); command = am->registerAction(m_filelogCurrentAction, PerforcePlugin::FILELOG_CURRENT, globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+F"))); command->setDefaultText(tr("Filelog Current File")); connect(m_filelogCurrentAction, SIGNAL(triggered()), this, SLOT(filelogCurrentFile())); @@ -494,19 +490,19 @@ void PerforcePlugin::submit() QTC_ASSERT(m_coreInstance, return); if (!checkP4Command()) { - showOutput(tr("No p4 executable specified!")); + showOutput(tr("No p4 executable specified!"), true); return; } if (m_changeTmpFile) { - showOutput(tr("Another submit is currently executed.")); + showOutput(tr("Another submit is currently executed."), true); m_perforceOutputWindow->popup(false); return; } m_changeTmpFile = new QTemporaryFile(this); if (!m_changeTmpFile->open()) { - showOutput(tr("Cannot create temporary file.")); + showOutput(tr("Cannot create temporary file."), true); delete m_changeTmpFile; m_changeTmpFile = 0; return; @@ -558,12 +554,8 @@ Core::IEditor *PerforcePlugin::openPerforceSubmitEditor(const QString &fileName, PerforceSubmitEditor *submitEditor = dynamic_cast(editor); QTC_ASSERT(submitEditor, return 0); submitEditor->restrictToProjectFiles(depotFileNames); + submitEditor->registerActions(m_undoAction, m_redoAction, m_submitCurrentLogAction, m_diffSelectedFiles); connect(submitEditor, SIGNAL(diffSelectedFiles(QStringList)), this, SLOT(slotDiff(QStringList))); - // The actions are for some reason enabled by the context switching - // mechanism. Disable them correctly. - m_diffSelectedFiles->setEnabled(false); - m_undoAction->setEnabled(false); - m_redoAction->setEnabled(false); return editor; } @@ -970,7 +962,7 @@ bool PerforcePlugin::editorAboutToClose(Core::IEditor *editor) QByteArray change = m_changeTmpFile->readAll(); m_changeTmpFile->close(); if (!checkP4Command()) { - showOutput(tr("No p4 executable specified!")); + showOutput(tr("No p4 executable specified!"), true); delete m_changeTmpFile; m_changeTmpFile = 0; return false; @@ -981,8 +973,8 @@ bool PerforcePlugin::editorAboutToClose(Core::IEditor *editor) QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); proc.start(m_settings.p4Command, basicP4Args() << QLatin1String("submit") << QLatin1String("-i")); - if (!proc.waitForStarted(3000)) { - showOutput(tr("Cannot execute p4 submit.")); + if (!proc.waitForStarted(p4Timeout)) { + showOutput(tr("Cannot execute p4 submit."), true); QApplication::restoreOverrideCursor(); delete m_changeTmpFile; m_changeTmpFile = 0; @@ -992,7 +984,7 @@ bool PerforcePlugin::editorAboutToClose(Core::IEditor *editor) proc.closeWriteChannel(); if (!proc.waitForFinished()) { - showOutput(tr("Cannot execute p4 submit.")); + showOutput(tr("Cannot execute p4 submit."), true); QApplication::restoreOverrideCursor(); delete m_changeTmpFile; m_changeTmpFile = 0; @@ -1000,7 +992,7 @@ bool PerforcePlugin::editorAboutToClose(Core::IEditor *editor) } QString output = QString::fromUtf8(proc.readAll()); showOutput(output); - if (output.contains("Out of date files must be resolved or reverted")) { + if (output.contains("Out of date files must be resolved or reverted"), true) { QMessageBox::warning(editor->widget(), "Pending change", "Could not submit the change, because your workspace was out of date. Created a pending submit instead."); } QApplication::restoreOverrideCursor(); diff --git a/src/plugins/perforce/perforceplugin.h b/src/plugins/perforce/perforceplugin.h index cf37ed339eb..a5e52ba6b03 100644 --- a/src/plugins/perforce/perforceplugin.h +++ b/src/plugins/perforce/perforceplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/perforce/perforcesettings.cpp b/src/plugins/perforce/perforcesettings.cpp index cdb4012be0a..7ba51b78e00 100644 --- a/src/plugins/perforce/perforcesettings.cpp +++ b/src/plugins/perforce/perforcesettings.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/perforce/perforcesettings.h b/src/plugins/perforce/perforcesettings.h index 726f7f44efb..4451d4ad617 100644 --- a/src/plugins/perforce/perforcesettings.h +++ b/src/plugins/perforce/perforcesettings.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/perforce/perforcesubmiteditor.cpp b/src/plugins/perforce/perforcesubmiteditor.cpp index 6aa74f95fb2..7c8967f2049 100644 --- a/src/plugins/perforce/perforcesubmiteditor.cpp +++ b/src/plugins/perforce/perforcesubmiteditor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -36,6 +36,7 @@ #include "perforceplugin.h" #include "perforceconstants.h" +#include #include #include @@ -43,10 +44,14 @@ namespace Perforce { namespace Internal { +enum { FileSpecRole = Qt::UserRole + 1 }; + PerforceSubmitEditor::PerforceSubmitEditor(const VCSBase::VCSBaseSubmitEditorParameters *parameters, QWidget *parent) : - VCSBaseSubmitEditor(parameters, new PerforceSubmitEditorWidget(parent)) + VCSBaseSubmitEditor(parameters, new PerforceSubmitEditorWidget(parent)), + m_fileModel(new VCSBase::SubmitFileModel(this)) { setDisplayName(tr("Perforce Submit")); + setFileModel(m_fileModel); } PerforceSubmitEditorWidget *PerforceSubmitEditor::submitEditorWidget() @@ -54,14 +59,6 @@ PerforceSubmitEditorWidget *PerforceSubmitEditor::submitEditorWidget() return static_cast(widget()); } -QStringList PerforceSubmitEditor::vcsFileListToFileList(const QStringList &rawList) const -{ - QStringList rc; - foreach (const QString &rf, rawList) - rc.push_back(fileFromChangeLine(rf)); - return rc; -} - QString PerforceSubmitEditor::fileContents() const { const_cast(this)->updateEntries(); @@ -121,25 +118,7 @@ bool PerforceSubmitEditor::parseText(QString text) void PerforceSubmitEditor::restrictToProjectFiles(const QStringList &knownProjectFiles) { - QStringList allFiles = submitEditorWidget()->fileList(); - const int oldSize = allFiles.size(); - for (int i = oldSize - 1; i >= 0; i--) - if (!knownProjectFiles.contains(fileFromChangeLine(allFiles.at(i)))) - allFiles.removeAt(i); - if (allFiles.size() != oldSize) - submitEditorWidget()->setFileList(allFiles); - if (Perforce::Constants::debug) - qDebug() << Q_FUNC_INFO << oldSize << "->" << allFiles.size(); -} - -QString PerforceSubmitEditor::fileFromChangeLine(const QString &line) -{ - QString rc = line; - // " foo.cpp#add" - const int index = rc.lastIndexOf(QLatin1Char('#')); - if (index != -1) - rc.truncate(index); - return rc.trimmed(); + m_fileModel->filter(knownProjectFiles, fileNameColumn()); } void PerforceSubmitEditor::updateFields() @@ -161,12 +140,15 @@ void PerforceSubmitEditor::updateFields() widget->setDescriptionText(lines.join(newLine)); lines = m_entries.value(QLatin1String("Files")).split(newLine); - lines.replaceInStrings(leadingTabPattern, QString()); - QStringList fileList; - foreach (const QString &line, lines) - if (!line.isEmpty()) - fileList.push_back(line); - widget->setFileList(fileList); + // split up "file#add" and store complete spec line as user data + foreach (const QString &specLine, lines) { + const QStringList list = specLine.split(QLatin1Char('#')); + if (list.size() == 2) { + const QString file = list.at(0).trimmed(); + const QString state = list.at(1).trimmed(); + m_fileModel->addFile(file, state).at(0)->setData(specLine, FileSpecRole); + } + } } void PerforceSubmitEditor::updateEntries() @@ -181,13 +163,14 @@ void PerforceSubmitEditor::updateEntries() lines.replaceInStrings(QRegExp(QLatin1String("^")), tab); m_entries.insert(QLatin1String("Description"), newLine + lines.join(newLine) + QLatin1String("\n\n")); QString files = newLine; - // Files - const QStringList fileList = submitEditorWidget()->fileList(); - const int count = fileList.size(); - for (int i = 0; i < count; i++) { - files += tab; - files += fileList.at(i); - files += newLine; + // Re-build the file spec 'file#add' from the user data + const int count = m_fileModel->rowCount(); + for (int r = 0; r < count; r++) { + const QStandardItem *item = m_fileModel->item(r, 0); + if (item->checkState() == Qt::Checked) { + files += item->data(FileSpecRole).toString(); + files += newLine; + } } files += newLine; m_entries.insert(QLatin1String("Files"), files); diff --git a/src/plugins/perforce/perforcesubmiteditor.h b/src/plugins/perforce/perforcesubmiteditor.h index 0f44332a694..a3a1805039d 100644 --- a/src/plugins/perforce/perforcesubmiteditor.h +++ b/src/plugins/perforce/perforcesubmiteditor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -39,6 +39,10 @@ #include #include +namespace VCSBase { + class SubmitFileModel; +} + namespace Perforce { namespace Internal { @@ -66,7 +70,6 @@ public: static QString fileFromChangeLine(const QString &line); protected: - virtual QStringList vcsFileListToFileList(const QStringList &) const; virtual QString fileContents() const; virtual bool setFileContents(const QString &contents); @@ -77,6 +80,7 @@ private: void updateEntries(); QMap m_entries; + VCSBase::SubmitFileModel *m_fileModel; }; } // namespace Internal diff --git a/src/plugins/perforce/perforcesubmiteditorwidget.cpp b/src/plugins/perforce/perforcesubmiteditorwidget.cpp index 05d14327f3f..e1cf2558272 100644 --- a/src/plugins/perforce/perforcesubmiteditorwidget.cpp +++ b/src/plugins/perforce/perforcesubmiteditorwidget.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/perforce/perforcesubmiteditorwidget.h b/src/plugins/perforce/perforcesubmiteditorwidget.h index 6d1a8dea431..46566ad4c72 100644 --- a/src/plugins/perforce/perforcesubmiteditorwidget.h +++ b/src/plugins/perforce/perforcesubmiteditorwidget.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/perforce/perforceversioncontrol.cpp b/src/plugins/perforce/perforceversioncontrol.cpp index 0b2814dbe1c..02102939a54 100644 --- a/src/plugins/perforce/perforceversioncontrol.cpp +++ b/src/plugins/perforce/perforceversioncontrol.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/perforce/perforceversioncontrol.h b/src/plugins/perforce/perforceversioncontrol.h index 6d92fc9b0ff..8a2a27f8285 100644 --- a/src/plugins/perforce/perforceversioncontrol.h +++ b/src/plugins/perforce/perforceversioncontrol.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/perforce/settingspage.cpp b/src/plugins/perforce/settingspage.cpp index 18fec0f8469..70ef649b0e6 100644 --- a/src/plugins/perforce/settingspage.cpp +++ b/src/plugins/perforce/settingspage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -96,9 +96,9 @@ QWidget *SettingsPage::createPage(QWidget *parent) return m_widget; } -void SettingsPage::finished(bool accepted) +void SettingsPage::apply() { - if (!accepted || !m_widget) + if (!m_widget) return; PerforcePlugin::perforcePluginInstance()->setSettings(m_widget->settings()); diff --git a/src/plugins/perforce/settingspage.h b/src/plugins/perforce/settingspage.h index e13dab53437..f5c43599fad 100644 --- a/src/plugins/perforce/settingspage.h +++ b/src/plugins/perforce/settingspage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -70,7 +70,8 @@ public: QString trCategory() const; QWidget *createPage(QWidget *parent); - void finished(bool accepted); + void apply(); + void finish() { } private: QPointer m_widget; diff --git a/src/plugins/perforce/workbenchclientuser.cpp b/src/plugins/perforce/workbenchclientuser.cpp index d148a47a884..d8943ffd085 100644 --- a/src/plugins/perforce/workbenchclientuser.cpp +++ b/src/plugins/perforce/workbenchclientuser.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/perforce/workbenchclientuser.h b/src/plugins/perforce/workbenchclientuser.h index a924decabd3..200b68a9683 100644 --- a/src/plugins/perforce/workbenchclientuser.h +++ b/src/plugins/perforce/workbenchclientuser.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/ProjectExplorerInterfaces b/src/plugins/projectexplorer/ProjectExplorerInterfaces index 10d0b819104..b6eb45c7ac5 100644 --- a/src/plugins/projectexplorer/ProjectExplorerInterfaces +++ b/src/plugins/projectexplorer/ProjectExplorerInterfaces @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/abstractprocess.h b/src/plugins/projectexplorer/abstractprocess.h index d1a1c644389..491eed4a0b0 100644 --- a/src/plugins/projectexplorer/abstractprocess.h +++ b/src/plugins/projectexplorer/abstractprocess.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index 11dfa6d760d..f1c1f90a911 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/abstractprocessstep.h b/src/plugins/projectexplorer/abstractprocessstep.h index 9c1756c0d70..3aac602291c 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.h +++ b/src/plugins/projectexplorer/abstractprocessstep.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/allprojectsfilter.cpp b/src/plugins/projectexplorer/allprojectsfilter.cpp index b94edbef259..07e34399b0b 100644 --- a/src/plugins/projectexplorer/allprojectsfilter.cpp +++ b/src/plugins/projectexplorer/allprojectsfilter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/allprojectsfilter.h b/src/plugins/projectexplorer/allprojectsfilter.h index 45e8105ecc5..8de2de425e6 100644 --- a/src/plugins/projectexplorer/allprojectsfilter.h +++ b/src/plugins/projectexplorer/allprojectsfilter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/allprojectsfind.cpp b/src/plugins/projectexplorer/allprojectsfind.cpp index 2118ccc658a..26998982614 100644 --- a/src/plugins/projectexplorer/allprojectsfind.cpp +++ b/src/plugins/projectexplorer/allprojectsfind.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/allprojectsfind.h b/src/plugins/projectexplorer/allprojectsfind.h index 8479a1dfc5d..48d1457b546 100644 --- a/src/plugins/projectexplorer/allprojectsfind.h +++ b/src/plugins/projectexplorer/allprojectsfind.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/applicationlauncher.h b/src/plugins/projectexplorer/applicationlauncher.h index 93b51e8b25f..ead2799453e 100644 --- a/src/plugins/projectexplorer/applicationlauncher.h +++ b/src/plugins/projectexplorer/applicationlauncher.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/applicationlauncher_win.cpp b/src/plugins/projectexplorer/applicationlauncher_win.cpp index c511d350f27..09e0ee73c6c 100644 --- a/src/plugins/projectexplorer/applicationlauncher_win.cpp +++ b/src/plugins/projectexplorer/applicationlauncher_win.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/applicationlauncher_x11.cpp b/src/plugins/projectexplorer/applicationlauncher_x11.cpp index 5891a647395..9a1c4c3d737 100644 --- a/src/plugins/projectexplorer/applicationlauncher_x11.cpp +++ b/src/plugins/projectexplorer/applicationlauncher_x11.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/applicationrunconfiguration.cpp b/src/plugins/projectexplorer/applicationrunconfiguration.cpp index a0eb7af6a19..fc936d2c431 100644 --- a/src/plugins/projectexplorer/applicationrunconfiguration.cpp +++ b/src/plugins/projectexplorer/applicationrunconfiguration.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/applicationrunconfiguration.h b/src/plugins/projectexplorer/applicationrunconfiguration.h index d6bfb4d8945..550bf621747 100644 --- a/src/plugins/projectexplorer/applicationrunconfiguration.h +++ b/src/plugins/projectexplorer/applicationrunconfiguration.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 2fdda571c0d..f86898bbb76 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/buildconfiguration.h b/src/plugins/projectexplorer/buildconfiguration.h index 8bb01d15901..d92b64a1d95 100644 --- a/src/plugins/projectexplorer/buildconfiguration.h +++ b/src/plugins/projectexplorer/buildconfiguration.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index 72eb1766f11..ff426805c2e 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -40,7 +40,7 @@ #include "projectexplorer.h" #include "taskwindow.h" -#include +#include #include #include #include @@ -178,7 +178,7 @@ void BuildManager::startBuildQueue() { if (!m_running) { // Progress Reporting - Core::ProgressManagerInterface *progressManager = + Core::ProgressManager *progressManager = ExtensionSystem::PluginManager::instance()->getObject()->progressManager(); m_progressFutureInterface = new QFutureInterface; m_progressWatcher.setFuture(m_progressFutureInterface->future()); diff --git a/src/plugins/projectexplorer/buildmanager.h b/src/plugins/projectexplorer/buildmanager.h index 248d6ae9271..2fa0cdcd356 100644 --- a/src/plugins/projectexplorer/buildmanager.h +++ b/src/plugins/projectexplorer/buildmanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/buildparserinterface.cpp b/src/plugins/projectexplorer/buildparserinterface.cpp index 57a069ea72a..39a6ced9ded 100644 --- a/src/plugins/projectexplorer/buildparserinterface.cpp +++ b/src/plugins/projectexplorer/buildparserinterface.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/buildparserinterface.h b/src/plugins/projectexplorer/buildparserinterface.h index 2fd92d86827..6dba4dfec00 100644 --- a/src/plugins/projectexplorer/buildparserinterface.h +++ b/src/plugins/projectexplorer/buildparserinterface.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/buildprogress.cpp b/src/plugins/projectexplorer/buildprogress.cpp index afc228e4602..32c7e2279ac 100644 --- a/src/plugins/projectexplorer/buildprogress.cpp +++ b/src/plugins/projectexplorer/buildprogress.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/buildprogress.h b/src/plugins/projectexplorer/buildprogress.h index 11c5293a7cb..f55984d527e 100644 --- a/src/plugins/projectexplorer/buildprogress.h +++ b/src/plugins/projectexplorer/buildprogress.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/buildsettingspropertiespage.cpp b/src/plugins/projectexplorer/buildsettingspropertiespage.cpp index b642a4e3867..aea512909ab 100644 --- a/src/plugins/projectexplorer/buildsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/buildsettingspropertiespage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/buildsettingspropertiespage.h b/src/plugins/projectexplorer/buildsettingspropertiespage.h index 04171980494..4278c83bcbe 100644 --- a/src/plugins/projectexplorer/buildsettingspropertiespage.h +++ b/src/plugins/projectexplorer/buildsettingspropertiespage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index abcc431f05e..27e2291152d 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h index 93c2fac2e44..2a3040a76ce 100644 --- a/src/plugins/projectexplorer/buildstep.h +++ b/src/plugins/projectexplorer/buildstep.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/buildstepspage.cpp b/src/plugins/projectexplorer/buildstepspage.cpp index 735770877b0..64d39d771b7 100644 --- a/src/plugins/projectexplorer/buildstepspage.cpp +++ b/src/plugins/projectexplorer/buildstepspage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/buildstepspage.h b/src/plugins/projectexplorer/buildstepspage.h index ef1e47d9646..a20cb5f737a 100644 --- a/src/plugins/projectexplorer/buildstepspage.h +++ b/src/plugins/projectexplorer/buildstepspage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/compileoutputwindow.cpp b/src/plugins/projectexplorer/compileoutputwindow.cpp index 72ecf9893eb..d3a4e2b86f8 100644 --- a/src/plugins/projectexplorer/compileoutputwindow.cpp +++ b/src/plugins/projectexplorer/compileoutputwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/compileoutputwindow.h b/src/plugins/projectexplorer/compileoutputwindow.h index 655752cdd3c..5d9daa96c4d 100644 --- a/src/plugins/projectexplorer/compileoutputwindow.h +++ b/src/plugins/projectexplorer/compileoutputwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/consoleprocess.h b/src/plugins/projectexplorer/consoleprocess.h index 51519fae381..aae64e97aac 100644 --- a/src/plugins/projectexplorer/consoleprocess.h +++ b/src/plugins/projectexplorer/consoleprocess.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/consoleprocess_unix.cpp b/src/plugins/projectexplorer/consoleprocess_unix.cpp index eb5f88121c8..7b432c0af03 100644 --- a/src/plugins/projectexplorer/consoleprocess_unix.cpp +++ b/src/plugins/projectexplorer/consoleprocess_unix.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/consoleprocess_win.cpp b/src/plugins/projectexplorer/consoleprocess_win.cpp index 17e280e3ad0..5b8760cd33e 100644 --- a/src/plugins/projectexplorer/consoleprocess_win.cpp +++ b/src/plugins/projectexplorer/consoleprocess_win.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/currentprojectfilter.cpp b/src/plugins/projectexplorer/currentprojectfilter.cpp index 4de19f9be5b..4b9e585cc13 100644 --- a/src/plugins/projectexplorer/currentprojectfilter.cpp +++ b/src/plugins/projectexplorer/currentprojectfilter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/currentprojectfilter.h b/src/plugins/projectexplorer/currentprojectfilter.h index c52f9f605ff..92ae4b68635 100644 --- a/src/plugins/projectexplorer/currentprojectfilter.h +++ b/src/plugins/projectexplorer/currentprojectfilter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/currentprojectfind.cpp b/src/plugins/projectexplorer/currentprojectfind.cpp index 451ae521c0c..cf1d81c3bc7 100644 --- a/src/plugins/projectexplorer/currentprojectfind.cpp +++ b/src/plugins/projectexplorer/currentprojectfind.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/currentprojectfind.h b/src/plugins/projectexplorer/currentprojectfind.h index d44171d761a..5c08be0f2fc 100644 --- a/src/plugins/projectexplorer/currentprojectfind.h +++ b/src/plugins/projectexplorer/currentprojectfind.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp index f2b9c66ced1..4012cee8e13 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.h b/src/plugins/projectexplorer/customexecutablerunconfiguration.h index bcf3fef091a..52cbedd51c6 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.h +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/dependenciesdialog.cpp b/src/plugins/projectexplorer/dependenciesdialog.cpp index de7cee85f86..9c78de543ad 100644 --- a/src/plugins/projectexplorer/dependenciesdialog.cpp +++ b/src/plugins/projectexplorer/dependenciesdialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/dependenciesdialog.h b/src/plugins/projectexplorer/dependenciesdialog.h index 3b815369ab9..1dd8621a1ed 100644 --- a/src/plugins/projectexplorer/dependenciesdialog.h +++ b/src/plugins/projectexplorer/dependenciesdialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/dependenciesdialog.ui b/src/plugins/projectexplorer/dependenciesdialog.ui index 25ffdff8948..31a70dae983 100644 --- a/src/plugins/projectexplorer/dependenciesdialog.ui +++ b/src/plugins/projectexplorer/dependenciesdialog.ui @@ -1,59 +1,45 @@ - + + ProjectExplorer::Internal::DependenciesDialog - - + + 0 0 - 618 - 660 + 492 + 435 - + Project Dependencies - - + + 6 - - 9 - - - 9 - - - 9 - - + 9 - - - - 600 - 600 - - - + + QAbstractItemView::SingleSelection - - + + Qt::Horizontal - - + + Qt::Horizontal - + QDialogButtonBox::Cancel|QDialogButtonBox::Ok @@ -68,11 +54,11 @@ ProjectExplorer::Internal::DependenciesDialog accept() - + 142 285 - + 142 155 @@ -84,11 +70,11 @@ ProjectExplorer::Internal::DependenciesDialog reject() - + 142 285 - + 142 155 diff --git a/src/plugins/projectexplorer/directoryproject.cpp b/src/plugins/projectexplorer/directoryproject.cpp index 042d1ecaa91..58443ec62d2 100644 --- a/src/plugins/projectexplorer/directoryproject.cpp +++ b/src/plugins/projectexplorer/directoryproject.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/editorconfiguration.cpp b/src/plugins/projectexplorer/editorconfiguration.cpp index a836c4d9a03..3f54b6c57e7 100644 --- a/src/plugins/projectexplorer/editorconfiguration.cpp +++ b/src/plugins/projectexplorer/editorconfiguration.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/editorconfiguration.h b/src/plugins/projectexplorer/editorconfiguration.h index d01fb8b7195..41cea2e7af9 100644 --- a/src/plugins/projectexplorer/editorconfiguration.h +++ b/src/plugins/projectexplorer/editorconfiguration.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/editorsettingspropertiespage.cpp b/src/plugins/projectexplorer/editorsettingspropertiespage.cpp index f62bc485b98..7932a3d36cf 100644 --- a/src/plugins/projectexplorer/editorsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/editorsettingspropertiespage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/editorsettingspropertiespage.h b/src/plugins/projectexplorer/editorsettingspropertiespage.h index caaad115f97..3be9f229c4f 100644 --- a/src/plugins/projectexplorer/editorsettingspropertiespage.h +++ b/src/plugins/projectexplorer/editorsettingspropertiespage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/environment.cpp b/src/plugins/projectexplorer/environment.cpp index 9220564bba0..7a767d75b2e 100644 --- a/src/plugins/projectexplorer/environment.cpp +++ b/src/plugins/projectexplorer/environment.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -87,14 +87,16 @@ Environment::Environment(QStringList env) } } -QStringList Environment::toStringList() +QStringList Environment::toStringList() const { QStringList result; - QMap::const_iterator it, end; - end = m_values.constEnd(); - for (it = m_values.constBegin(); it != end; ++it) - result<<(it.key() + "=" + it.value()); - + const QMap::const_iterator end = m_values.constEnd(); + for (QMap::const_iterator it = m_values.constBegin(); it != end; ++it) { + QString entry = it.key(); + entry += QLatin1Char('='); + entry += it.value(); + result.push_back(entry); + } return result; } diff --git a/src/plugins/projectexplorer/environment.h b/src/plugins/projectexplorer/environment.h index ba3aa9f161d..71cd10cb952 100644 --- a/src/plugins/projectexplorer/environment.h +++ b/src/plugins/projectexplorer/environment.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -65,7 +65,7 @@ public: explicit Environment(QStringList env); static Environment systemEnvironment(); - QStringList toStringList(); + QStringList toStringList() const; QString value(const QString &key) const; void set(const QString &key, const QString &value); void unset(const QString &key); diff --git a/src/plugins/projectexplorer/environmenteditmodel.cpp b/src/plugins/projectexplorer/environmenteditmodel.cpp index caa5e571404..8cfa9c31577 100644 --- a/src/plugins/projectexplorer/environmenteditmodel.cpp +++ b/src/plugins/projectexplorer/environmenteditmodel.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/environmenteditmodel.h b/src/plugins/projectexplorer/environmenteditmodel.h index 070703cab14..e99c69da2cc 100644 --- a/src/plugins/projectexplorer/environmenteditmodel.h +++ b/src/plugins/projectexplorer/environmenteditmodel.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/foldernavigationwidget.cpp b/src/plugins/projectexplorer/foldernavigationwidget.cpp index 4fcca615163..029707155e5 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.cpp +++ b/src/plugins/projectexplorer/foldernavigationwidget.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/foldernavigationwidget.h b/src/plugins/projectexplorer/foldernavigationwidget.h index f88bdd6d79c..c3eba4ce662 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.h +++ b/src/plugins/projectexplorer/foldernavigationwidget.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/iprojectmanager.h b/src/plugins/projectexplorer/iprojectmanager.h index 3455375a0f8..e38de44efb2 100644 --- a/src/plugins/projectexplorer/iprojectmanager.h +++ b/src/plugins/projectexplorer/iprojectmanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/iprojectproperties.h b/src/plugins/projectexplorer/iprojectproperties.h index 0a4d762f339..aab3b504331 100644 --- a/src/plugins/projectexplorer/iprojectproperties.h +++ b/src/plugins/projectexplorer/iprojectproperties.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/metatypedeclarations.h b/src/plugins/projectexplorer/metatypedeclarations.h index 5ec03977a98..67076b6a966 100644 --- a/src/plugins/projectexplorer/metatypedeclarations.h +++ b/src/plugins/projectexplorer/metatypedeclarations.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/nodesvisitor.cpp b/src/plugins/projectexplorer/nodesvisitor.cpp index 4ebe7913ef0..17828ff5ea9 100644 --- a/src/plugins/projectexplorer/nodesvisitor.cpp +++ b/src/plugins/projectexplorer/nodesvisitor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/nodesvisitor.h b/src/plugins/projectexplorer/nodesvisitor.h index f489ab95844..3b02cd1a47a 100644 --- a/src/plugins/projectexplorer/nodesvisitor.h +++ b/src/plugins/projectexplorer/nodesvisitor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/outputwindow.cpp b/src/plugins/projectexplorer/outputwindow.cpp index 597a6daba6e..c02f21ff34b 100644 --- a/src/plugins/projectexplorer/outputwindow.cpp +++ b/src/plugins/projectexplorer/outputwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -35,7 +35,7 @@ #include "projectexplorerconstants.h" #include "runconfiguration.h" -#include +#include #include #include #include @@ -78,7 +78,7 @@ OutputPane::OutputPane(Core::ICore *core) this, SLOT(reRunRunControl())); // Stop - Core::ActionManagerInterface *am = core->actionManager(); + Core::ActionManager *am = core->actionManager(); QList globalcontext; globalcontext.append(Core::Constants::C_GLOBAL_ID); @@ -86,7 +86,7 @@ OutputPane::OutputPane(Core::ICore *core) m_stopAction->setToolTip(tr("Stop")); m_stopAction->setEnabled(false); - Core::ICommand *cmd = am->registerAction(m_stopAction, Constants::STOP, globalcontext); + Core::Command *cmd = am->registerAction(m_stopAction, Constants::STOP, globalcontext); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+R"))); m_stopButton = new QToolButton; diff --git a/src/plugins/projectexplorer/outputwindow.h b/src/plugins/projectexplorer/outputwindow.h index 3367909d804..6bda6121af6 100644 --- a/src/plugins/projectexplorer/outputwindow.h +++ b/src/plugins/projectexplorer/outputwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/persistentsettings.cpp b/src/plugins/projectexplorer/persistentsettings.cpp index c8b38f11398..12ff44b0b4b 100644 --- a/src/plugins/projectexplorer/persistentsettings.cpp +++ b/src/plugins/projectexplorer/persistentsettings.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/persistentsettings.h b/src/plugins/projectexplorer/persistentsettings.h index 011a61e28b7..9df83d6d788 100644 --- a/src/plugins/projectexplorer/persistentsettings.h +++ b/src/plugins/projectexplorer/persistentsettings.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/pluginfilefactory.cpp b/src/plugins/projectexplorer/pluginfilefactory.cpp index 09630139a44..de7153c4015 100644 --- a/src/plugins/projectexplorer/pluginfilefactory.cpp +++ b/src/plugins/projectexplorer/pluginfilefactory.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/pluginfilefactory.h b/src/plugins/projectexplorer/pluginfilefactory.h index ff6527713fa..035eb50e665 100644 --- a/src/plugins/projectexplorer/pluginfilefactory.h +++ b/src/plugins/projectexplorer/pluginfilefactory.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/processstep.cpp b/src/plugins/projectexplorer/processstep.cpp index 3d8b11665cc..e53e6a10992 100644 --- a/src/plugins/projectexplorer/processstep.cpp +++ b/src/plugins/projectexplorer/processstep.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/processstep.h b/src/plugins/projectexplorer/processstep.h index 11b40ba9afd..808aaa2a95b 100644 --- a/src/plugins/projectexplorer/processstep.h +++ b/src/plugins/projectexplorer/processstep.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 3d8d8c7b802..3f377b52a11 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h index 2ad175e48c2..2a30a0e20f3 100644 --- a/src/plugins/projectexplorer/project.h +++ b/src/plugins/projectexplorer/project.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index b69469048b5..2c840127c5f 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -66,7 +66,7 @@ #include #include #include -#include +#include #include #include #include @@ -155,7 +155,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin { ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); m_core = pm->getObject(); - Core::ActionManagerInterface *am = m_core->actionManager(); + Core::ActionManager *am = m_core->actionManager(); addObject(this); @@ -181,11 +181,12 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin QList pecontext; pecontext << m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_PROJECTEXPLORER); - Core::BaseMode *mode = new Core::BaseMode(tr("Projects"), - Constants::MODE_SESSION, - QIcon(QLatin1String(":/fancyactionbar/images/mode_Project.png")), - Constants::P_MODE_SESSION, - m_proWindow); + Core::BaseMode *mode = new Core::BaseMode; + mode->setName(tr("Projects")); + mode->setUniqueModeName(Constants::MODE_SESSION); + mode->setIcon(QIcon(QLatin1String(":/fancyactionbar/images/mode_Project.png"))); + mode->setPriority(Constants::P_MODE_SESSION); + mode->setWidget(m_proWindow); mode->setContext(QList() << pecontext); addAutoReleasedObject(mode); m_proWindow->layout()->addWidget(new Core::FindToolBarPlaceHolder(mode)); @@ -232,15 +233,15 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin addAutoReleasedObject(new ProjectFileWizardExtension(m_core)); // context menus - Core::IActionContainer *msessionContextMenu = + Core::ActionContainer *msessionContextMenu = am->createMenu(Constants::M_SESSIONCONTEXT); - Core::IActionContainer *mproject = + Core::ActionContainer *mproject = am->createMenu(Constants::M_PROJECTCONTEXT); - Core::IActionContainer *msubProject = + Core::ActionContainer *msubProject = am->createMenu(Constants::M_SUBPROJECTCONTEXT); - Core::IActionContainer *mfolder = + Core::ActionContainer *mfolder = am->createMenu(Constants::M_FOLDERCONTEXT); - Core::IActionContainer *mfilec = + Core::ActionContainer *mfilec = am->createMenu(Constants::M_FILECONTEXT); m_sessionContextMenu = msessionContextMenu->menu(); @@ -249,22 +250,22 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin m_folderMenu = mfolder->menu(); m_fileMenu = mfilec->menu(); - Core::IActionContainer *mfile = + Core::ActionContainer *mfile = am->actionContainer(Core::Constants::M_FILE); - Core::IActionContainer *menubar = + Core::ActionContainer *menubar = am->actionContainer(Core::Constants::MENU_BAR); // mode manager (for fancy actions) Core::ModeManager *modeManager = m_core->modeManager(); // build menu - Core::IActionContainer *mbuild = + Core::ActionContainer *mbuild = am->createMenu(Constants::M_BUILDPROJECT); mbuild->menu()->setTitle("&Build"); menubar->addMenu(mbuild, Core::Constants::G_VIEW); // debug menu - Core::IActionContainer *mdebug = + Core::ActionContainer *mdebug = am->createMenu(Constants::M_DEBUG); mdebug->menu()->setTitle("&Debug"); menubar->addMenu(mdebug, Core::Constants::G_VIEW); @@ -308,7 +309,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin mfilec->appendGroup(Constants::G_FILE_CONFIG); // "open with" submenu - Core::IActionContainer * const openWith = + Core::ActionContainer * const openWith = am->createMenu(ProjectExplorer::Constants::M_OPENFILEWITHCONTEXT); m_openWithMenu = openWith->menu(); m_openWithMenu->setTitle(tr("Open With")); @@ -321,7 +322,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin // Separators // - Core::ICommand *cmd; + Core::Command *cmd; QAction *sep; sep = new QAction(this); @@ -416,7 +417,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin mfilec->addMenu(openWith, ProjectExplorer::Constants::G_FILE_OPEN); // recent projects menu - Core::IActionContainer *mrecent = + Core::ActionContainer *mrecent = am->createMenu(Constants::M_RECENTPROJECTS); mrecent->menu()->setTitle("Recent Projects"); mfile->addMenu(mrecent, Core::Constants::G_FILE_OPEN); @@ -426,7 +427,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin // unload action m_unloadAction = new QAction(tr("Unload Project"), this); cmd = am->registerAction(m_unloadAction, Constants::UNLOAD, globalcontext); - cmd->setAttribute(Core::ICommand::CA_UpdateText); + cmd->setAttribute(Core::Command::CA_UpdateText); cmd->setDefaultText(m_unloadAction->text()); mfile->addAction(cmd, Core::Constants::G_FILE_PROJECT); mproject->addAction(cmd, Constants::G_PROJECT_FILES); @@ -438,7 +439,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES); // session menu - Core::IActionContainer *msession = am->createMenu(Constants::M_SESSION); + Core::ActionContainer *msession = am->createMenu(Constants::M_SESSION); msession->menu()->setTitle("&Session"); mfile->addMenu(msession, Core::Constants::G_FILE_PROJECT); m_sessionMenu = msession->menu(); @@ -446,7 +447,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin this, SLOT(updateSessionMenu())); // build menu - Core::IActionContainer *mbc = + Core::ActionContainer *mbc = am->createMenu(Constants::BUILDCONFIGURATIONMENU); m_buildConfigurationMenu = mbc->menu(); m_buildConfigurationMenu->setTitle(tr("Set Build Configuration")); @@ -484,6 +485,10 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin mbuild->addAction(cmd, Constants::G_BUILD_SESSION); msessionContextMenu->addAction(cmd, Constants::G_SESSION_BUILD); + // dependencies action + m_dependenciesAction = new QAction(tr("Edit Dependencies..."), this); + cmd = am->registerAction(m_dependenciesAction, Constants::DEPENDENCIES, globalcontext); + mbuild->addAction(cmd, Constants::G_BUILD_SESSION); // build action m_buildAction = new QAction(tr("Build Project"), this); @@ -519,7 +524,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin mbuild->addAction(cmd, Constants::G_BUILD_RUN); mproject->addAction(cmd, Constants::G_PROJECT_RUN); - Core::IActionContainer *mrc = am->createMenu(Constants::RUNCONFIGURATIONMENU); + Core::ActionContainer *mrc = am->createMenu(Constants::RUNCONFIGURATIONMENU); m_runConfigurationMenu = mrc->menu(); m_runConfigurationMenu->setTitle(tr("Set Run Configuration")); mbuild->addMenu(mrc, Constants::G_BUILD_RUN); @@ -549,18 +554,13 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin debuggerIcon.addFile(":/gdbdebugger/images/debugger_start.png"); m_debugAction = new QAction(debuggerIcon, tr("Start Debugging"), this); cmd = am->registerAction(m_debugAction, Constants::DEBUG, globalcontext); - cmd->setAttribute(Core::ICommand::CA_UpdateText); - cmd->setAttribute(Core::ICommand::CA_UpdateIcon); + cmd->setAttribute(Core::Command::CA_UpdateText); + cmd->setAttribute(Core::Command::CA_UpdateIcon); cmd->setDefaultText(tr("Start Debugging")); cmd->setDefaultKeySequence(QKeySequence(tr("F5"))); mdebug->addAction(cmd, Core::Constants::G_DEFAULT_ONE); modeManager->addAction(cmd, Constants::P_ACTION_DEBUG, m_runConfigurationMenu); - // dependencies action - m_dependenciesAction = new QAction(tr("Edit Dependencies..."), this); - cmd = am->registerAction(m_dependenciesAction, Constants::DEPENDENCIES, pecontext); - msessionContextMenu->addAction(cmd, Constants::G_SESSION_CONFIG); - // add new file action m_addNewFileAction = new QAction(tr("Add New..."), this); cmd = am->registerAction(m_addNewFileAction, ProjectExplorer::Constants::ADDNEWFILE, @@ -1473,7 +1473,7 @@ void ProjectExplorerPlugin::updateRecentProjectMenu() if (debug) qDebug() << "ProjectExplorerPlugin::updateRecentProjectMenu"; - Core::IActionContainer *aci = + Core::ActionContainer *aci = m_core->actionManager()->actionContainer(Constants::M_RECENTPROJECTS); QMenu *menu = aci->menu(); menu->clear(); diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h index fa6f34602ca..2c1127ff5c6 100644 --- a/src/plugins/projectexplorer/projectexplorer.h +++ b/src/plugins/projectexplorer/projectexplorer.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/projectexplorer_export.h b/src/plugins/projectexplorer/projectexplorer_export.h index ff288b1d172..67274a3ec4b 100644 --- a/src/plugins/projectexplorer/projectexplorer_export.h +++ b/src/plugins/projectexplorer/projectexplorer_export.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/projectexplorerconstants.h b/src/plugins/projectexplorer/projectexplorerconstants.h index 5cc5f5c67e2..ef745e69c90 100644 --- a/src/plugins/projectexplorer/projectexplorerconstants.h +++ b/src/plugins/projectexplorer/projectexplorerconstants.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/projectfilewizardextension.cpp b/src/plugins/projectexplorer/projectfilewizardextension.cpp index 5f9b5f49260..6b928db16b5 100644 --- a/src/plugins/projectexplorer/projectfilewizardextension.cpp +++ b/src/plugins/projectexplorer/projectfilewizardextension.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/projectfilewizardextension.h b/src/plugins/projectexplorer/projectfilewizardextension.h index 6e777cf19ec..3008b0772e6 100644 --- a/src/plugins/projectexplorer/projectfilewizardextension.h +++ b/src/plugins/projectexplorer/projectfilewizardextension.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index 59ca5457e4f..7d9464cffb5 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/projectmodels.h b/src/plugins/projectexplorer/projectmodels.h index 2cdf1e6f4d7..92574aa9ff9 100644 --- a/src/plugins/projectexplorer/projectmodels.h +++ b/src/plugins/projectexplorer/projectmodels.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/projectnodes.cpp b/src/plugins/projectexplorer/projectnodes.cpp index e7404b57538..9d2299f0d42 100644 --- a/src/plugins/projectexplorer/projectnodes.cpp +++ b/src/plugins/projectexplorer/projectnodes.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/projectnodes.h b/src/plugins/projectexplorer/projectnodes.h index e45cfbc9c03..d8f0c725bbb 100644 --- a/src/plugins/projectexplorer/projectnodes.h +++ b/src/plugins/projectexplorer/projectnodes.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index 39b7214d214..8c71ead4334 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/projecttreewidget.h b/src/plugins/projectexplorer/projecttreewidget.h index 91f83ca3a69..4d9224b46e9 100644 --- a/src/plugins/projectexplorer/projecttreewidget.h +++ b/src/plugins/projectexplorer/projecttreewidget.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index b02839a4c5a..e6e2455cced 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/projectwindow.h b/src/plugins/projectexplorer/projectwindow.h index 8bd54694224..c9b387ceaa2 100644 --- a/src/plugins/projectexplorer/projectwindow.h +++ b/src/plugins/projectexplorer/projectwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/projectwizardpage.cpp b/src/plugins/projectexplorer/projectwizardpage.cpp index a2d544393ac..f20fb6c42ba 100644 --- a/src/plugins/projectexplorer/projectwizardpage.cpp +++ b/src/plugins/projectexplorer/projectwizardpage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/projectwizardpage.h b/src/plugins/projectexplorer/projectwizardpage.h index e076a3f0a3c..864ef7565a7 100644 --- a/src/plugins/projectexplorer/projectwizardpage.h +++ b/src/plugins/projectexplorer/projectwizardpage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/removefiledialog.cpp b/src/plugins/projectexplorer/removefiledialog.cpp index c08075f0e53..4ecd7e86963 100644 --- a/src/plugins/projectexplorer/removefiledialog.cpp +++ b/src/plugins/projectexplorer/removefiledialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/removefiledialog.h b/src/plugins/projectexplorer/removefiledialog.h index 3e9ac432c31..e5a57815d19 100644 --- a/src/plugins/projectexplorer/removefiledialog.h +++ b/src/plugins/projectexplorer/removefiledialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index fc897a2f9fc..76083833975 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index c7cf2519bf3..acc11cd932a 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/runsettingspropertiespage.cpp b/src/plugins/projectexplorer/runsettingspropertiespage.cpp index 2f309814dd7..6b121ef20f5 100644 --- a/src/plugins/projectexplorer/runsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/runsettingspropertiespage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/runsettingspropertiespage.h b/src/plugins/projectexplorer/runsettingspropertiespage.h index 1f22bae7e71..b7eb1201551 100644 --- a/src/plugins/projectexplorer/runsettingspropertiespage.h +++ b/src/plugins/projectexplorer/runsettingspropertiespage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/scriptwrappers.cpp b/src/plugins/projectexplorer/scriptwrappers.cpp index 87378531330..7851e86ee89 100644 --- a/src/plugins/projectexplorer/scriptwrappers.cpp +++ b/src/plugins/projectexplorer/scriptwrappers.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/scriptwrappers.h b/src/plugins/projectexplorer/scriptwrappers.h index 05ef55420ae..86b2be4fafc 100644 --- a/src/plugins/projectexplorer/scriptwrappers.h +++ b/src/plugins/projectexplorer/scriptwrappers.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp index c8fdaf50c98..ef848ff178b 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include @@ -161,7 +161,7 @@ bool SessionFile::load(const QString &fileName) m_core->progressManager()->addTask(future.future(), tr("Session"), QLatin1String("ProjectExplorer.SessionFile.Load"), - Core::ProgressManagerInterface::CloseOnSuccess); + Core::ProgressManager::CloseOnSuccess); const QStringList &keys = reader.restoreValue(QLatin1String("valueKeys")).toStringList(); foreach (const QString &key, keys) { diff --git a/src/plugins/projectexplorer/session.h b/src/plugins/projectexplorer/session.h index b44202f9a6a..49d15b7e8df 100644 --- a/src/plugins/projectexplorer/session.h +++ b/src/plugins/projectexplorer/session.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/sessiondialog.cpp b/src/plugins/projectexplorer/sessiondialog.cpp index 0ce134edfb9..8dd67943dd1 100644 --- a/src/plugins/projectexplorer/sessiondialog.cpp +++ b/src/plugins/projectexplorer/sessiondialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/sessiondialog.h b/src/plugins/projectexplorer/sessiondialog.h index 07aa28a0084..461577eac5e 100644 --- a/src/plugins/projectexplorer/sessiondialog.h +++ b/src/plugins/projectexplorer/sessiondialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index b702bb98bd3..5421b9bbe63 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/taskwindow.h b/src/plugins/projectexplorer/taskwindow.h index 48b8de1eb11..71875f9e84f 100644 --- a/src/plugins/projectexplorer/taskwindow.h +++ b/src/plugins/projectexplorer/taskwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/winguiprocess.cpp b/src/plugins/projectexplorer/winguiprocess.cpp index 13663e622fc..a7e21fd27cd 100644 --- a/src/plugins/projectexplorer/winguiprocess.cpp +++ b/src/plugins/projectexplorer/winguiprocess.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/projectexplorer/winguiprocess.h b/src/plugins/projectexplorer/winguiprocess.h index 02ab6d9ff66..73b62364f9c 100644 --- a/src/plugins/projectexplorer/winguiprocess.h +++ b/src/plugins/projectexplorer/winguiprocess.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qhelpproject/qhelpproject.cpp b/src/plugins/qhelpproject/qhelpproject.cpp index 4bdfaf38cf6..8185b7b47f4 100644 --- a/src/plugins/qhelpproject/qhelpproject.cpp +++ b/src/plugins/qhelpproject/qhelpproject.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qhelpproject/qhelpproject.h b/src/plugins/qhelpproject/qhelpproject.h index bd9d2540b58..0b1ea26b913 100644 --- a/src/plugins/qhelpproject/qhelpproject.h +++ b/src/plugins/qhelpproject/qhelpproject.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qhelpproject/qhelpprojectitems.cpp b/src/plugins/qhelpproject/qhelpprojectitems.cpp index 1dad2894041..994f29d06aa 100644 --- a/src/plugins/qhelpproject/qhelpprojectitems.cpp +++ b/src/plugins/qhelpproject/qhelpprojectitems.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qhelpproject/qhelpprojectitems.h b/src/plugins/qhelpproject/qhelpprojectitems.h index ca6f793d814..bad28bff225 100644 --- a/src/plugins/qhelpproject/qhelpprojectitems.h +++ b/src/plugins/qhelpproject/qhelpprojectitems.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qhelpproject/qhelpprojectmanager.cpp b/src/plugins/qhelpproject/qhelpprojectmanager.cpp index 88870e675e0..8941d7fa696 100644 --- a/src/plugins/qhelpproject/qhelpprojectmanager.cpp +++ b/src/plugins/qhelpproject/qhelpprojectmanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -52,7 +52,7 @@ bool QHelpProjectManager::init(ExtensionSystem::PluginManager *pm, QString *erro { m_pm = pm; m_core = m_pm->interface(); - QWorkbench::ActionManagerInterface *am = m_core->actionManager(); + QWorkbench::ActionManager *am = m_core->actionManager(); m_projectContext = m_core->uniqueIDManager()-> uniqueIdentifier(QLatin1String("QHelpProject")); diff --git a/src/plugins/qhelpproject/qhelpprojectmanager.h b/src/plugins/qhelpproject/qhelpprojectmanager.h index 571d39c3289..ec870e110df 100644 --- a/src/plugins/qhelpproject/qhelpprojectmanager.h +++ b/src/plugins/qhelpproject/qhelpprojectmanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/applicationlauncher.h b/src/plugins/qt4projectmanager/applicationlauncher.h index 6f5aec1a141..e5086d14c4b 100644 --- a/src/plugins/qt4projectmanager/applicationlauncher.h +++ b/src/plugins/qt4projectmanager/applicationlauncher.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/buildoptionspage.cpp b/src/plugins/qt4projectmanager/buildoptionspage.cpp index 5258776456e..4c0d281a727 100644 --- a/src/plugins/qt4projectmanager/buildoptionspage.cpp +++ b/src/plugins/qt4projectmanager/buildoptionspage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/buildparserfactory.cpp b/src/plugins/qt4projectmanager/buildparserfactory.cpp index 34a62305f65..9b52fafb23b 100644 --- a/src/plugins/qt4projectmanager/buildparserfactory.cpp +++ b/src/plugins/qt4projectmanager/buildparserfactory.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/buildparserfactory.h b/src/plugins/qt4projectmanager/buildparserfactory.h index 1c96b053ba7..0e8495d5fb0 100644 --- a/src/plugins/qt4projectmanager/buildparserfactory.h +++ b/src/plugins/qt4projectmanager/buildparserfactory.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/cesdkhandler.cpp b/src/plugins/qt4projectmanager/cesdkhandler.cpp index c4b5f5e22a6..a6e4dfe4925 100644 --- a/src/plugins/qt4projectmanager/cesdkhandler.cpp +++ b/src/plugins/qt4projectmanager/cesdkhandler.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/cesdkhandler.h b/src/plugins/qt4projectmanager/cesdkhandler.h index d3e5bf4a035..dd9c1d9b5e0 100644 --- a/src/plugins/qt4projectmanager/cesdkhandler.h +++ b/src/plugins/qt4projectmanager/cesdkhandler.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/deployhelper.cpp b/src/plugins/qt4projectmanager/deployhelper.cpp index 865d26e15a5..b11cdb36f1c 100644 --- a/src/plugins/qt4projectmanager/deployhelper.cpp +++ b/src/plugins/qt4projectmanager/deployhelper.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/deployhelper.h b/src/plugins/qt4projectmanager/deployhelper.h index 49626f887da..8462f05b05c 100644 --- a/src/plugins/qt4projectmanager/deployhelper.h +++ b/src/plugins/qt4projectmanager/deployhelper.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/directorywatcher.cpp b/src/plugins/qt4projectmanager/directorywatcher.cpp index e2e0828219f..d20444098e0 100644 --- a/src/plugins/qt4projectmanager/directorywatcher.cpp +++ b/src/plugins/qt4projectmanager/directorywatcher.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/directorywatcher.h b/src/plugins/qt4projectmanager/directorywatcher.h index af73a131f0d..57f015330a1 100644 --- a/src/plugins/qt4projectmanager/directorywatcher.h +++ b/src/plugins/qt4projectmanager/directorywatcher.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/embeddedpropertiespage.cpp b/src/plugins/qt4projectmanager/embeddedpropertiespage.cpp index 61d9ff0bc37..2912084b6ce 100644 --- a/src/plugins/qt4projectmanager/embeddedpropertiespage.cpp +++ b/src/plugins/qt4projectmanager/embeddedpropertiespage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/embeddedpropertiespage.h b/src/plugins/qt4projectmanager/embeddedpropertiespage.h index 93b7bae4cac..e527e9e4546 100644 --- a/src/plugins/qt4projectmanager/embeddedpropertiespage.h +++ b/src/plugins/qt4projectmanager/embeddedpropertiespage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/gccparser.cpp b/src/plugins/qt4projectmanager/gccparser.cpp index 52187715fbf..1d43e77f574 100644 --- a/src/plugins/qt4projectmanager/gccparser.cpp +++ b/src/plugins/qt4projectmanager/gccparser.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/gccparser.h b/src/plugins/qt4projectmanager/gccparser.h index 76e2b11b31f..1b556dd6755 100644 --- a/src/plugins/qt4projectmanager/gccparser.h +++ b/src/plugins/qt4projectmanager/gccparser.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/gccpreprocessor.cpp b/src/plugins/qt4projectmanager/gccpreprocessor.cpp index a9463778730..4ceef15c053 100644 --- a/src/plugins/qt4projectmanager/gccpreprocessor.cpp +++ b/src/plugins/qt4projectmanager/gccpreprocessor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/gccpreprocessor.h b/src/plugins/qt4projectmanager/gccpreprocessor.h index 484dee0b538..5ca59856e03 100644 --- a/src/plugins/qt4projectmanager/gccpreprocessor.h +++ b/src/plugins/qt4projectmanager/gccpreprocessor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp b/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp index 5b03ba2d5b0..49d8ccd8a30 100644 --- a/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp +++ b/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/gdbmacrosbuildstep.h b/src/plugins/qt4projectmanager/gdbmacrosbuildstep.h index f5aa55d22e5..140252c195b 100644 --- a/src/plugins/qt4projectmanager/gdbmacrosbuildstep.h +++ b/src/plugins/qt4projectmanager/gdbmacrosbuildstep.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/headerpath.h b/src/plugins/qt4projectmanager/headerpath.h index 74012f89750..46ea6095df8 100644 --- a/src/plugins/qt4projectmanager/headerpath.h +++ b/src/plugins/qt4projectmanager/headerpath.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/makestep.cpp b/src/plugins/qt4projectmanager/makestep.cpp index 5e6d3fce824..2a032e63fd7 100644 --- a/src/plugins/qt4projectmanager/makestep.cpp +++ b/src/plugins/qt4projectmanager/makestep.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/makestep.h b/src/plugins/qt4projectmanager/makestep.h index ad066d23c40..6312f08a1e1 100644 --- a/src/plugins/qt4projectmanager/makestep.h +++ b/src/plugins/qt4projectmanager/makestep.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/msvcenvironment.cpp b/src/plugins/qt4projectmanager/msvcenvironment.cpp index dcfc15e10c8..2ae9bbebdf7 100644 --- a/src/plugins/qt4projectmanager/msvcenvironment.cpp +++ b/src/plugins/qt4projectmanager/msvcenvironment.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/msvcenvironment.h b/src/plugins/qt4projectmanager/msvcenvironment.h index b1aef04e1c9..b3b50718256 100644 --- a/src/plugins/qt4projectmanager/msvcenvironment.h +++ b/src/plugins/qt4projectmanager/msvcenvironment.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/msvcparser.cpp b/src/plugins/qt4projectmanager/msvcparser.cpp index 7ef3d7c955f..d4a23264c79 100644 --- a/src/plugins/qt4projectmanager/msvcparser.cpp +++ b/src/plugins/qt4projectmanager/msvcparser.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/msvcparser.h b/src/plugins/qt4projectmanager/msvcparser.h index 4811c90773c..6eaee5c97e9 100644 --- a/src/plugins/qt4projectmanager/msvcparser.h +++ b/src/plugins/qt4projectmanager/msvcparser.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/profilecache.h b/src/plugins/qt4projectmanager/profilecache.h index eef60ee5624..484978d662d 100644 --- a/src/plugins/qt4projectmanager/profilecache.h +++ b/src/plugins/qt4projectmanager/profilecache.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/profileeditor.cpp b/src/plugins/qt4projectmanager/profileeditor.cpp index 6d4f36f1f79..e173bff2316 100644 --- a/src/plugins/qt4projectmanager/profileeditor.cpp +++ b/src/plugins/qt4projectmanager/profileeditor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/profileeditor.h b/src/plugins/qt4projectmanager/profileeditor.h index 36017aa6eb8..e2c6c3be5c8 100644 --- a/src/plugins/qt4projectmanager/profileeditor.h +++ b/src/plugins/qt4projectmanager/profileeditor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/profileeditorfactory.cpp b/src/plugins/qt4projectmanager/profileeditorfactory.cpp index bc9e1729eb4..dfe8c33232f 100644 --- a/src/plugins/qt4projectmanager/profileeditorfactory.cpp +++ b/src/plugins/qt4projectmanager/profileeditorfactory.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/profileeditorfactory.h b/src/plugins/qt4projectmanager/profileeditorfactory.h index f73edc8f47b..8f341855e8a 100644 --- a/src/plugins/qt4projectmanager/profileeditorfactory.h +++ b/src/plugins/qt4projectmanager/profileeditorfactory.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/profilehighlighter.cpp b/src/plugins/qt4projectmanager/profilehighlighter.cpp index 90338130378..783acb35883 100644 --- a/src/plugins/qt4projectmanager/profilehighlighter.cpp +++ b/src/plugins/qt4projectmanager/profilehighlighter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/profilehighlighter.h b/src/plugins/qt4projectmanager/profilehighlighter.h index bdbf9c60457..0340b8efdce 100644 --- a/src/plugins/qt4projectmanager/profilehighlighter.h +++ b/src/plugins/qt4projectmanager/profilehighlighter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/profilereader.cpp b/src/plugins/qt4projectmanager/profilereader.cpp index a8069b54a79..51337d7f242 100644 --- a/src/plugins/qt4projectmanager/profilereader.cpp +++ b/src/plugins/qt4projectmanager/profilereader.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/profilereader.h b/src/plugins/qt4projectmanager/profilereader.h index 81e0ad2f944..c9df6ee7e01 100644 --- a/src/plugins/qt4projectmanager/profilereader.h +++ b/src/plugins/qt4projectmanager/profilereader.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/projectloadwizard.cpp b/src/plugins/qt4projectmanager/projectloadwizard.cpp index 62bef9bcc6b..970ae1247fa 100644 --- a/src/plugins/qt4projectmanager/projectloadwizard.cpp +++ b/src/plugins/qt4projectmanager/projectloadwizard.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/projectloadwizard.h b/src/plugins/qt4projectmanager/projectloadwizard.h index 71dae75bf29..bce753f4160 100644 --- a/src/plugins/qt4projectmanager/projectloadwizard.h +++ b/src/plugins/qt4projectmanager/projectloadwizard.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/qmakebuildstepfactory.cpp b/src/plugins/qt4projectmanager/qmakebuildstepfactory.cpp index f6c422b9a0d..8d9eb1c2caa 100644 --- a/src/plugins/qt4projectmanager/qmakebuildstepfactory.cpp +++ b/src/plugins/qt4projectmanager/qmakebuildstepfactory.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/qmakebuildstepfactory.h b/src/plugins/qt4projectmanager/qmakebuildstepfactory.h index 2766701eab3..0f5e14a9d7b 100644 --- a/src/plugins/qt4projectmanager/qmakebuildstepfactory.h +++ b/src/plugins/qt4projectmanager/qmakebuildstepfactory.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/qmakestep.cpp b/src/plugins/qt4projectmanager/qmakestep.cpp index 1b50ee296d2..d8c4204ccdf 100644 --- a/src/plugins/qt4projectmanager/qmakestep.cpp +++ b/src/plugins/qt4projectmanager/qmakestep.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/qmakestep.h b/src/plugins/qt4projectmanager/qmakestep.h index 4431e59bfb8..228aca7c2a3 100644 --- a/src/plugins/qt4projectmanager/qmakestep.h +++ b/src/plugins/qt4projectmanager/qmakestep.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/qt4buildconfigwidget.cpp b/src/plugins/qt4projectmanager/qt4buildconfigwidget.cpp index 13fb5980a90..de7141b0794 100644 --- a/src/plugins/qt4projectmanager/qt4buildconfigwidget.cpp +++ b/src/plugins/qt4projectmanager/qt4buildconfigwidget.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/qt4buildconfigwidget.h b/src/plugins/qt4projectmanager/qt4buildconfigwidget.h index c7910b44b04..5e584fa149f 100644 --- a/src/plugins/qt4projectmanager/qt4buildconfigwidget.h +++ b/src/plugins/qt4projectmanager/qt4buildconfigwidget.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.cpp b/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.cpp index f0195cfd847..8b207bc64a6 100644 --- a/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.cpp +++ b/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.h b/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.h index 1218607f5c5..bc8bab91d54 100644 --- a/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.h +++ b/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/qt4nodes.cpp b/src/plugins/qt4projectmanager/qt4nodes.cpp index 7157c8788f5..8f836f64982 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.cpp +++ b/src/plugins/qt4projectmanager/qt4nodes.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/qt4nodes.h b/src/plugins/qt4projectmanager/qt4nodes.h index 487177c84ae..9ea6b07c71c 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.h +++ b/src/plugins/qt4projectmanager/qt4nodes.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp index dd61dbde099..7af448e2331 100644 --- a/src/plugins/qt4projectmanager/qt4project.cpp +++ b/src/plugins/qt4projectmanager/qt4project.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/qt4project.h b/src/plugins/qt4projectmanager/qt4project.h index a70669f49f0..24b7e45d6e8 100644 --- a/src/plugins/qt4projectmanager/qt4project.h +++ b/src/plugins/qt4projectmanager/qt4project.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.cpp b/src/plugins/qt4projectmanager/qt4projectmanager.cpp index 7e83418eaae..dd8413aec14 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.cpp +++ b/src/plugins/qt4projectmanager/qt4projectmanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.h b/src/plugins/qt4projectmanager/qt4projectmanager.h index c6eb4127d75..4bb4d6eaf18 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.h +++ b/src/plugins/qt4projectmanager/qt4projectmanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerconstants.h b/src/plugins/qt4projectmanager/qt4projectmanagerconstants.h index e76b4ef5f8c..1ef68a68f5f 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanagerconstants.h +++ b/src/plugins/qt4projectmanager/qt4projectmanagerconstants.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp index debb89dae44..01a0b91aae6 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp +++ b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include #include @@ -82,7 +82,7 @@ Qt4ProjectManagerPlugin::~Qt4ProjectManagerPlugin() delete m_qt4ProjectManager; } /* -static Core::ICommand *createSeparator(Core::ActionManagerInterface *am, +static Core::Command *createSeparator(Core::ActionManager *am, QObject *parent, const QString &name, const QList &context) @@ -100,7 +100,7 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList & /*arguments*/, QStr m_projectExplorer = m_core->pluginManager()->getObject(); - Core::ActionManagerInterface *am = m_core->actionManager(); + Core::ActionManager *am = m_core->actionManager(); //create and register objects m_qt4ProjectManager = new Qt4Manager(this, m_core); @@ -139,16 +139,16 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList & /*arguments*/, QStr //addObject(m_embeddedPropertiesPage); //menus - Core::IActionContainer *mbuild = + Core::ActionContainer *mbuild = am->actionContainer(ProjectExplorer::Constants::M_BUILDPROJECT); - Core::IActionContainer *mproject = + Core::ActionContainer *mproject = am->actionContainer(ProjectExplorer::Constants::M_PROJECTCONTEXT); //register actions m_projectContext = m_core->uniqueIDManager()-> uniqueIdentifier(Qt4ProjectManager::Constants::PROJECT_KIND); QList context = QList() << m_projectContext; - Core::ICommand *command; + Core::Command *command; QIcon qmakeIcon(QLatin1String(":/qt4projectmanager/images/run_qmake.png")); qmakeIcon.addFile(QLatin1String(":/qt4projectmanager/images/run_qmake_small.png")); diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h index ee46f1f6aa0..584a9bfca47 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h +++ b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp index 606e0be1239..99c19e3a7e9 100644 --- a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/qt4runconfiguration.h b/src/plugins/qt4projectmanager/qt4runconfiguration.h index 9e289791438..c51ac521fe5 100644 --- a/src/plugins/qt4projectmanager/qt4runconfiguration.h +++ b/src/plugins/qt4projectmanager/qt4runconfiguration.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp index e39240118d1..2becf546550 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.cpp +++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -162,11 +162,8 @@ void QtVersionManager::updateUniqueIdToIndexMap() m_uniqueIdToIndex.insert(m_versions.at(i)->uniqueId(), i); } -void QtVersionManager::finished(bool accepted) +void QtVersionManager::apply() { - if (!accepted) - return; - m_widget->finish(); QList newVersions = m_widget->versions(); bool versionPathsChanged = m_versions.size() != newVersions.size(); diff --git a/src/plugins/qt4projectmanager/qtversionmanager.h b/src/plugins/qt4projectmanager/qtversionmanager.h index a76a62ada04..a9a76066a33 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.h +++ b/src/plugins/qt4projectmanager/qtversionmanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -172,7 +172,8 @@ public: QString trCategory() const; QWidget *createPage(QWidget *parent); - void finished(bool accepted); + void apply(); + void finish() { } void writeVersionsIntoSettings(); diff --git a/src/plugins/qt4projectmanager/speinfo.cpp b/src/plugins/qt4projectmanager/speinfo.cpp index fefce92e557..04df918bb51 100644 --- a/src/plugins/qt4projectmanager/speinfo.cpp +++ b/src/plugins/qt4projectmanager/speinfo.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/speinfo.h b/src/plugins/qt4projectmanager/speinfo.h index 46ac60372a0..2d9db283ea4 100644 --- a/src/plugins/qt4projectmanager/speinfo.h +++ b/src/plugins/qt4projectmanager/speinfo.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/consoleappwizard.cpp b/src/plugins/qt4projectmanager/wizards/consoleappwizard.cpp index 2be52a0a8d1..73884791fe8 100644 --- a/src/plugins/qt4projectmanager/wizards/consoleappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/consoleappwizard.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/consoleappwizard.h b/src/plugins/qt4projectmanager/wizards/consoleappwizard.h index ffb398d1e7b..36fff218dde 100644 --- a/src/plugins/qt4projectmanager/wizards/consoleappwizard.h +++ b/src/plugins/qt4projectmanager/wizards/consoleappwizard.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/consoleappwizarddialog.cpp b/src/plugins/qt4projectmanager/wizards/consoleappwizarddialog.cpp index 7a1bf47a4c4..8ab95fa7429 100644 --- a/src/plugins/qt4projectmanager/wizards/consoleappwizarddialog.cpp +++ b/src/plugins/qt4projectmanager/wizards/consoleappwizarddialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/consoleappwizarddialog.h b/src/plugins/qt4projectmanager/wizards/consoleappwizarddialog.h index e8ba72a5575..975548eb6ea 100644 --- a/src/plugins/qt4projectmanager/wizards/consoleappwizarddialog.h +++ b/src/plugins/qt4projectmanager/wizards/consoleappwizarddialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/filespage.cpp b/src/plugins/qt4projectmanager/wizards/filespage.cpp index 73d5438ffee..610781613af 100644 --- a/src/plugins/qt4projectmanager/wizards/filespage.cpp +++ b/src/plugins/qt4projectmanager/wizards/filespage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/filespage.h b/src/plugins/qt4projectmanager/wizards/filespage.h index f84812425b2..f5d3bb86f41 100644 --- a/src/plugins/qt4projectmanager/wizards/filespage.h +++ b/src/plugins/qt4projectmanager/wizards/filespage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp b/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp index 1df3a0ba1a3..14df3821ccd 100644 --- a/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/guiappwizard.h b/src/plugins/qt4projectmanager/wizards/guiappwizard.h index f3098e17506..dd7d7e7d02d 100644 --- a/src/plugins/qt4projectmanager/wizards/guiappwizard.h +++ b/src/plugins/qt4projectmanager/wizards/guiappwizard.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.cpp b/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.cpp index 1c525704675..0bc379ecbea 100644 --- a/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.cpp +++ b/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.h b/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.h index 4092fee5dab..080cf802c26 100644 --- a/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.h +++ b/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/libraryparameters.cpp b/src/plugins/qt4projectmanager/wizards/libraryparameters.cpp index 16887d10304..713268736c6 100644 --- a/src/plugins/qt4projectmanager/wizards/libraryparameters.cpp +++ b/src/plugins/qt4projectmanager/wizards/libraryparameters.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/libraryparameters.h b/src/plugins/qt4projectmanager/wizards/libraryparameters.h index e02eaa32bb9..680022c8085 100644 --- a/src/plugins/qt4projectmanager/wizards/libraryparameters.h +++ b/src/plugins/qt4projectmanager/wizards/libraryparameters.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/librarywizard.cpp b/src/plugins/qt4projectmanager/wizards/librarywizard.cpp index ff6639ad484..e79cd1b6588 100644 --- a/src/plugins/qt4projectmanager/wizards/librarywizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/librarywizard.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/librarywizard.h b/src/plugins/qt4projectmanager/wizards/librarywizard.h index 6e2eb725888..203179d4c91 100644 --- a/src/plugins/qt4projectmanager/wizards/librarywizard.h +++ b/src/plugins/qt4projectmanager/wizards/librarywizard.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp index 6b435b5e415..814164457e2 100644 --- a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp +++ b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.h b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.h index 8472df61fe8..30f55bc84f3 100644 --- a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.h +++ b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/modulespage.cpp b/src/plugins/qt4projectmanager/wizards/modulespage.cpp index fb362732d55..7ba0980c2d9 100644 --- a/src/plugins/qt4projectmanager/wizards/modulespage.cpp +++ b/src/plugins/qt4projectmanager/wizards/modulespage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/modulespage.h b/src/plugins/qt4projectmanager/wizards/modulespage.h index fdb63202f8d..d8cb661735c 100644 --- a/src/plugins/qt4projectmanager/wizards/modulespage.h +++ b/src/plugins/qt4projectmanager/wizards/modulespage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/qtprojectparameters.cpp b/src/plugins/qt4projectmanager/wizards/qtprojectparameters.cpp index cab7b56b46a..910b0e5d07d 100644 --- a/src/plugins/qt4projectmanager/wizards/qtprojectparameters.cpp +++ b/src/plugins/qt4projectmanager/wizards/qtprojectparameters.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/qtprojectparameters.h b/src/plugins/qt4projectmanager/wizards/qtprojectparameters.h index e8146557f21..854045bd6ed 100644 --- a/src/plugins/qt4projectmanager/wizards/qtprojectparameters.h +++ b/src/plugins/qt4projectmanager/wizards/qtprojectparameters.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/qtwizard.cpp b/src/plugins/qt4projectmanager/wizards/qtwizard.cpp index 831e0e908dd..15f334cf202 100644 --- a/src/plugins/qt4projectmanager/wizards/qtwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/qtwizard.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qt4projectmanager/wizards/qtwizard.h b/src/plugins/qt4projectmanager/wizards/qtwizard.h index 1b4f1a6074a..9858251a9df 100644 --- a/src/plugins/qt4projectmanager/wizards/qtwizard.h +++ b/src/plugins/qt4projectmanager/wizards/qtwizard.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qtestlib/qtestlibplugin.cpp b/src/plugins/qtestlib/qtestlibplugin.cpp index a1889ef20d7..5b38e05b33a 100644 --- a/src/plugins/qtestlib/qtestlibplugin.cpp +++ b/src/plugins/qtestlib/qtestlibplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qtestlib/qtestlibplugin.h b/src/plugins/qtestlib/qtestlibplugin.h index d2f3ad850df..2c804a16c3a 100644 --- a/src/plugins/qtestlib/qtestlibplugin.h +++ b/src/plugins/qtestlib/qtestlibplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qtscripteditor/qtscripteditor.cpp b/src/plugins/qtscripteditor/qtscripteditor.cpp index 39ba4f0d942..4062b69e507 100644 --- a/src/plugins/qtscripteditor/qtscripteditor.cpp +++ b/src/plugins/qtscripteditor/qtscripteditor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -39,7 +39,7 @@ #include #include -#include +#include #include #include #include @@ -157,7 +157,7 @@ void ScriptEditor::contextMenuEvent(QContextMenuEvent *e) { QMenu *menu = createStandardContextMenu(); - if (Core::IActionContainer *mcontext = m_core->actionManager()->actionContainer(QtScriptEditor::Constants::M_CONTEXT)) { + if (Core::ActionContainer *mcontext = m_core->actionManager()->actionContainer(QtScriptEditor::Constants::M_CONTEXT)) { QMenu *contextMenu = mcontext->menu(); foreach (QAction *action, contextMenu->actions()) menu->addAction(action); diff --git a/src/plugins/qtscripteditor/qtscripteditor.h b/src/plugins/qtscripteditor/qtscripteditor.h index 73e34fc527d..1dda5a95e92 100644 --- a/src/plugins/qtscripteditor/qtscripteditor.h +++ b/src/plugins/qtscripteditor/qtscripteditor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qtscripteditor/qtscripteditoractionhandler.cpp b/src/plugins/qtscripteditor/qtscripteditoractionhandler.cpp index f51d8a8329e..bb306f1a3f2 100644 --- a/src/plugins/qtscripteditor/qtscripteditoractionhandler.cpp +++ b/src/plugins/qtscripteditor/qtscripteditoractionhandler.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -35,8 +35,8 @@ #include "qtscripteditorconstants.h" #include "qtscripteditor.h" -#include -#include +#include +#include #include #include @@ -45,7 +45,7 @@ static QAction *actionFromId(Core::ICore *core, const QString &id) { - Core::ICommand *cmd = core->actionManager()->command(id); + Core::Command *cmd = core->actionManager()->command(id); if (!cmd) return 0; return cmd->action(); @@ -79,7 +79,7 @@ void QtScriptEditorActionHandler::updateActions(UpdateMode um) void QtScriptEditorActionHandler::run() { - typedef Core::ScriptManagerInterface::Stack Stack; + typedef Core::ScriptManager::Stack Stack; if (!currentEditor()) return; diff --git a/src/plugins/qtscripteditor/qtscripteditoractionhandler.h b/src/plugins/qtscripteditor/qtscripteditoractionhandler.h index 3e21889bdff..d18ee2d25ff 100644 --- a/src/plugins/qtscripteditor/qtscripteditoractionhandler.h +++ b/src/plugins/qtscripteditor/qtscripteditoractionhandler.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qtscripteditor/qtscripteditorconstants.h b/src/plugins/qtscripteditor/qtscripteditorconstants.h index da6b6948641..0e2e52c3661 100644 --- a/src/plugins/qtscripteditor/qtscripteditorconstants.h +++ b/src/plugins/qtscripteditor/qtscripteditorconstants.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qtscripteditor/qtscripteditorfactory.cpp b/src/plugins/qtscripteditor/qtscripteditorfactory.cpp index e63c9d16c44..392b627363a 100644 --- a/src/plugins/qtscripteditor/qtscripteditorfactory.cpp +++ b/src/plugins/qtscripteditor/qtscripteditorfactory.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qtscripteditor/qtscripteditorfactory.h b/src/plugins/qtscripteditor/qtscripteditorfactory.h index b2bfee27e20..f97cdab1eed 100644 --- a/src/plugins/qtscripteditor/qtscripteditorfactory.h +++ b/src/plugins/qtscripteditor/qtscripteditorfactory.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qtscripteditor/qtscripteditorplugin.cpp b/src/plugins/qtscripteditor/qtscripteditorplugin.cpp index d03692b9d6d..1bf230155b6 100644 --- a/src/plugins/qtscripteditor/qtscripteditorplugin.cpp +++ b/src/plugins/qtscripteditor/qtscripteditorplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include @@ -131,12 +131,12 @@ void QtScriptEditorPlugin::initializeEditor(QtScriptEditor::Internal::ScriptEdit void QtScriptEditorPlugin::registerActions(Core::ICore *core) { - Core::ActionManagerInterface *am = core->actionManager(); - Core::IActionContainer *mcontext = am->createMenu(QtScriptEditor::Constants::M_CONTEXT); + Core::ActionManager *am = core->actionManager(); + Core::ActionContainer *mcontext = am->createMenu(QtScriptEditor::Constants::M_CONTEXT); QAction *action = new QAction(this); action->setSeparator(true); - Core::ICommand *cmd = am->registerAction(action, QtScriptEditor::Constants::RUN_SEP, m_scriptcontext); + Core::Command *cmd = am->registerAction(action, QtScriptEditor::Constants::RUN_SEP, m_scriptcontext); mcontext->addAction(cmd, Core::Constants::G_DEFAULT_THREE); action = new QAction(tr("Run"), this); diff --git a/src/plugins/qtscripteditor/qtscripteditorplugin.h b/src/plugins/qtscripteditor/qtscripteditorplugin.h index d1ab725b645..5bd1d5ba17e 100644 --- a/src/plugins/qtscripteditor/qtscripteditorplugin.h +++ b/src/plugins/qtscripteditor/qtscripteditorplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qtscripteditor/qtscripthighlighter.cpp b/src/plugins/qtscripteditor/qtscripthighlighter.cpp index 66bb3c88fac..3c1a640cf3c 100644 --- a/src/plugins/qtscripteditor/qtscripthighlighter.cpp +++ b/src/plugins/qtscripteditor/qtscripthighlighter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/qtscripteditor/qtscripthighlighter.h b/src/plugins/qtscripteditor/qtscripthighlighter.h index e1b60194860..586671c2a7e 100644 --- a/src/plugins/qtscripteditor/qtscripthighlighter.h +++ b/src/plugins/qtscripteditor/qtscripthighlighter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/quickopen/basefilefilter.cpp b/src/plugins/quickopen/basefilefilter.cpp index 1909f4af031..65aea6d2552 100644 --- a/src/plugins/quickopen/basefilefilter.cpp +++ b/src/plugins/quickopen/basefilefilter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/quickopen/basefilefilter.h b/src/plugins/quickopen/basefilefilter.h index 883fc078e1f..ee9d302be5c 100644 --- a/src/plugins/quickopen/basefilefilter.h +++ b/src/plugins/quickopen/basefilefilter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/quickopen/directoryfilter.cpp b/src/plugins/quickopen/directoryfilter.cpp index 2948d990df1..84c60dfa8c7 100644 --- a/src/plugins/quickopen/directoryfilter.cpp +++ b/src/plugins/quickopen/directoryfilter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/quickopen/directoryfilter.h b/src/plugins/quickopen/directoryfilter.h index 7df79ae700b..abe167d61d3 100644 --- a/src/plugins/quickopen/directoryfilter.h +++ b/src/plugins/quickopen/directoryfilter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/quickopen/directoryparser.cpp b/src/plugins/quickopen/directoryparser.cpp index dbafa92f63a..bca0cdbed75 100644 --- a/src/plugins/quickopen/directoryparser.cpp +++ b/src/plugins/quickopen/directoryparser.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/quickopen/directoryparser.h b/src/plugins/quickopen/directoryparser.h index 4a566e041dd..1765a3b4e82 100644 --- a/src/plugins/quickopen/directoryparser.h +++ b/src/plugins/quickopen/directoryparser.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/quickopen/filesystemfilter.cpp b/src/plugins/quickopen/filesystemfilter.cpp index 77c66cd0d78..f30f65aaa30 100644 --- a/src/plugins/quickopen/filesystemfilter.cpp +++ b/src/plugins/quickopen/filesystemfilter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/quickopen/filesystemfilter.h b/src/plugins/quickopen/filesystemfilter.h index fbf8c57ed67..c935b9fb2c3 100644 --- a/src/plugins/quickopen/filesystemfilter.h +++ b/src/plugins/quickopen/filesystemfilter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/quickopen/iquickopenfilter.cpp b/src/plugins/quickopen/iquickopenfilter.cpp index adca7a71a40..5cca4fa7d92 100644 --- a/src/plugins/quickopen/iquickopenfilter.cpp +++ b/src/plugins/quickopen/iquickopenfilter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/quickopen/iquickopenfilter.h b/src/plugins/quickopen/iquickopenfilter.h index b06e2bb9768..fa5664d18fe 100644 --- a/src/plugins/quickopen/iquickopenfilter.h +++ b/src/plugins/quickopen/iquickopenfilter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/quickopen/opendocumentsfilter.cpp b/src/plugins/quickopen/opendocumentsfilter.cpp index d8039de8744..7b09fdcede9 100644 --- a/src/plugins/quickopen/opendocumentsfilter.cpp +++ b/src/plugins/quickopen/opendocumentsfilter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/quickopen/opendocumentsfilter.h b/src/plugins/quickopen/opendocumentsfilter.h index 4462810ff25..2f2d6b2ff94 100644 --- a/src/plugins/quickopen/opendocumentsfilter.h +++ b/src/plugins/quickopen/opendocumentsfilter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/quickopen/quickopen_global.h b/src/plugins/quickopen/quickopen_global.h index d887df38299..3c77f68a76d 100644 --- a/src/plugins/quickopen/quickopen_global.h +++ b/src/plugins/quickopen/quickopen_global.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/quickopen/quickopenconstants.h b/src/plugins/quickopen/quickopenconstants.h index 9a0d2be319a..8b89503df4b 100644 --- a/src/plugins/quickopen/quickopenconstants.h +++ b/src/plugins/quickopen/quickopenconstants.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/quickopen/quickopenfiltersfilter.cpp b/src/plugins/quickopen/quickopenfiltersfilter.cpp index 6bff7a73ed9..05554dea8d0 100644 --- a/src/plugins/quickopen/quickopenfiltersfilter.cpp +++ b/src/plugins/quickopen/quickopenfiltersfilter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -71,7 +71,7 @@ QList QuickOpenFiltersFilter::matchesFor(const QString &entry) { QList entries; if (entry.isEmpty()) { - foreach (IQuickOpenFilter *filter, m_plugin->filter()) { + foreach (IQuickOpenFilter *filter, m_plugin->filters()) { if (!filter->shortcutString().isEmpty() && !filter->isHidden()) { FilterEntry entry(this, filter->shortcutString(), diff --git a/src/plugins/quickopen/quickopenfiltersfilter.h b/src/plugins/quickopen/quickopenfiltersfilter.h index 3c68d815c24..d4ef1520d98 100644 --- a/src/plugins/quickopen/quickopenfiltersfilter.h +++ b/src/plugins/quickopen/quickopenfiltersfilter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/quickopen/quickopenmanager.cpp b/src/plugins/quickopen/quickopenmanager.cpp index b6e5cb9ccb1..c8175b8f160 100644 --- a/src/plugins/quickopen/quickopenmanager.cpp +++ b/src/plugins/quickopen/quickopenmanager.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/quickopen/quickopenmanager.h b/src/plugins/quickopen/quickopenmanager.h index 52277d0e545..e9f9a5ed3ae 100644 --- a/src/plugins/quickopen/quickopenmanager.h +++ b/src/plugins/quickopen/quickopenmanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/quickopen/quickopenplugin.cpp b/src/plugins/quickopen/quickopenplugin.cpp index d38502815de..fe599b215a0 100644 --- a/src/plugins/quickopen/quickopenplugin.cpp +++ b/src/plugins/quickopen/quickopenplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include #include @@ -76,8 +76,7 @@ QuickOpenPlugin::~QuickOpenPlugin() delete m_openDocumentsFilter; delete m_fileSystemFilter; delete m_settingsPage; - foreach (IQuickOpenFilter *filter, m_customFilter) - delete filter; + qDeleteAll(m_customFilters); } bool QuickOpenPlugin::initialize(const QStringList &, QString *) @@ -97,11 +96,11 @@ bool QuickOpenPlugin::initialize(const QStringList &, QString *) const QString actionId = QLatin1String("QtCreator.View.QuickOpen.ToolWindow"); QAction *action = new QAction(m_quickOpenToolWindow->windowIcon(), m_quickOpenToolWindow->windowTitle(), this); - Core::ICommand *cmd = core->actionManager()->registerAction(action, actionId, QList() << Core::Constants::C_GLOBAL_ID); + Core::Command *cmd = core->actionManager()->registerAction(action, actionId, QList() << Core::Constants::C_GLOBAL_ID); cmd->setDefaultKeySequence(QKeySequence("Ctrl+K")); connect(action, SIGNAL(triggered()), this, SLOT(openQuickOpen())); - Core::IActionContainer *mtools = core->actionManager()->actionContainer(Core::Constants::M_TOOLS); + Core::ActionContainer *mtools = core->actionManager()->actionContainer(Core::Constants::M_TOOLS); mtools->addAction(cmd); addObject(new QuickOpenManager(m_quickOpenToolWindow)); @@ -125,8 +124,8 @@ void QuickOpenPlugin::openQuickOpen() void QuickOpenPlugin::extensionsInitialized() { - m_filter = ExtensionSystem::PluginManager::instance()->getObjects(); - qSort(m_filter.begin(), m_filter.end(), filterLessThan); + m_filters = ExtensionSystem::PluginManager::instance()->getObjects(); + qSort(m_filters.begin(), m_filters.end(), filterLessThan); } void QuickOpenPlugin::startSettingsLoad() @@ -141,7 +140,7 @@ void QuickOpenPlugin::loadSettings() QSettings settings; settings.beginGroup("QuickOpen"); m_refreshTimer.setInterval(settings.value("RefreshInterval", 60).toInt()*60000); - foreach (IQuickOpenFilter *filter, m_filter) { + foreach (IQuickOpenFilter *filter, m_filters) { if (settings.contains(filter->name())) { const QByteArray state = settings.value(filter->name()).toByteArray(); if (!state.isEmpty()) @@ -153,10 +152,10 @@ void QuickOpenPlugin::loadSettings() foreach (const QString &key, settings.childKeys()) { IQuickOpenFilter *filter = new DirectoryFilter(core); filter->restoreState(settings.value(key).toByteArray()); - m_filter.append(filter); + m_filters.append(filter); customFilters.append(filter); } - setCustomFilter(customFilters); + setCustomFilters(customFilters); settings.endGroup(); settings.endGroup(); } @@ -176,14 +175,14 @@ void QuickOpenPlugin::saveSettings() s->beginGroup("QuickOpen"); s->setValue("Interval", m_refreshTimer.interval()/60000); s->remove(""); - foreach (IQuickOpenFilter *filter, m_filter) { - if (!m_customFilter.contains(filter)) { + foreach (IQuickOpenFilter *filter, m_filters) { + if (!m_customFilters.contains(filter)) { s->setValue(filter->name(), filter->saveState()); } } s->beginGroup("CustomFilters"); int i = 0; - foreach (IQuickOpenFilter *filter, m_customFilter) { + foreach (IQuickOpenFilter *filter, m_customFilters) { s->setValue(QString("directory%1").arg(i), filter->saveState()); ++i; } @@ -197,9 +196,9 @@ void QuickOpenPlugin::saveSettings() Return all filters, including the ones created by the user. */ -QList QuickOpenPlugin::filter() +QList QuickOpenPlugin::filters() { - return m_filter; + return m_filters; } /*! @@ -208,20 +207,20 @@ QList QuickOpenPlugin::filter() This returns a subset of all the filters, that contains only the filters that have been created by the user at some point (maybe in a previous session). */ -QList QuickOpenPlugin::customFilter() +QList QuickOpenPlugin::customFilters() { - return m_customFilter; + return m_customFilters; } -void QuickOpenPlugin::setFilter(QList f) +void QuickOpenPlugin::setFilters(QList f) { - m_filter = f; + m_filters = f; m_quickOpenToolWindow->updateFilterList(); } -void QuickOpenPlugin::setCustomFilter(QList filter) +void QuickOpenPlugin::setCustomFilters(QList filters) { - m_customFilter = filter; + m_customFilters = filters; } int QuickOpenPlugin::refreshInterval() @@ -243,10 +242,10 @@ void QuickOpenPlugin::setRefreshInterval(int interval) void QuickOpenPlugin::refresh(QList filters) { if (filters.isEmpty()) - filters = m_filter; + filters = m_filters; QFuture task = QtConcurrent::run(&IQuickOpenFilter::refresh, filters); Core::FutureProgress *progress = ExtensionSystem::PluginManager::instance()->getObject() - ->progressManager()->addTask(task, tr("Indexing"), Constants::TASK_INDEX, Core::ProgressManagerInterface::CloseOnSuccess); + ->progressManager()->addTask(task, tr("Indexing"), Constants::TASK_INDEX, Core::ProgressManager::CloseOnSuccess); connect(progress, SIGNAL(finished()), this, SLOT(saveSettings())); } diff --git a/src/plugins/quickopen/quickopenplugin.h b/src/plugins/quickopen/quickopenplugin.h index e87e8b313d6..fdbcb03434b 100644 --- a/src/plugins/quickopen/quickopenplugin.h +++ b/src/plugins/quickopen/quickopenplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -61,10 +61,10 @@ public: bool initialize(const QStringList &arguments, QString *error_message); void extensionsInitialized(); - QList filter(); - QList customFilter(); - void setFilter(QList f); - void setCustomFilter(QList f); + QList filters(); + QList customFilters(); + void setFilters(QList f); + void setCustomFilters(QList f); int refreshInterval(); void setRefreshInterval(int interval); @@ -83,8 +83,8 @@ private: QuickOpenToolWindow *m_quickOpenToolWindow; SettingsPage *m_settingsPage; - QList m_filter; - QList m_customFilter; + QList m_filters; + QList m_customFilters; int m_refreshInterval; QTimer m_refreshTimer; OpenDocumentsFilter *m_openDocumentsFilter; diff --git a/src/plugins/quickopen/quickopentoolwindow.cpp b/src/plugins/quickopen/quickopentoolwindow.cpp index c3f390f54b7..40cbeb7edcf 100644 --- a/src/plugins/quickopen/quickopentoolwindow.cpp +++ b/src/plugins/quickopen/quickopentoolwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -313,7 +313,7 @@ bool QuickOpenToolWindow::isShowingTypeHereMessage() const void QuickOpenToolWindow::updateFilterList() { m_filterMenu->clear(); - foreach (IQuickOpenFilter *filter, m_quickOpenPlugin->filter()) { + foreach (IQuickOpenFilter *filter, m_quickOpenPlugin->filters()) { if (!filter->shortcutString().isEmpty() && !filter->isHidden()) { QAction *action = m_filterMenu->addAction(filter->trName(), this, SLOT(filterSelected())); action->setData(qVariantFromValue(filter)); @@ -379,7 +379,7 @@ void QuickOpenToolWindow::textEdited(const QString &text) QList QuickOpenToolWindow::filtersFor(const QString &text, QString &searchText) { - QList filters = m_quickOpenPlugin->filter(); + QList filters = m_quickOpenPlugin->filters(); int whiteSpace = text.indexOf(" "); QString prefix; if (whiteSpace >= 0) @@ -460,7 +460,7 @@ void QuickOpenToolWindow::filterSelected() // add shortcut string at front or replace existing shortcut string if (!currentText.isEmpty()) { searchText = currentText; - foreach (IQuickOpenFilter *otherfilter, m_quickOpenPlugin->filter()) { + foreach (IQuickOpenFilter *otherfilter, m_quickOpenPlugin->filters()) { if (currentText.startsWith(otherfilter->shortcutString() + " ")) { searchText = currentText.mid(otherfilter->shortcutString().length()+1); break; diff --git a/src/plugins/quickopen/quickopentoolwindow.h b/src/plugins/quickopen/quickopentoolwindow.h index 896c1ab1edd..ddc753d67f6 100644 --- a/src/plugins/quickopen/quickopentoolwindow.h +++ b/src/plugins/quickopen/quickopentoolwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/quickopen/settingspage.cpp b/src/plugins/quickopen/settingspage.cpp index c5ab95477b8..17415916342 100644 --- a/src/plugins/quickopen/settingspage.cpp +++ b/src/plugins/quickopen/settingspage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -67,30 +67,41 @@ QWidget *SettingsPage::createPage(QWidget *parent) this, SLOT(removeCustomFilter())); } m_ui.refreshInterval->setValue(m_plugin->refreshInterval()); - m_filters = m_plugin->filter(); - m_customFilters = m_plugin->customFilter(); + m_filters = m_plugin->filters(); + m_customFilters = m_plugin->customFilters(); saveFilterStates(); updateFilterList(); return m_page; } -void SettingsPage::finished(bool accepted) +void SettingsPage::apply() { - if (!accepted) { - restoreFilterStates(); - foreach (IQuickOpenFilter *filter, m_addedFilters) - delete filter; - } else { - foreach (IQuickOpenFilter *filter, m_removedFilters) - delete filter; - m_plugin->setFilter(m_filters); - m_plugin->setCustomFilter(m_customFilters); - m_plugin->setRefreshInterval(m_ui.refreshInterval->value()); - requestRefresh(); - m_plugin->saveSettings(); - } + // Delete removed filters and clear added filters + qDeleteAll(m_removedFilters); + m_removedFilters.clear(); + m_addedFilters.clear(); + + // Pass the new configuration on to the plugin + m_plugin->setFilters(m_filters); + m_plugin->setCustomFilters(m_customFilters); + m_plugin->setRefreshInterval(m_ui.refreshInterval->value()); + requestRefresh(); + m_plugin->saveSettings(); + saveFilterStates(); +} + +void SettingsPage::finish() +{ + // If settings were applied, this shouldn't change anything. Otherwise it + // makes sure the filter states aren't changed permanently. + restoreFilterStates(); + + // Delete added filters and clear removed filters + qDeleteAll(m_addedFilters); m_addedFilters.clear(); m_removedFilters.clear(); + + // Further cleanup m_filters.clear(); m_customFilters.clear(); m_refreshFilters.clear(); diff --git a/src/plugins/quickopen/settingspage.h b/src/plugins/quickopen/settingspage.h index 755763b2f67..e169bca6a0b 100644 --- a/src/plugins/quickopen/settingspage.h +++ b/src/plugins/quickopen/settingspage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -66,7 +66,8 @@ public: QString trCategory() const { return tr(Constants::QUICKOPEN_CATEGORY); } QWidget *createPage(QWidget *parent); - void finished(bool accepted); + void apply(); + void finish(); private slots: void updateButtonStates(); diff --git a/src/plugins/regexp/regexpplugin.cpp b/src/plugins/regexp/regexpplugin.cpp index 42070682f9a..86a4ca0a7ca 100644 --- a/src/plugins/regexp/regexpplugin.cpp +++ b/src/plugins/regexp/regexpplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/regexp/regexpplugin.h b/src/plugins/regexp/regexpplugin.h index b4d8db227c3..c944d37bc17 100644 --- a/src/plugins/regexp/regexpplugin.h +++ b/src/plugins/regexp/regexpplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/regexp/regexpwindow.cpp b/src/plugins/regexp/regexpwindow.cpp index 418faaf4f23..060d11aee54 100644 --- a/src/plugins/regexp/regexpwindow.cpp +++ b/src/plugins/regexp/regexpwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/regexp/regexpwindow.h b/src/plugins/regexp/regexpwindow.h index f6c87d587bf..b4216c66f0b 100644 --- a/src/plugins/regexp/regexpwindow.h +++ b/src/plugins/regexp/regexpwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/regexp/settings.cpp b/src/plugins/regexp/settings.cpp index b2d9a6ceaf0..e42082d4c1e 100644 --- a/src/plugins/regexp/settings.cpp +++ b/src/plugins/regexp/settings.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/regexp/settings.h b/src/plugins/regexp/settings.h index 80d124db548..c853732350e 100644 --- a/src/plugins/regexp/settings.h +++ b/src/plugins/regexp/settings.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/resourceeditor/resourceeditorconstants.h b/src/plugins/resourceeditor/resourceeditorconstants.h index df5d97c7569..007d537c36e 100644 --- a/src/plugins/resourceeditor/resourceeditorconstants.h +++ b/src/plugins/resourceeditor/resourceeditorconstants.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/resourceeditor/resourceeditorfactory.cpp b/src/plugins/resourceeditor/resourceeditorfactory.cpp index 64c1dc9cfc7..4a623c77f4a 100644 --- a/src/plugins/resourceeditor/resourceeditorfactory.cpp +++ b/src/plugins/resourceeditor/resourceeditorfactory.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/resourceeditor/resourceeditorfactory.h b/src/plugins/resourceeditor/resourceeditorfactory.h index 8d6ffa9df6d..0bcafd3ca56 100644 --- a/src/plugins/resourceeditor/resourceeditorfactory.h +++ b/src/plugins/resourceeditor/resourceeditorfactory.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/resourceeditor/resourceeditorplugin.cpp b/src/plugins/resourceeditor/resourceeditorplugin.cpp index 2d8c3370bf0..851cf8634c1 100644 --- a/src/plugins/resourceeditor/resourceeditorplugin.cpp +++ b/src/plugins/resourceeditor/resourceeditorplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include @@ -88,7 +88,7 @@ bool ResourceEditorPlugin::initialize(const QStringList & /*arguments*/, QString error_message->clear(); // Register undo and redo - Core::ActionManagerInterface * const actionManager = m_core->actionManager(); + Core::ActionManager * const actionManager = m_core->actionManager(); int const pluginId = m_core->uniqueIDManager()->uniqueIdentifier( Constants::C_RESOURCEEDITOR); QList const idList = QList() << pluginId; diff --git a/src/plugins/resourceeditor/resourceeditorplugin.h b/src/plugins/resourceeditor/resourceeditorplugin.h index d646be712a8..fd9576ea00d 100644 --- a/src/plugins/resourceeditor/resourceeditorplugin.h +++ b/src/plugins/resourceeditor/resourceeditorplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/resourceeditor/resourceeditorw.cpp b/src/plugins/resourceeditor/resourceeditorw.cpp index 652470cb870..db4ed089805 100644 --- a/src/plugins/resourceeditor/resourceeditorw.cpp +++ b/src/plugins/resourceeditor/resourceeditorw.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/resourceeditor/resourceeditorw.h b/src/plugins/resourceeditor/resourceeditorw.h index 4aff0ae9898..4070e155cd6 100644 --- a/src/plugins/resourceeditor/resourceeditorw.h +++ b/src/plugins/resourceeditor/resourceeditorw.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/resourceeditor/resourcewizard.cpp b/src/plugins/resourceeditor/resourcewizard.cpp index 72e801b1ef0..b2e76ed154a 100644 --- a/src/plugins/resourceeditor/resourcewizard.cpp +++ b/src/plugins/resourceeditor/resourcewizard.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/resourceeditor/resourcewizard.h b/src/plugins/resourceeditor/resourcewizard.h index 0ddc677f2a1..e435755b2fc 100644 --- a/src/plugins/resourceeditor/resourcewizard.h +++ b/src/plugins/resourceeditor/resourcewizard.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/snippets/inputwidget.cpp b/src/plugins/snippets/inputwidget.cpp index 27b89154e53..6ec1438298c 100644 --- a/src/plugins/snippets/inputwidget.cpp +++ b/src/plugins/snippets/inputwidget.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/snippets/inputwidget.h b/src/plugins/snippets/inputwidget.h index de8b1640594..bd1afcb2d22 100644 --- a/src/plugins/snippets/inputwidget.h +++ b/src/plugins/snippets/inputwidget.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/snippets/snippetscompletion.cpp b/src/plugins/snippets/snippetscompletion.cpp index 47a8fecc5dc..129d27d63cc 100644 --- a/src/plugins/snippets/snippetscompletion.cpp +++ b/src/plugins/snippets/snippetscompletion.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/snippets/snippetscompletion.h b/src/plugins/snippets/snippetscompletion.h index 4fb83a48819..5749bd0cbe9 100644 --- a/src/plugins/snippets/snippetscompletion.h +++ b/src/plugins/snippets/snippetscompletion.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/snippets/snippetspec.cpp b/src/plugins/snippets/snippetspec.cpp index ca108d499ac..1c9937cb184 100644 --- a/src/plugins/snippets/snippetspec.cpp +++ b/src/plugins/snippets/snippetspec.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/snippets/snippetspec.h b/src/plugins/snippets/snippetspec.h index f97ae89a7c1..072a9e68e47 100644 --- a/src/plugins/snippets/snippetspec.h +++ b/src/plugins/snippets/snippetspec.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/snippets/snippetsplugin.cpp b/src/plugins/snippets/snippetsplugin.cpp index d46e773b732..c014a6432a1 100644 --- a/src/plugins/snippets/snippetsplugin.cpp +++ b/src/plugins/snippets/snippetsplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -72,7 +72,7 @@ void SnippetsPlugin::extensionsInitialized() bool SnippetsPlugin::initialize(const QStringList & /*arguments*/, QString *) { m_core = ExtensionSystem::PluginManager::instance()->getObject(); - Core::ActionManagerInterface *am = m_core->actionManager(); + Core::ActionManager *am = m_core->actionManager(); QList context; context << m_core->uniqueIDManager()->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR); diff --git a/src/plugins/snippets/snippetsplugin.h b/src/plugins/snippets/snippetsplugin.h index 9c4e03463f7..3647244d659 100644 --- a/src/plugins/snippets/snippetsplugin.h +++ b/src/plugins/snippets/snippetsplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/snippets/snippetswindow.cpp b/src/plugins/snippets/snippetswindow.cpp index 6a0f3a0a7dc..f6377e199af 100644 --- a/src/plugins/snippets/snippetswindow.cpp +++ b/src/plugins/snippets/snippetswindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/snippets/snippetswindow.h b/src/plugins/snippets/snippetswindow.h index 8c271a14db4..f0c4e032751 100644 --- a/src/plugins/snippets/snippetswindow.h +++ b/src/plugins/snippets/snippetswindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/subversion/annotationhighlighter.cpp b/src/plugins/subversion/annotationhighlighter.cpp index 919bb317abd..8a77b81af66 100644 --- a/src/plugins/subversion/annotationhighlighter.cpp +++ b/src/plugins/subversion/annotationhighlighter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/subversion/annotationhighlighter.h b/src/plugins/subversion/annotationhighlighter.h index db9f6583950..e2c0b418aa8 100644 --- a/src/plugins/subversion/annotationhighlighter.h +++ b/src/plugins/subversion/annotationhighlighter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/subversion/changenumberdialog.cpp b/src/plugins/subversion/changenumberdialog.cpp index 42a00c8059e..dad23a7490c 100644 --- a/src/plugins/subversion/changenumberdialog.cpp +++ b/src/plugins/subversion/changenumberdialog.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/subversion/changenumberdialog.h b/src/plugins/subversion/changenumberdialog.h index 9b857302c11..933860e45c2 100644 --- a/src/plugins/subversion/changenumberdialog.h +++ b/src/plugins/subversion/changenumberdialog.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/subversion/settingspage.cpp b/src/plugins/subversion/settingspage.cpp index e8c300c6006..fb2842602e2 100644 --- a/src/plugins/subversion/settingspage.cpp +++ b/src/plugins/subversion/settingspage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -100,9 +100,9 @@ QWidget *SettingsPage::createPage(QWidget *parent) return m_widget; } -void SettingsPage::finished(bool accepted) +void SettingsPage::apply() { - if (!accepted || !m_widget) + if (!m_widget) return; SubversionPlugin::subversionPluginInstance()->setSettings(m_widget->settings()); } diff --git a/src/plugins/subversion/settingspage.h b/src/plugins/subversion/settingspage.h index 973a2824e07..777d0901ef2 100644 --- a/src/plugins/subversion/settingspage.h +++ b/src/plugins/subversion/settingspage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -76,7 +76,8 @@ public: QString trCategory() const; QWidget *createPage(QWidget *parent); - void finished(bool accepted); + void apply(); + void finish() { } private: QPointer m_widget; diff --git a/src/plugins/subversion/subversionconstants.h b/src/plugins/subversion/subversionconstants.h index 1d385e560d6..bd06b2b0bd8 100644 --- a/src/plugins/subversion/subversionconstants.h +++ b/src/plugins/subversion/subversionconstants.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/subversion/subversioncontrol.cpp b/src/plugins/subversion/subversioncontrol.cpp index a600f841f37..d319dd29155 100644 --- a/src/plugins/subversion/subversioncontrol.cpp +++ b/src/plugins/subversion/subversioncontrol.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/subversion/subversioncontrol.h b/src/plugins/subversion/subversioncontrol.h index bcccef45487..489fb1bfda5 100644 --- a/src/plugins/subversion/subversioncontrol.h +++ b/src/plugins/subversion/subversioncontrol.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/subversion/subversioneditor.cpp b/src/plugins/subversion/subversioneditor.cpp index 44950872c22..375e0332411 100644 --- a/src/plugins/subversion/subversioneditor.cpp +++ b/src/plugins/subversion/subversioneditor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/subversion/subversioneditor.h b/src/plugins/subversion/subversioneditor.h index 518c8e1b730..6966005de4a 100644 --- a/src/plugins/subversion/subversioneditor.h +++ b/src/plugins/subversion/subversioneditor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/subversion/subversionoutputwindow.cpp b/src/plugins/subversion/subversionoutputwindow.cpp index f8f4740b542..e4be5a89bc2 100644 --- a/src/plugins/subversion/subversionoutputwindow.cpp +++ b/src/plugins/subversion/subversionoutputwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/subversion/subversionoutputwindow.h b/src/plugins/subversion/subversionoutputwindow.h index 130c26a781d..52a278d4cb0 100644 --- a/src/plugins/subversion/subversionoutputwindow.h +++ b/src/plugins/subversion/subversionoutputwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index 5f5200aab34..a98848a8b37 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -53,7 +53,7 @@ #include #include #include -#include +#include #include #include #include @@ -139,6 +139,29 @@ inline Core::IEditor* locateEditor(const Core::ICore *core, const char *property return 0; } +// Parse "svn status" output for added/modified/deleted files +// "M<7blanks>file" +typedef QList StatusList; + +StatusList parseStatusOutput(const QString &output) +{ + StatusList changeSet; + const QString newLine = QString(QLatin1Char('\n')); + const QStringList list = output.split(newLine, QString::SkipEmptyParts); + foreach (const QString &l, list) { + const QString line =l.trimmed(); + if (line.size() > 8) { + const QChar state = line.at(0); + if (state == QLatin1Char('A') || state == QLatin1Char('D') || state == QLatin1Char('M')) { + const QString fileName = line.mid(7); + changeSet.push_back(SubversionSubmitEditor::StatusFilePair(QString(state), fileName)); + } + + } + } + return changeSet; +} + // ------------- SubversionPlugin Core::ICore *SubversionPlugin::m_coreInstance = 0; SubversionPlugin *SubversionPlugin::m_subversionPluginInstance = 0; @@ -222,11 +245,7 @@ void SubversionPlugin::cleanChangeTmpFile() static const VCSBase::VCSBaseSubmitEditorParameters submitParameters = { Subversion::Constants::SUBVERSION_SUBMIT_MIMETYPE, Subversion::Constants::SUBVERSIONCOMMITEDITOR_KIND, - Subversion::Constants::SUBVERSIONCOMMITEDITOR, - Core::Constants::UNDO, - Core::Constants::REDO, - Subversion::Constants::SUBMIT_CURRENT, - Subversion::Constants::DIFF_SELECTED + Subversion::Constants::SUBVERSIONCOMMITEDITOR }; bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *errorMessage) @@ -270,10 +289,10 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *er addObject(m_subversionOutputWindow); //register actions - Core::ActionManagerInterface *ami = m_coreInstance->actionManager(); - Core::IActionContainer *toolsContainer = ami->actionContainer(M_TOOLS); + Core::ActionManager *ami = m_coreInstance->actionManager(); + Core::ActionContainer *toolsContainer = ami->actionContainer(M_TOOLS); - Core::IActionContainer *subversionMenu = + Core::ActionContainer *subversionMenu = ami->createMenu(QLatin1String(SUBVERSION_MENU)); subversionMenu->menu()->setTitle(tr("&Subversion")); toolsContainer->addMenu(subversionMenu); @@ -285,11 +304,11 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *er QList globalcontext; globalcontext << m_coreInstance->uniqueIDManager()->uniqueIdentifier(C_GLOBAL); - Core::ICommand *command; + Core::Command *command; m_addAction = new QAction(tr("Add"), this); command = ami->registerAction(m_addAction, SubversionPlugin::ADD, globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+A"))); connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile())); subversionMenu->addAction(command); @@ -297,14 +316,14 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *er m_deleteAction = new QAction(tr("Delete"), this); command = ami->registerAction(m_deleteAction, SubversionPlugin::DELETE_FILE, globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(deleteCurrentFile())); subversionMenu->addAction(command); m_revertAction = new QAction(tr("Revert"), this); command = ami->registerAction(m_revertAction, SubversionPlugin::REVERT, globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertCurrentFile())); subversionMenu->addAction(command); @@ -322,7 +341,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *er m_diffCurrentAction = new QAction(tr("Diff Current File"), this); command = ami->registerAction(m_diffCurrentAction, SubversionPlugin::DIFF_CURRENT, globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+D"))); connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile())); subversionMenu->addAction(command); @@ -341,7 +360,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *er m_commitCurrentAction = new QAction(tr("Commit Current File"), this); command = ami->registerAction(m_commitCurrentAction, SubversionPlugin::COMMIT_CURRENT, globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+C"))); connect(m_commitCurrentAction, SIGNAL(triggered()), this, SLOT(startCommitCurrentFile())); subversionMenu->addAction(command); @@ -354,7 +373,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *er m_filelogCurrentAction = new QAction(tr("Filelog Current File"), this); command = ami->registerAction(m_filelogCurrentAction, SubversionPlugin::FILELOG_CURRENT, globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_filelogCurrentAction, SIGNAL(triggered()), this, SLOT(filelogCurrentFile())); subversionMenu->addAction(command); @@ -362,7 +381,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *er m_annotateCurrentAction = new QAction(tr("Annotate Current File"), this); command = ami->registerAction(m_annotateCurrentAction, SubversionPlugin::ANNOTATE_CURRENT, globalcontext); - command->setAttribute(Core::ICommand::CA_UpdateText); + command->setAttribute(Core::Command::CA_UpdateText); connect(m_annotateCurrentAction, SIGNAL(triggered()), this, SLOT(annotateCurrentFile())); subversionMenu->addAction(command); @@ -506,11 +525,7 @@ SubversionSubmitEditor *SubversionPlugin::openSubversionSubmitEditor(const QStri Core::IEditor *editor = m_coreInstance->editorManager()->openEditor(fileName, QLatin1String(Constants::SUBVERSIONCOMMITEDITOR_KIND)); SubversionSubmitEditor *submitEditor = qobject_cast(editor); QTC_ASSERT(submitEditor, /**/); - // The actions are for some reason enabled by the context switching - // mechanism. Disable them correctly. - m_submitDiffAction->setEnabled(false); - m_submitUndoAction->setEnabled(false); - m_submitRedoAction->setEnabled(false); + submitEditor->registerActions(m_submitUndoAction, m_submitRedoAction, m_submitCurrentLogAction, m_submitDiffAction); connect(submitEditor, SIGNAL(diffSelectedFiles(QStringList)), this, SLOT(diffFiles(QStringList))); return submitEditor; @@ -694,7 +709,7 @@ void SubversionPlugin::startCommit(const QStringList &files) if (response.error) return; // Get list of added/modified/deleted files - const QStringList statusOutput = parseStatusOutput(response.stdOut); + const StatusList statusOutput = parseStatusOutput(response.stdOut); if (statusOutput.empty()) { showOutput(tr("There are no modified files."), true); return; @@ -717,22 +732,7 @@ void SubversionPlugin::startCommit(const QStringList &files) m_changeTmpFile->seek(0); // Create a submit editor and set file list SubversionSubmitEditor *editor = openSubversionSubmitEditor(m_changeTmpFile->fileName()); - editor->setFileList(statusOutput); -} - -// Parse "status" output for added/modified/deleted files -QStringList SubversionPlugin::parseStatusOutput(const QString &output) const -{ - QStringList changeSet; - const QString newLine = QString(QLatin1Char('\n')); - const QStringList list = output.split(newLine, QString::SkipEmptyParts); - foreach (const QString &l, list) { - QString line(l.trimmed()); - if (line.startsWith(QLatin1Char('A')) || line.startsWith(QLatin1Char('D')) - || line.startsWith(QLatin1Char('M'))) - changeSet.append(line); - } - return changeSet; + editor->setStatusList(statusOutput); } bool SubversionPlugin::commit(const QString &messageFile, diff --git a/src/plugins/subversion/subversionplugin.h b/src/plugins/subversion/subversionplugin.h index 6c2c448241e..fb6bd17b7a9 100644 --- a/src/plugins/subversion/subversionplugin.h +++ b/src/plugins/subversion/subversionplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -133,7 +133,6 @@ private: SubversionResponse runSvn(const QStringList &arguments, int timeOut, bool showStdOutInOutputWindow, QTextCodec *outputCodec = 0); void showOutput(const QString &output, bool bringToForeground = true); - QStringList parseStatusOutput(const QString &output) const; void annotate(const QString &file); void filelog(const QString &file); bool managesDirectory(const QDir &directory) const; diff --git a/src/plugins/subversion/subversionsettings.cpp b/src/plugins/subversion/subversionsettings.cpp index 3460739f4f8..65e95d5857b 100644 --- a/src/plugins/subversion/subversionsettings.cpp +++ b/src/plugins/subversion/subversionsettings.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/subversion/subversionsettings.h b/src/plugins/subversion/subversionsettings.h index 1719016c590..9b7c5a2fe52 100644 --- a/src/plugins/subversion/subversionsettings.h +++ b/src/plugins/subversion/subversionsettings.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/subversion/subversionsubmiteditor.cpp b/src/plugins/subversion/subversionsubmiteditor.cpp index b1e97e676e4..95a901f6cd5 100644 --- a/src/plugins/subversion/subversionsubmiteditor.cpp +++ b/src/plugins/subversion/subversionsubmiteditor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -35,6 +35,7 @@ #include "subversionsubmiteditor.h" #include +#include using namespace Subversion::Internal; @@ -45,6 +46,19 @@ SubversionSubmitEditor::SubversionSubmitEditor(const VCSBase::VCSBaseSubmitEdito setDisplayName(tr("Subversion Submit")); } +void SubversionSubmitEditor::setStatusList(const QList &statusOutput) +{ + typedef QList::const_iterator ConstIterator; + VCSBase::SubmitFileModel *model = new VCSBase::SubmitFileModel(this); + + const ConstIterator cend = statusOutput.constEnd(); + for (ConstIterator it = statusOutput.constBegin(); it != cend; ++it) + model->addFile(it->second, it->first, true); + setFileModel(model); + +} + +/* QStringList SubversionSubmitEditor::vcsFileListToFileList(const QStringList &rl) const { QStringList files; @@ -59,3 +73,5 @@ QString SubversionSubmitEditor::fileFromStatusLine(const QString &statusLine) enum { filePos = 7 }; return statusLine.mid(filePos, statusLine.size() - filePos); } + +*/ diff --git a/src/plugins/subversion/subversionsubmiteditor.h b/src/plugins/subversion/subversionsubmiteditor.h index c6bf0845ebc..3b4b331c27e 100644 --- a/src/plugins/subversion/subversionsubmiteditor.h +++ b/src/plugins/subversion/subversionsubmiteditor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -34,6 +34,9 @@ #ifndef SUBVERSIONSUBMITEDITOR_H #define SUBVERSIONSUBMITEDITOR_H +#include +#include + #include namespace Subversion { @@ -48,8 +51,10 @@ public: static QString fileFromStatusLine(const QString &statusLine); -private: - virtual QStringList vcsFileListToFileList(const QStringList &) const; + // A list of ( 'A','M','D') status indicators and file names. + typedef QPair StatusFilePair; + + void setStatusList(const QList &statusOutput); }; } // namespace Internal diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index 60072084c7b..61fc6eadc17 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -34,7 +34,7 @@ #include "basefilefind.h" #include -#include +#include #include #include #include diff --git a/src/plugins/texteditor/basefilefind.h b/src/plugins/texteditor/basefilefind.h index e20a750330e..2aacf2d9650 100644 --- a/src/plugins/texteditor/basefilefind.h +++ b/src/plugins/texteditor/basefilefind.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/basetextdocument.cpp b/src/plugins/texteditor/basetextdocument.cpp index de6054cfa89..eb6069df6d9 100644 --- a/src/plugins/texteditor/basetextdocument.cpp +++ b/src/plugins/texteditor/basetextdocument.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/basetextdocument.h b/src/plugins/texteditor/basetextdocument.h index b54a45b888a..83f42dcee7b 100644 --- a/src/plugins/texteditor/basetextdocument.h +++ b/src/plugins/texteditor/basetextdocument.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index ea4f665a7e9..9f145bc0801 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/basetexteditor.h b/src/plugins/texteditor/basetexteditor.h index 7cdcafdf7fb..e5e79d4a4a2 100644 --- a/src/plugins/texteditor/basetexteditor.h +++ b/src/plugins/texteditor/basetexteditor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -396,6 +396,7 @@ public: CodeWarningsSelection, CodeSemanticsSelection, OtherSelection, + FakeVimSelection, NExtraSelectionKinds }; void setExtraSelections(ExtraSelectionKind kind, const QList &selections); diff --git a/src/plugins/texteditor/basetexteditor_p.h b/src/plugins/texteditor/basetexteditor_p.h index 2b586823851..3310b0665d2 100644 --- a/src/plugins/texteditor/basetexteditor_p.h +++ b/src/plugins/texteditor/basetexteditor_p.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/basetextmark.cpp b/src/plugins/texteditor/basetextmark.cpp index 5d4c17ac9ba..4e4adf28bdc 100644 --- a/src/plugins/texteditor/basetextmark.cpp +++ b/src/plugins/texteditor/basetextmark.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/basetextmark.h b/src/plugins/texteditor/basetextmark.h index 4010db3f6bf..cbe9837e5a8 100644 --- a/src/plugins/texteditor/basetextmark.h +++ b/src/plugins/texteditor/basetextmark.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/codecselector.cpp b/src/plugins/texteditor/codecselector.cpp index 2c4138dbc7c..4252a3ff40b 100644 --- a/src/plugins/texteditor/codecselector.cpp +++ b/src/plugins/texteditor/codecselector.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/codecselector.h b/src/plugins/texteditor/codecselector.h index e221d279e6f..4631b6b49f6 100644 --- a/src/plugins/texteditor/codecselector.h +++ b/src/plugins/texteditor/codecselector.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/completionsupport.cpp b/src/plugins/texteditor/completionsupport.cpp index 34648b4bb00..5c863e3afe2 100644 --- a/src/plugins/texteditor/completionsupport.cpp +++ b/src/plugins/texteditor/completionsupport.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -42,6 +42,8 @@ #include #include +#include + using namespace TextEditor; using namespace TextEditor::Internal; @@ -143,11 +145,32 @@ void CompletionSupport::autoComplete(ITextEditable *editor, bool forced) } } +static bool compareChar(const QChar &l, const QChar &r) +{ + if (l == QLatin1Char('_')) + return false; + else if (r == QLatin1Char('_')) + return true; + else + return l < r; +} + +static bool lessThan(const QString &l, const QString &r) +{ + return std::lexicographical_compare(l.begin(), l.end(), + r.begin(), r.end(), + compareChar); +} + static bool completionItemLessThan(const CompletionItem &i1, const CompletionItem &i2) { // The order is case-insensitive in principle, but case-sensitive when this would otherwise mean equality - const int c = i1.m_text.compare(i2.m_text, Qt::CaseInsensitive); - return c ? c < 0 : i1.m_text < i2.m_text; + const QString lower1 = i1.m_text.toLower(); + const QString lower2 = i2.m_text.toLower(); + if (lower1 == lower2) + return lessThan(i1.m_text, i2.m_text); + else + return lessThan(lower1, lower2); } QList CompletionSupport::getCompletions() const diff --git a/src/plugins/texteditor/completionsupport.h b/src/plugins/texteditor/completionsupport.h index d35a1347d77..9704f80f2a2 100644 --- a/src/plugins/texteditor/completionsupport.h +++ b/src/plugins/texteditor/completionsupport.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/completionwidget.cpp b/src/plugins/texteditor/completionwidget.cpp index 2c9f6017b7f..5f4ccfe3e10 100644 --- a/src/plugins/texteditor/completionwidget.cpp +++ b/src/plugins/texteditor/completionwidget.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/completionwidget.h b/src/plugins/texteditor/completionwidget.h index b124d2e257a..b88dc7ffdc1 100644 --- a/src/plugins/texteditor/completionwidget.h +++ b/src/plugins/texteditor/completionwidget.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/displaysettings.cpp b/src/plugins/texteditor/displaysettings.cpp index c3b3deb15f9..5a213b66705 100644 --- a/src/plugins/texteditor/displaysettings.cpp +++ b/src/plugins/texteditor/displaysettings.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/displaysettings.h b/src/plugins/texteditor/displaysettings.h index 86a216f24cc..4d23b2889db 100644 --- a/src/plugins/texteditor/displaysettings.h +++ b/src/plugins/texteditor/displaysettings.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/findinfiles.cpp b/src/plugins/texteditor/findinfiles.cpp index ac2276ebed0..c8c1020563e 100644 --- a/src/plugins/texteditor/findinfiles.cpp +++ b/src/plugins/texteditor/findinfiles.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/findinfiles.h b/src/plugins/texteditor/findinfiles.h index dc1ee8e53f0..e38c838f87d 100644 --- a/src/plugins/texteditor/findinfiles.h +++ b/src/plugins/texteditor/findinfiles.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/fontsettings.cpp b/src/plugins/texteditor/fontsettings.cpp index 2fcef19077f..d421a81d272 100644 --- a/src/plugins/texteditor/fontsettings.cpp +++ b/src/plugins/texteditor/fontsettings.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/fontsettings.h b/src/plugins/texteditor/fontsettings.h index 130719f47e5..16c2f639624 100644 --- a/src/plugins/texteditor/fontsettings.h +++ b/src/plugins/texteditor/fontsettings.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/fontsettingspage.cpp b/src/plugins/texteditor/fontsettingspage.cpp index bdc86ca3e13..1eaccaba6e2 100644 --- a/src/plugins/texteditor/fontsettingspage.cpp +++ b/src/plugins/texteditor/fontsettingspage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -435,13 +435,8 @@ void FontSettingsPage::delayedChange() emit changed(d_ptr->m_value); } -void FontSettingsPage::finished(bool accepted) +void FontSettingsPage::apply() { - if (!accepted) { - d_ptr->m_value = d_ptr->m_lastValue; - return; - } - d_ptr->m_value.setFamily(d_ptr->ui.familyComboBox->currentText()); bool ok = true; @@ -460,6 +455,12 @@ void FontSettingsPage::finished(bool accepted) } } +void FontSettingsPage::finish() +{ + // If changes were applied, these are equal. Otherwise restores last value. + d_ptr->m_value = d_ptr->m_lastValue; +} + const FontSettings &FontSettingsPage::fontSettings() const { return d_ptr->m_value; diff --git a/src/plugins/texteditor/fontsettingspage.h b/src/plugins/texteditor/fontsettingspage.h index dd1711cfce2..6a518f518d3 100644 --- a/src/plugins/texteditor/fontsettingspage.h +++ b/src/plugins/texteditor/fontsettingspage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -99,7 +99,8 @@ public: QString trCategory() const; QWidget *createPage(QWidget *parent); - void finished(bool accepted); + void apply(); + void finish(); const FontSettings &fontSettings() const; diff --git a/src/plugins/texteditor/generalsettingspage.cpp b/src/plugins/texteditor/generalsettingspage.cpp index 149886cca52..d20763b0cab 100644 --- a/src/plugins/texteditor/generalsettingspage.cpp +++ b/src/plugins/texteditor/generalsettingspage.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -105,14 +105,12 @@ QWidget *GeneralSettingsPage::createPage(QWidget *parent) return w; } -void GeneralSettingsPage::finished(bool accepted) +void GeneralSettingsPage::apply() { - if (!accepted) - return; - TabSettings newTabSettings; StorageSettings newStorageSettings; DisplaySettings newDisplaySettings; + settingsFromUI(newTabSettings, newStorageSettings, newDisplaySettings); if (newTabSettings != m_d->m_tabSettings) { diff --git a/src/plugins/texteditor/generalsettingspage.h b/src/plugins/texteditor/generalsettingspage.h index 645390288b0..eea75e2ccc8 100644 --- a/src/plugins/texteditor/generalsettingspage.h +++ b/src/plugins/texteditor/generalsettingspage.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -72,7 +72,8 @@ public: QString trCategory() const; QWidget *createPage(QWidget *parent); - void finished(bool accepted); + void apply(); + void finish() { } TabSettings tabSettings() const; StorageSettings storageSettings() const; diff --git a/src/plugins/texteditor/icompletioncollector.h b/src/plugins/texteditor/icompletioncollector.h index 3144427f498..c3faac470c4 100644 --- a/src/plugins/texteditor/icompletioncollector.h +++ b/src/plugins/texteditor/icompletioncollector.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/itexteditable.h b/src/plugins/texteditor/itexteditable.h index c24692e61de..09cd9b57735 100644 --- a/src/plugins/texteditor/itexteditable.h +++ b/src/plugins/texteditor/itexteditable.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/itexteditor.h b/src/plugins/texteditor/itexteditor.h index 57b93461b6c..940f88477df 100644 --- a/src/plugins/texteditor/itexteditor.h +++ b/src/plugins/texteditor/itexteditor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/linenumberfilter.cpp b/src/plugins/texteditor/linenumberfilter.cpp index a084ac6c332..cb02b0f8088 100644 --- a/src/plugins/texteditor/linenumberfilter.cpp +++ b/src/plugins/texteditor/linenumberfilter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/linenumberfilter.h b/src/plugins/texteditor/linenumberfilter.h index 353e7b005da..bc29b1db374 100644 --- a/src/plugins/texteditor/linenumberfilter.h +++ b/src/plugins/texteditor/linenumberfilter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/plaintexteditor.cpp b/src/plugins/texteditor/plaintexteditor.cpp index 277d7fce0ca..b9370bca9cf 100644 --- a/src/plugins/texteditor/plaintexteditor.cpp +++ b/src/plugins/texteditor/plaintexteditor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/plaintexteditor.h b/src/plugins/texteditor/plaintexteditor.h index 15dbb1b9911..83067791eb6 100644 --- a/src/plugins/texteditor/plaintexteditor.h +++ b/src/plugins/texteditor/plaintexteditor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/plaintexteditorfactory.cpp b/src/plugins/texteditor/plaintexteditorfactory.cpp index 874619cce55..92a3a79ea4f 100644 --- a/src/plugins/texteditor/plaintexteditorfactory.cpp +++ b/src/plugins/texteditor/plaintexteditorfactory.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/plaintexteditorfactory.h b/src/plugins/texteditor/plaintexteditorfactory.h index b1604a94f12..e0eec76f137 100644 --- a/src/plugins/texteditor/plaintexteditorfactory.h +++ b/src/plugins/texteditor/plaintexteditorfactory.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/storagesettings.cpp b/src/plugins/texteditor/storagesettings.cpp index 2d09e0d6b2a..b92b4973450 100644 --- a/src/plugins/texteditor/storagesettings.cpp +++ b/src/plugins/texteditor/storagesettings.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/storagesettings.h b/src/plugins/texteditor/storagesettings.h index 7ccf80f9811..d90b462d321 100644 --- a/src/plugins/texteditor/storagesettings.h +++ b/src/plugins/texteditor/storagesettings.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/tabsettings.cpp b/src/plugins/texteditor/tabsettings.cpp index 413e650c7bc..46d4100112f 100644 --- a/src/plugins/texteditor/tabsettings.cpp +++ b/src/plugins/texteditor/tabsettings.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/tabsettings.h b/src/plugins/texteditor/tabsettings.h index 2a8fbc31c3d..717ba07ea02 100644 --- a/src/plugins/texteditor/tabsettings.h +++ b/src/plugins/texteditor/tabsettings.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/textblockiterator.cpp b/src/plugins/texteditor/textblockiterator.cpp index b94f0a19f5c..b5814124b49 100644 --- a/src/plugins/texteditor/textblockiterator.cpp +++ b/src/plugins/texteditor/textblockiterator.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/textblockiterator.h b/src/plugins/texteditor/textblockiterator.h index d39a7af2291..0955ec8c9c6 100644 --- a/src/plugins/texteditor/textblockiterator.h +++ b/src/plugins/texteditor/textblockiterator.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/texteditor_global.h b/src/plugins/texteditor/texteditor_global.h index 5876f889a06..7540d630271 100644 --- a/src/plugins/texteditor/texteditor_global.h +++ b/src/plugins/texteditor/texteditor_global.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp index 12475d221b1..44b6f33b17d 100644 --- a/src/plugins/texteditor/texteditoractionhandler.cpp +++ b/src/plugins/texteditor/texteditoractionhandler.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include @@ -111,13 +111,13 @@ void TextEditorActionHandler::createActions() m_gotoAction = registerNewAction(QLatin1String(Core::Constants::GOTO), this, SLOT(gotoAction())); m_printAction = registerNewAction(QLatin1String(Core::Constants::PRINT), this, SLOT(printAction())); - Core::ActionManagerInterface *am = m_core->actionManager(); + Core::ActionManager *am = m_core->actionManager(); - Core::IActionContainer *medit = am->actionContainer(Core::Constants::M_EDIT); - Core::IActionContainer *advancedMenu = am->actionContainer(Core::Constants::M_EDIT_ADVANCED); + Core::ActionContainer *medit = am->actionContainer(Core::Constants::M_EDIT); + Core::ActionContainer *advancedMenu = am->actionContainer(Core::Constants::M_EDIT_ADVANCED); m_selectEncodingAction = new QAction(tr("Select Encoding..."), this); - Core::ICommand *command = am->registerAction(m_selectEncodingAction, Constants::SELECT_ENCODING, m_contextId); + Core::Command *command = am->registerAction(m_selectEncodingAction, Constants::SELECT_ENCODING, m_contextId); connect(m_selectEncodingAction, SIGNAL(triggered()), this, SLOT(selectEncoding())); medit->addAction(command, Core::Constants::G_EDIT_OTHER); diff --git a/src/plugins/texteditor/texteditoractionhandler.h b/src/plugins/texteditor/texteditoractionhandler.h index 45dcca1f97f..ea30cad7413 100644 --- a/src/plugins/texteditor/texteditoractionhandler.h +++ b/src/plugins/texteditor/texteditoractionhandler.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/texteditorconstants.h b/src/plugins/texteditor/texteditorconstants.h index f87e1df6b83..7db120f144a 100644 --- a/src/plugins/texteditor/texteditorconstants.h +++ b/src/plugins/texteditor/texteditorconstants.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp index 01a6ccdf95f..d76bd716708 100644 --- a/src/plugins/texteditor/texteditorplugin.cpp +++ b/src/plugins/texteditor/texteditorplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -46,8 +46,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -120,14 +120,14 @@ bool TextEditorPlugin::initialize(const QStringList & /*arguments*/, QString *er int contextId = m_core->uniqueIDManager()->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR); QList context = QList() << contextId; - Core::ActionManagerInterface *am = m_core->actionManager(); + Core::ActionManager *am = m_core->actionManager(); // Add shortcut for invoking automatic completion QShortcut *completionShortcut = new QShortcut(m_core->mainWindow()); completionShortcut->setWhatsThis(tr("Triggers a completion in this scope")); // Make sure the shortcut still works when the completion widget is active completionShortcut->setContext(Qt::ApplicationShortcut); - Core::ICommand *command = am->registerShortcut(completionShortcut, Constants::COMPLETE_THIS, context); + Core::Command *command = am->registerShortcut(completionShortcut, Constants::COMPLETE_THIS, context); #ifndef Q_OS_MAC command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Space"))); #else diff --git a/src/plugins/texteditor/texteditorplugin.h b/src/plugins/texteditor/texteditorplugin.h index 8eeb1e3e8e6..65c7c3e48e8 100644 --- a/src/plugins/texteditor/texteditorplugin.h +++ b/src/plugins/texteditor/texteditorplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp index 8ecabf2ce1f..2637b5da545 100644 --- a/src/plugins/texteditor/texteditorsettings.cpp +++ b/src/plugins/texteditor/texteditorsettings.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/texteditorsettings.h b/src/plugins/texteditor/texteditorsettings.h index e64cb795b2d..fda32d20fae 100644 --- a/src/plugins/texteditor/texteditorsettings.h +++ b/src/plugins/texteditor/texteditorsettings.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/textfilewizard.cpp b/src/plugins/texteditor/textfilewizard.cpp index 1236a645370..e755233735d 100644 --- a/src/plugins/texteditor/textfilewizard.cpp +++ b/src/plugins/texteditor/textfilewizard.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/texteditor/textfilewizard.h b/src/plugins/texteditor/textfilewizard.h index 788b60f21d1..2cf2a01b395 100644 --- a/src/plugins/texteditor/textfilewizard.h +++ b/src/plugins/texteditor/textfilewizard.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/vcsbase/baseannotationhighlighter.cpp b/src/plugins/vcsbase/baseannotationhighlighter.cpp index c55a526fc1d..f6d95a8030d 100644 --- a/src/plugins/vcsbase/baseannotationhighlighter.cpp +++ b/src/plugins/vcsbase/baseannotationhighlighter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/vcsbase/baseannotationhighlighter.h b/src/plugins/vcsbase/baseannotationhighlighter.h index e32fdf077bf..c1ca81a50e6 100644 --- a/src/plugins/vcsbase/baseannotationhighlighter.h +++ b/src/plugins/vcsbase/baseannotationhighlighter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/vcsbase/basevcseditorfactory.cpp b/src/plugins/vcsbase/basevcseditorfactory.cpp index 4177608c271..392b9c26964 100644 --- a/src/plugins/vcsbase/basevcseditorfactory.cpp +++ b/src/plugins/vcsbase/basevcseditorfactory.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/vcsbase/basevcseditorfactory.h b/src/plugins/vcsbase/basevcseditorfactory.h index 1bf543347b8..bc10a21180d 100644 --- a/src/plugins/vcsbase/basevcseditorfactory.h +++ b/src/plugins/vcsbase/basevcseditorfactory.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp b/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp index f880d780666..b662abbf409 100644 --- a/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp +++ b/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/vcsbase/basevcssubmiteditorfactory.h b/src/plugins/vcsbase/basevcssubmiteditorfactory.h index 20b8bd8232b..f64d45d153b 100644 --- a/src/plugins/vcsbase/basevcssubmiteditorfactory.h +++ b/src/plugins/vcsbase/basevcssubmiteditorfactory.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/vcsbase/diffhighlighter.cpp b/src/plugins/vcsbase/diffhighlighter.cpp index b4cc9af0ff0..96379976172 100644 --- a/src/plugins/vcsbase/diffhighlighter.cpp +++ b/src/plugins/vcsbase/diffhighlighter.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/vcsbase/diffhighlighter.h b/src/plugins/vcsbase/diffhighlighter.h index 20d03c80582..63258dcf6c1 100644 --- a/src/plugins/vcsbase/diffhighlighter.h +++ b/src/plugins/vcsbase/diffhighlighter.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/vcsbase/submiteditorfile.cpp b/src/plugins/vcsbase/submiteditorfile.cpp index 902b830f7d4..9c7f2cca3f5 100644 --- a/src/plugins/vcsbase/submiteditorfile.cpp +++ b/src/plugins/vcsbase/submiteditorfile.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/vcsbase/submiteditorfile.h b/src/plugins/vcsbase/submiteditorfile.h index fd1bbf83688..cc4129f9015 100644 --- a/src/plugins/vcsbase/submiteditorfile.h +++ b/src/plugins/vcsbase/submiteditorfile.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/vcsbase/submitfilemodel.cpp b/src/plugins/vcsbase/submitfilemodel.cpp new file mode 100644 index 00000000000..2cad63e9caa --- /dev/null +++ b/src/plugins/vcsbase/submitfilemodel.cpp @@ -0,0 +1,105 @@ +/*************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** +** Non-Open Source Usage +** +** Licensees may use this file in accordance with the Qt Beta Version +** License Agreement, Agreement version 2.2 provided with the Software or, +** alternatively, in accordance with the terms contained in a written +** agreement between you and Nokia. +** +** GNU General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the packaging +** of this file. Please review the following information to ensure GNU +** General Public Licensing requirements will be met: +** +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt GPL Exception +** version 1.3, included in the file GPL_EXCEPTION.txt in this package. +** +***************************************************************************/ + +#include "submitfilemodel.h" +#include "vcsbaseconstants.h" + +#include +#include + +namespace VCSBase { + +SubmitFileModel::SubmitFileModel(QObject *parent) : + QStandardItemModel(0, 2, parent) +{ + // setColumnCount(2); + QStringList headerLabels; + headerLabels << tr("State") << tr("File"); + setHorizontalHeaderLabels(headerLabels); +} + +QList SubmitFileModel::createFileRow(const QString &fileName, const QString &status, bool checked) +{ + if (VCSBase::Constants::Internal::debug) + qDebug() << Q_FUNC_INFO << fileName << status << checked; + QStandardItem *statusItem = new QStandardItem(status); + statusItem->setCheckable(true); + statusItem->setCheckState(checked ? Qt::Checked : Qt::Unchecked); + statusItem->setFlags(Qt::ItemIsSelectable|Qt::ItemIsUserCheckable|Qt::ItemIsEnabled); + QStandardItem *fileItem = new QStandardItem(fileName); + fileItem->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); + QList row; + row << statusItem << fileItem; + return row; +} + +QList SubmitFileModel::addFile(const QString &fileName, const QString &status, bool checked) +{ + const QList row = createFileRow(fileName, status, checked); + appendRow(row); + return row; +} + +QList SubmitFileModel::rowAt(int row) const +{ + const int colCount = columnCount(); + QList rc; + for (int c = 0; c < colCount; c++) + rc.push_back(item(row, c)); + return rc; +} + +QList SubmitFileModel::findRow(const QString &text, int column) const +{ + // Single item + const QList items = findItems(text, Qt::MatchExactly, column); + if (items.empty()) + return items; + // Compile row + return rowAt(items.front()->row()); + } + +unsigned SubmitFileModel::filter(const QStringList &filter, int column) +{ + unsigned rc = 0; + for (int r = rowCount() - 1; r >= 0; r--) + if (const QStandardItem *i = item(r, column)) + if (!filter.contains(i->text())) { + qDeleteAll(takeRow(r)); + rc++; + } + if (VCSBase::Constants::Internal::debug) + qDebug() << Q_FUNC_INFO << " deleted " << rc << " items using " << filter << " , remaining " << rowCount(); + return rc; +} +} diff --git a/src/plugins/vcsbase/submitfilemodel.h b/src/plugins/vcsbase/submitfilemodel.h new file mode 100644 index 00000000000..e5e28dc093b --- /dev/null +++ b/src/plugins/vcsbase/submitfilemodel.h @@ -0,0 +1,69 @@ +/*************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** +** Non-Open Source Usage +** +** Licensees may use this file in accordance with the Qt Beta Version +** License Agreement, Agreement version 2.2 provided with the Software or, +** alternatively, in accordance with the terms contained in a written +** agreement between you and Nokia. +** +** GNU General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the packaging +** of this file. Please review the following information to ensure GNU +** General Public Licensing requirements will be met: +** +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt GPL Exception +** version 1.3, included in the file GPL_EXCEPTION.txt in this package. +** +***************************************************************************/ + +#ifndef SUBMITMODEL_H +#define SUBMITMODEL_H + +#include "vcsbase_global.h" + +#include + +namespace VCSBase { + +/* A 2-column (checkable, state, file name) model to be used to list the files- + * in the submit editor. Provides header items and a convience to add files. */ + +class VCSBASE_EXPORT SubmitFileModel : public QStandardItemModel +{ + Q_OBJECT +public: + explicit SubmitFileModel(QObject *parent = 0); + + // Convenience to create and add rows containing a file plus status text. + static QList createFileRow(const QString &fileName, const QString &status = QString(), bool checked = true); + QList addFile(const QString &fileName, const QString &status = QString(), bool checked = true); + + // Find convenience that returns the whole row (as opposed to QStandardItemModel::find). + QList findRow(const QString &text, int column = 0) const; + + // Convenience to obtain a row + QList rowAt(int row) const; + + // Filter for entries contained in the filter list. Returns the + // number of deleted entries. + unsigned filter(const QStringList &filter, int column); +}; + +} + +#endif // SUBMITMODEL_H diff --git a/src/plugins/vcsbase/vcsbase.pro b/src/plugins/vcsbase/vcsbase.pro index 329e27b0686..d34fe84e7c0 100644 --- a/src/plugins/vcsbase/vcsbase.pro +++ b/src/plugins/vcsbase/vcsbase.pro @@ -1,31 +1,28 @@ TEMPLATE = lib TARGET = VCSBase - DEFINES += VCSBASE_LIBRARY - include(../../qworkbenchplugin.pri) include(vcsbase_dependencies.pri) - HEADERS += vcsbase_global.h \ -vcsbaseconstants.h \ -vcsbaseplugin.h \ -baseannotationhighlighter.h \ -diffhighlighter.h \ -vcsbasetextdocument.h \ -vcsbaseeditor.h \ -vcsbasesubmiteditor.h \ -basevcseditorfactory.h \ -submiteditorfile.h \ -basevcssubmiteditorfactory.h - + vcsbaseconstants.h \ + vcsbaseplugin.h \ + baseannotationhighlighter.h \ + diffhighlighter.h \ + vcsbasetextdocument.h \ + vcsbaseeditor.h \ + vcsbasesubmiteditor.h \ + basevcseditorfactory.h \ + submiteditorfile.h \ + basevcssubmiteditorfactory.h \ + submitfilemodel.h SOURCES += vcsbaseplugin.cpp \ -baseannotationhighlighter.cpp \ -diffhighlighter.cpp \ -vcsbasetextdocument.cpp \ -vcsbaseeditor.cpp \ -vcsbasesubmiteditor.cpp \ -basevcseditorfactory.cpp \ -submiteditorfile.cpp \ -basevcssubmiteditorfactory.cpp - -RESOURCES=vcsbase.qrc + baseannotationhighlighter.cpp \ + diffhighlighter.cpp \ + vcsbasetextdocument.cpp \ + vcsbaseeditor.cpp \ + vcsbasesubmiteditor.cpp \ + basevcseditorfactory.cpp \ + submiteditorfile.cpp \ + basevcssubmiteditorfactory.cpp \ + submitfilemodel.cpp +RESOURCES = vcsbase.qrc diff --git a/src/plugins/vcsbase/vcsbase_global.h b/src/plugins/vcsbase/vcsbase_global.h index 9196019fbd9..a4dff9426fe 100644 --- a/src/plugins/vcsbase/vcsbase_global.h +++ b/src/plugins/vcsbase/vcsbase_global.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/vcsbase/vcsbaseconstants.h b/src/plugins/vcsbase/vcsbaseconstants.h index 9cdcbb8deab..583ffb0dd56 100644 --- a/src/plugins/vcsbase/vcsbaseconstants.h +++ b/src/plugins/vcsbase/vcsbaseconstants.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index 084109069d5..6951d39eea5 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/vcsbase/vcsbaseeditor.h b/src/plugins/vcsbase/vcsbaseeditor.h index fcb323e6930..42c31c6c37d 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.h +++ b/src/plugins/vcsbase/vcsbaseeditor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp index 9633f60ba14..7cbd8a9233e 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.cpp +++ b/src/plugins/vcsbase/vcsbaseplugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/vcsbase/vcsbaseplugin.h b/src/plugins/vcsbase/vcsbaseplugin.h index 3474c4a05f2..c97125b9108 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.h +++ b/src/plugins/vcsbase/vcsbaseplugin.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp index 9d668f16a76..a47a66ab064 100644 --- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp +++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include @@ -57,17 +57,6 @@ enum { debug = 0 }; enum { wantToolBar = 0 }; -static inline QAction *actionFromId(const Core::ICore *core, const char *id) -{ - QAction *rc = 0; - if (id) - if (const Core::ICommand *cmd = core->actionManager()->command(id)) - rc = cmd->action(); - if (debug) - qDebug() << Q_FUNC_INFO << id << rc; - return rc; -} - namespace VCSBase { struct VCSBaseSubmitEditorPrivate { @@ -83,10 +72,8 @@ struct VCSBaseSubmitEditorPrivate { VCSBase::Internal::SubmitEditorFile *m_file; QList m_contexts; - QPointer m_undoAction; - QPointer m_redoAction; - QPointer m_submitAction; QPointer m_diffAction; + QPointer m_submitAction; }; VCSBaseSubmitEditorPrivate::VCSBaseSubmitEditorPrivate(const VCSBaseSubmitEditorParameters *parameters, @@ -96,11 +83,7 @@ VCSBaseSubmitEditorPrivate::VCSBaseSubmitEditorPrivate(const VCSBaseSubmitEditor m_widget(editorWidget), m_toolWidget(0), m_parameters(parameters), - m_file(new VCSBase::Internal::SubmitEditorFile(QLatin1String(m_parameters->mimeType), q)), - m_undoAction(actionFromId(m_core, m_parameters->undoActionId)), - m_redoAction(actionFromId(m_core, m_parameters->redoActionId)), - m_submitAction(actionFromId(m_core, m_parameters->submitActionId)), - m_diffAction(actionFromId(m_core, m_parameters->diffActionId)) + m_file(new VCSBase::Internal::SubmitEditorFile(QLatin1String(m_parameters->mimeType), q)) { m_contexts << m_core->uniqueIDManager()->uniqueIdentifier(m_parameters->context); } @@ -113,7 +96,6 @@ VCSBaseSubmitEditor::VCSBaseSubmitEditor(const VCSBaseSubmitEditorParameters *pa // We are always clean to prevent the editor manager from asking to save. connect(m_d->m_file, SIGNAL(saveMe(QString)), this, SLOT(save(QString))); - m_d->m_widget->registerActions(m_d->m_undoAction, m_d->m_redoAction, m_d->m_submitAction, m_d->m_diffAction); connect(m_d->m_widget, SIGNAL(diffSelected(QStringList)), this, SLOT(slotDiffSelectedVCSFiles(QStringList))); connect(m_d->m_widget->descriptionEdit(), SIGNAL(textChanged()), this, SLOT(slotDescriptionChanged())); @@ -129,6 +111,41 @@ VCSBaseSubmitEditor::~VCSBaseSubmitEditor() delete m_d; } +void VCSBaseSubmitEditor::registerActions(QAction *editorUndoAction, QAction *editorRedoAction, + QAction *submitAction, QAction *diffAction)\ +{ + m_d->m_widget->registerActions(editorUndoAction, editorRedoAction, submitAction, diffAction); + m_d->m_diffAction = diffAction; + m_d->m_submitAction = submitAction; +} + +void VCSBaseSubmitEditor::unregisterActions(QAction *editorUndoAction, QAction *editorRedoAction, + QAction *submitAction, QAction *diffAction) +{ + m_d->m_widget->unregisterActions(editorUndoAction, editorRedoAction, submitAction, diffAction); + m_d->m_diffAction = m_d->m_submitAction = 0; +} +int VCSBaseSubmitEditor::fileNameColumn() const +{ + return m_d->m_widget->fileNameColumn(); +} + +void VCSBaseSubmitEditor::setFileNameColumn(int c) +{ + m_d->m_widget->setFileNameColumn(c); +} + +QAbstractItemView::SelectionMode VCSBaseSubmitEditor::fileListSelectionMode() const +{ + return m_d->m_widget->fileListSelectionMode(); +} + +void VCSBaseSubmitEditor::setFileListSelectionMode(QAbstractItemView::SelectionMode sm) +{ + m_d->m_widget->setFileListSelectionMode(sm); +} + + void VCSBaseSubmitEditor::slotDescriptionChanged() { } @@ -246,22 +263,22 @@ bool VCSBaseSubmitEditor::restoreState(const QByteArray &/*state*/) QStringList VCSBaseSubmitEditor::checkedFiles() const { - return vcsFileListToFileList(m_d->m_widget->checkedFiles()); + return m_d->m_widget->checkedFiles(); } -void VCSBaseSubmitEditor::setFileList(const QStringList &l) +void VCSBaseSubmitEditor::setFileModel(QAbstractItemModel *m) { - m_d->m_widget->setFileList(l); + m_d->m_widget->setFileModel(m); } -void VCSBaseSubmitEditor::addFiles(const QStringList& list, bool checked, bool userCheckable) +QAbstractItemModel *VCSBaseSubmitEditor::fileModel() const { - m_d->m_widget->addFiles(list, checked, userCheckable); + return m_d->m_widget->fileModel(); } void VCSBaseSubmitEditor::slotDiffSelectedVCSFiles(const QStringList &rawList) { - emit diffSelectedFiles(vcsFileListToFileList(rawList)); + emit diffSelectedFiles(rawList); } bool VCSBaseSubmitEditor::save(const QString &fileName) diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.h b/src/plugins/vcsbase/vcsbasesubmiteditor.h index 72553672411..9bea506126d 100644 --- a/src/plugins/vcsbase/vcsbasesubmiteditor.h +++ b/src/plugins/vcsbase/vcsbasesubmiteditor.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -39,9 +39,12 @@ #include #include +#include QT_BEGIN_NAMESPACE class QIcon; +class QAbstractItemModel; +class QAction; QT_END_NAMESPACE namespace Core { @@ -59,10 +62,6 @@ struct VCSBASE_EXPORT VCSBaseSubmitEditorParameters { const char *mimeType; const char *kind; const char *context; - const char *undoActionId; - const char *redoActionId; - const char *submitActionId; - const char *diffActionId; }; /* Base class for a submit editor based on the Core::Utils::SubmitEditorWidget @@ -84,12 +83,15 @@ struct VCSBASE_EXPORT VCSBaseSubmitEditorParameters { * signal and then asking the IFile interface of the editor to save the file * within a IFileManager::blockFileChange() section * and to launch the submit process. In addition, the action registered - * for submit should be connected to a slot triggering the close of the + * for submit sho src/libs/utils/submiteditorwidget.h +uld be connected to a slot triggering the close of the * current editor in the editor manager. */ class VCSBASE_EXPORT VCSBaseSubmitEditor : public Core::IEditor { Q_OBJECT + Q_PROPERTY(int fileNameColumn READ fileNameColumn WRITE setFileNameColumn DESIGNABLE false) + Q_PROPERTY(QAbstractItemView::SelectionMode fileListSelectionMode READ fileListSelectionMode WRITE setFileListSelectionMode DESIGNABLE true) public: typedef QList Context; @@ -98,8 +100,20 @@ protected: Core::Utils::SubmitEditorWidget *editorWidget); public: + // Register the actions with the submit editor widget. + void registerActions(QAction *editorUndoAction, QAction *editorRedoAction, + QAction *submitAction = 0, QAction *diffAction = 0); + void unregisterActions(QAction *editorUndoAction, QAction *editorRedoAction, + QAction *submitAction = 0, QAction *diffAction = 0); + virtual ~VCSBaseSubmitEditor(); + int fileNameColumn() const; + void setFileNameColumn(int c); + + QAbstractItemView::SelectionMode fileListSelectionMode() const; + void setFileListSelectionMode(QAbstractItemView::SelectionMode sm); + // Core::IEditor virtual bool createNew(const QString &contents); virtual bool open(const QString &fileName); @@ -119,8 +133,8 @@ public: QStringList checkedFiles() const; - void setFileList(const QStringList&); - void addFiles(const QStringList&, bool checked = true, bool userCheckable = true); + void setFileModel(QAbstractItemModel *m); + QAbstractItemModel *fileModel() const; // Utilities returning some predefined icons for actions static QIcon diffIcon(); @@ -139,11 +153,6 @@ private slots: void slotDescriptionChanged(); protected: - /* Implemented this to extract the real file list from the status - * output of the versioning system as displayed in the file list - * for example "M foo.cpp" -> "foo.cpp". */ - virtual QStringList vcsFileListToFileList(const QStringList &) const = 0; - /* These hooks allow for modifying the contents that goes to * the file. The default implementation uses the text * of the description editor. */ diff --git a/src/plugins/vcsbase/vcsbasetextdocument.cpp b/src/plugins/vcsbase/vcsbasetextdocument.cpp index fcd50c12f4b..75a9fdf53f5 100644 --- a/src/plugins/vcsbase/vcsbasetextdocument.cpp +++ b/src/plugins/vcsbase/vcsbasetextdocument.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/plugins/vcsbase/vcsbasetextdocument.h b/src/plugins/vcsbase/vcsbasetextdocument.h index e4bb7d1ce83..6517037859a 100644 --- a/src/plugins/vcsbase/vcsbasetextdocument.h +++ b/src/plugins/vcsbase/vcsbasetextdocument.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/tools/makespy/main.cpp b/src/tools/makespy/main.cpp index fe9d0d616e0..636f2d617c9 100644 --- a/src/tools/makespy/main.cpp +++ b/src/tools/makespy/main.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/tools/qdebugger/lean.h b/src/tools/qdebugger/lean.h index 4d06d8437cd..b1b0eaab6cf 100644 --- a/src/tools/qdebugger/lean.h +++ b/src/tools/qdebugger/lean.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/tools/qdebugger/main.cpp b/src/tools/qdebugger/main.cpp index d151bb6fa28..312ed53dbda 100644 --- a/src/tools/qdebugger/main.cpp +++ b/src/tools/qdebugger/main.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/tools/qdebugger/mainwindow.cpp b/src/tools/qdebugger/mainwindow.cpp index 7984626a788..8b881aad4bf 100644 --- a/src/tools/qdebugger/mainwindow.cpp +++ b/src/tools/qdebugger/mainwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/tools/qdebugger/mainwindow.h b/src/tools/qdebugger/mainwindow.h index 1c0d17a7bce..911e421f3f9 100644 --- a/src/tools/qdebugger/mainwindow.h +++ b/src/tools/qdebugger/mainwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/tools/qtcreatorwidgets/customwidget.h b/src/tools/qtcreatorwidgets/customwidget.h index 76edcd31765..81ed0393096 100644 --- a/src/tools/qtcreatorwidgets/customwidget.h +++ b/src/tools/qtcreatorwidgets/customwidget.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/tools/qtcreatorwidgets/customwidgets.cpp b/src/tools/qtcreatorwidgets/customwidgets.cpp index 3b40172633a..35140ebd99f 100644 --- a/src/tools/qtcreatorwidgets/customwidgets.cpp +++ b/src/tools/qtcreatorwidgets/customwidgets.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/tools/qtcreatorwidgets/customwidgets.h b/src/tools/qtcreatorwidgets/customwidgets.h index f78e88939e5..4bc970b78ab 100644 --- a/src/tools/qtcreatorwidgets/customwidgets.h +++ b/src/tools/qtcreatorwidgets/customwidgets.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/tools/texteditor/main.cpp b/src/tools/texteditor/main.cpp index d080780f93f..715c6d2f0c2 100644 --- a/src/tools/texteditor/main.cpp +++ b/src/tools/texteditor/main.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/tools/texteditor/mainwindow.cpp b/src/tools/texteditor/mainwindow.cpp index 7935a1cc498..5f5368fb7ae 100644 --- a/src/tools/texteditor/mainwindow.cpp +++ b/src/tools/texteditor/mainwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/src/tools/texteditor/mainwindow.h b/src/tools/texteditor/mainwindow.h index bf6f53cee39..df5e3c59a2f 100644 --- a/src/tools/texteditor/mainwindow.h +++ b/src/tools/texteditor/mainwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/tests/auto/extensionsystem/tst_composite.cpp b/tests/auto/extensionsystem/tst_composite.cpp index 6606f243acc..011fb508747 100644 --- a/tests/auto/extensionsystem/tst_composite.cpp +++ b/tests/auto/extensionsystem/tst_composite.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/tests/auto/fakevim/fakevim.pro b/tests/auto/fakevim/fakevim.pro index 29936b2568f..539a40f335c 100644 --- a/tests/auto/fakevim/fakevim.pro +++ b/tests/auto/fakevim/fakevim.pro @@ -1,7 +1,7 @@ QT += testlib -FAKEVIMSOURCE = /data/qt-creator/src/plugins/fakevim +FAKEVIMSOURCE = ../../../src/plugins/fakevim INCLUDEPATH += $$FAKEVIMSOURCE diff --git a/tests/auto/fakevim/main.cpp b/tests/auto/fakevim/main.cpp index 28a05dcd530..b22504b862b 100644 --- a/tests/auto/fakevim/main.cpp +++ b/tests/auto/fakevim/main.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/tests/auto/profilereader/main.cpp b/tests/auto/profilereader/main.cpp index ec5945d2b79..bb06561dd52 100644 --- a/tests/auto/profilereader/main.cpp +++ b/tests/auto/profilereader/main.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/tests/auto/profilereader/profilecache.h b/tests/auto/profilereader/profilecache.h index eef60ee5624..484978d662d 100644 --- a/tests/auto/profilereader/profilecache.h +++ b/tests/auto/profilereader/profilecache.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/tests/auto/profilereader/qtversionmanager.h b/tests/auto/profilereader/qtversionmanager.h index 29ec0ff1052..098a3bf2f8a 100644 --- a/tests/auto/profilereader/qtversionmanager.h +++ b/tests/auto/profilereader/qtversionmanager.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/tests/manual/cplusplus/main.cpp b/tests/manual/cplusplus/main.cpp index 4292fe929f6..533e05e1027 100644 --- a/tests/manual/cplusplus/main.cpp +++ b/tests/manual/cplusplus/main.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/tests/manual/dockwidgets/main.cpp b/tests/manual/dockwidgets/main.cpp index 28fae357951..55343c8b998 100644 --- a/tests/manual/dockwidgets/main.cpp +++ b/tests/manual/dockwidgets/main.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/tests/manual/dockwidgets/mainwindow.cpp b/tests/manual/dockwidgets/mainwindow.cpp index 3e9f8622fba..18b63be1478 100644 --- a/tests/manual/dockwidgets/mainwindow.cpp +++ b/tests/manual/dockwidgets/mainwindow.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/tests/manual/dockwidgets/mainwindow.h b/tests/manual/dockwidgets/mainwindow.h index d2d9e6dd387..1d26abfb463 100644 --- a/tests/manual/dockwidgets/mainwindow.h +++ b/tests/manual/dockwidgets/mainwindow.h @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/tests/manual/fakevim/fakevim.pro b/tests/manual/fakevim/fakevim.pro index ed3046b76c9..8624a100b37 100644 --- a/tests/manual/fakevim/fakevim.pro +++ b/tests/manual/fakevim/fakevim.pro @@ -3,9 +3,9 @@ FAKEVIMHOME = ../../../src/plugins/fakevim SOURCES += \ main.cpp \ - $$FAKEVIMHOME/handler.cpp + $$FAKEVIMHOME/fakevimhandler.cpp HEADERS += \ - $$FAKEVIMHOME/handler.h + $$FAKEVIMHOME/fakevimhandler.h INCLUDEPATH += $$FAKEVIMHOME diff --git a/tests/manual/fakevim/main.cpp b/tests/manual/fakevim/main.cpp index 8c504a62a81..c668601e78d 100644 --- a/tests/manual/fakevim/main.cpp +++ b/tests/manual/fakevim/main.cpp @@ -1,5 +1,5 @@ -#include "handler.h" +#include "fakevimhandler.h" #include @@ -11,6 +11,25 @@ using namespace FakeVim::Internal; +class Proxy : public QObject +{ + Q_OBJECT + +public: + Proxy(QWidget *widget) : QObject(0), m_widget(widget) {} + +public slots: + void changeSelection(QWidget *w, const QList &s) + { + if (QPlainTextEdit *ed = qobject_cast(w)) + ed->setExtraSelections(s); + else if (QTextEdit *ed = qobject_cast(w)) + ed->setExtraSelections(s); + } +private: + QWidget *m_widget; +}; + int main(int argc, char *argv[]) { QApplication app(argc, argv); @@ -31,8 +50,10 @@ int main(int argc, char *argv[]) widget->resize(450, 350); widget->setFocus(); + Proxy proxy(widget); - FakeVimHandler fakeVim; + + FakeVimHandler handler; QMainWindow mw; mw.setWindowTitle("Fakevim (" + title + ")"); @@ -50,14 +71,19 @@ int main(int argc, char *argv[]) widget->setFont(font); mw.statusBar()->setFont(font); - QObject::connect(&fakeVim, SIGNAL(commandBufferChanged(QString)), + QObject::connect(&handler, SIGNAL(commandBufferChanged(QString)), mw.statusBar(), SLOT(showMessage(QString))); - QObject::connect(&fakeVim, SIGNAL(quitRequested(QWidget *)), + QObject::connect(&handler, SIGNAL(quitRequested(QWidget *)), &app, SLOT(quit())); + QObject::connect(&handler, + SIGNAL(selectionChanged(QWidget*,QList)), + &proxy, SLOT(changeSelection(QWidget*,QList))); - fakeVim.addWidget(widget); + handler.addWidget(widget); if (args.size() >= 1) - fakeVim.handleCommand(widget, "r " + args.at(0)); + handler.handleCommand(widget, "r " + args.at(0)); return app.exec(); } + +#include "main.moc" diff --git a/tests/manual/gdbdebugger/script/math.js b/tests/manual/gdbdebugger/script/math.js index 9c0d96c859d..9058a10f877 100644 --- a/tests/manual/gdbdebugger/script/math.js +++ b/tests/manual/gdbdebugger/script/math.js @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/tests/manual/gdbdebugger/simple/app.cpp b/tests/manual/gdbdebugger/simple/app.cpp index 15ec4a7bd8e..a20311822f8 100644 --- a/tests/manual/gdbdebugger/simple/app.cpp +++ b/tests/manual/gdbdebugger/simple/app.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/tests/manual/gdbdebugger/simple/plugin.cpp b/tests/manual/gdbdebugger/simple/plugin.cpp index 90c1ffd562f..4e02c7f9f7e 100644 --- a/tests/manual/gdbdebugger/simple/plugin.cpp +++ b/tests/manual/gdbdebugger/simple/plugin.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/tests/manual/gdbdebugger/spacy path/app with space.cpp b/tests/manual/gdbdebugger/spacy path/app with space.cpp index 451d93ca813..ad7416bd299 100644 --- a/tests/manual/gdbdebugger/spacy path/app with space.cpp +++ b/tests/manual/gdbdebugger/spacy path/app with space.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** diff --git a/tests/manual/gdbdebugger/spacy path/plugin with space.cpp b/tests/manual/gdbdebugger/spacy path/plugin with space.cpp index 90c1ffd562f..4e02c7f9f7e 100644 --- a/tests/manual/gdbdebugger/spacy path/plugin with space.cpp +++ b/tests/manual/gdbdebugger/spacy path/plugin with space.cpp @@ -2,7 +2,7 @@ ** ** This file is part of Qt Creator ** -** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) **