Commit 1c56c56c authored by dt's avatar dt
Browse files

Merge remote branch 'origin/2.1'

parents ca8b342a 2c6a08df
......@@ -76,15 +76,21 @@ bin/qtcreator
bin/qtcreator_process_stub*
bin/qtcreator.exe
share/doc/qtcreator/qtcreator.qch
src/tools/gen-cpp-ast/generate-ast
src/tools/mkvisitor/cplusplus0
src/tools/qml/qmldump/qmldump
# Tests
#------
tests/manual/cplusplus-frontend/cplusplus0
tests/manual/cplusplus-dump/cplusplus0
tests/manual/qml-ast2dot/qml-ast2dot
tests/manual/gdbdebugger/simple/libsimple_gdbtest_plugin.*dylib
tests/manual/plain-cplusplus/plain-c++
tests/manual/preprocessor/pp
tests/auto/cplusplus/codegen/tst_codegen
tests/auto/qml/qmldesigner/bauhaustests/tst_bauhaus
tests/auto/qml/qmldesigner/coretests/tst_qmldesigner_core
tests/auto/qml/qmldesigner/propertyeditortests/tst_propertyeditor
tests/auto/profilewriter/tst_profilewriter
tests/manual/gdbdebugger/simple/libsimple_gdbtest_plugin.*dylib
src/tools/gen-cpp-ast/generate-ast
src/tools/mkvisitor/cplusplus0
src/tools/qml/qmldump/qmldump
Qt Creator 2.0.90
Qt Creator 2.0.91
===============
Qt Creator is a crossplatform C++ IDE for development with the Qt framework.
......
......@@ -21,7 +21,7 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \
" </div>\n" \
" <div id=\"shortCut\">\n" \
" <ul>\n" \
" <li class=\"shortCut-topleft-inactive\"><span><a href=\"index.html\">Qt Creator 2.0.90 </a></span></li>\n" \
" <li class=\"shortCut-topleft-inactive\"><span><a href=\"index.html\">Qt Creator 2.0.91 </a></span></li>\n" \
" <li class=\"shortCut-topleft-active\"><a href=\"http://doc.qt.nokia.com\">ALL VERSIONS" \
" </a></li>\n" \
" </ul>\n" \
......
......@@ -39,7 +39,7 @@
\title Qt Creator Manual
\section1 Version 2.0.90
\section1 Version 2.0.91
Qt Creator provides a cross-platform, complete integrated development
environment (IDE) for application developers to create applications for
......
......@@ -20,12 +20,12 @@ sources.fileextensions = "qtcreator.qdoc maemodev.qdoc symbiandev.qdoc addressb
qhp.projects = QtCreator
qhp.QtCreator.file = qtcreator.qhp
qhp.QtCreator.namespace = com.nokia.qtcreator.2090
qhp.QtCreator.namespace = com.nokia.qtcreator.2091
qhp.QtCreator.virtualFolder = doc
qhp.QtCreator.indexTitle = Qt Creator
qhp.QtCreator.filterAttributes = qtcreator 2.0.90
qhp.QtCreator.customFilters.QtCreator.name = Qt Creator 2.0.90
qhp.QtCreator.customFilters.QtCreator.filterAttributes = qtcreator 2.0.90
qhp.QtCreator.filterAttributes = qtcreator 2.0.91
qhp.QtCreator.customFilters.QtCreator.name = Qt Creator 2.0.91
qhp.QtCreator.customFilters.QtCreator.filterAttributes = qtcreator 2.0.91
qhp.QtCreator.indexRoot =
qhp.QtCreator.extraFiles = style/style.css \
style/style_ie6.css \
......
......@@ -1231,7 +1231,7 @@ class Dumper:
def handleWatch(self, exp, iname):
exp = str(exp)
escapedExp = exp.replace('"', '\\"')
escapedExp = escapedExp.replace('\', '\\\\')
escapedExp = escapedExp.replace('\\', '\\\\')
#warn("HANDLING WATCH %s, INAME: '%s'" % (exp, iname))
if exp.startswith("[") and exp.endswith("]"):
#warn("EVAL: EXP: %s" % exp)
......
......@@ -5,6 +5,6 @@
<description>%Description%</description>
<url>%URL%</url>
<dependencyList>
<dependency name="Core" version="2.0.90"/>
<dependency name="Core" version="2.0.91"/>
</dependencyList>
</plugin>
......@@ -212,8 +212,8 @@
<key>CFBundleIdentifier</key>
<string>com.nokia.qtcreator</string>
<key>CFBundleVersion</key>
<string>2.0.90</string>
<string>2.0.91</string>
<key>CFBundleShortVersionString</key>
<string>2.0.90</string>
<string>2.0.91</string>
</dict>
</plist>
......@@ -206,19 +206,23 @@ protected:
if (AccessDeclarationAST *xsDecl = decl->asAccessDeclaration()) {
const unsigned token = xsDecl->access_specifier_token;
int newXsSpec = initialXs;
bool isSlot = xsDecl->slots_token && tokenKind(xsDecl->slots_token) == T_Q_SLOTS;
bool isSlot = xsDecl->slots_token
&& tokenKind(xsDecl->slots_token) == T_Q_SLOTS;
switch (tokenKind(token)) {
case T_PUBLIC:
newXsSpec = isSlot ? InsertionPointLocator::PublicSlot : InsertionPointLocator::Public;
newXsSpec = isSlot ? InsertionPointLocator::PublicSlot
: InsertionPointLocator::Public;
break;
case T_PROTECTED:
newXsSpec = isSlot ? InsertionPointLocator::ProtectedSlot : InsertionPointLocator::Protected;
newXsSpec = isSlot ? InsertionPointLocator::ProtectedSlot
: InsertionPointLocator::Protected;
break;
case T_PRIVATE:
newXsSpec = isSlot ? InsertionPointLocator::PrivateSlot: InsertionPointLocator::Private;
newXsSpec = isSlot ? InsertionPointLocator::PrivateSlot
: InsertionPointLocator::Private;
break;
case T_Q_SIGNALS:
......@@ -268,13 +272,32 @@ InsertionLocation::InsertionLocation(const QString &prefix, const QString &suffi
, m_column(column)
{}
InsertionPointLocator::InsertionPointLocator(const Document::Ptr &doc)
: m_doc(doc)
InsertionPointLocator::InsertionPointLocator(const Snapshot &snapshot)
: m_snapshot(snapshot)
{
}
InsertionLocation InsertionPointLocator::methodDeclarationInClass(const Class *clazz, AccessSpec xsSpec) const
InsertionLocation InsertionPointLocator::methodDeclarationInClass(
const QString &fileName,
const Class *clazz,
AccessSpec xsSpec) const
{
FindInClass find(m_doc, clazz, xsSpec);
return find();
const Document::Ptr doc = m_snapshot.document(fileName);
if (doc) {
FindInClass find(doc, clazz, xsSpec);
return find();
} else {
return InsertionLocation();
}
}
/// Currently, we return the end of fileName.cpp
QList<InsertionLocation> InsertionPointLocator::methodDefinition(
const QString &/*fileName*/) const
{
QList<InsertionLocation> result;
return result;
}
......@@ -30,6 +30,7 @@
#ifndef INSERTIONPOINTLOCATOR_H
#define INSERTIONPOINTLOCATOR_H
#include <ASTfwd.h>
#include <CPlusPlusForwardDeclarations.h>
#include <Symbols.h>
......@@ -82,19 +83,22 @@ public:
SlotBit = 1 << 2,
PublicSlot = Public | SlotBit,
PublicSlot = Public | SlotBit,
ProtectedSlot = Protected | SlotBit,
PrivateSlot = Private | SlotBit,
PrivateSlot = Private | SlotBit,
};
public:
InsertionPointLocator(const Document::Ptr &doc);
InsertionPointLocator(const Snapshot &snapshot);
InsertionLocation methodDeclarationInClass(const Class *clazz,
InsertionLocation methodDeclarationInClass(const QString &fileName,
const Class *clazz,
AccessSpec xsSpec) const;
QList<InsertionLocation> methodDefinition(const QString &fileName) const;
private:
Document::Ptr m_doc;
Snapshot m_snapshot;
};
} // namespace CPlusPlus
......
<plugin name="BinEditor" version="2.0.90" compatVersion="2.0.90">
<plugin name="BinEditor" version="2.0.91" compatVersion="2.0.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2010 Nokia Corporation</copyright>
<license>
......@@ -14,7 +14,7 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General
<description>Binary editor component.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="Core" version="2.0.90"/>
<dependency name="TextEditor" version="2.0.90"/>
<dependency name="Core" version="2.0.91"/>
<dependency name="TextEditor" version="2.0.91"/>
</dependencyList>
</plugin>
<plugin name="Bookmarks" version="2.0.90" compatVersion="2.0.90">
<plugin name="Bookmarks" version="2.0.91" compatVersion="2.0.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2010 Nokia Corporation</copyright>
<license>
......@@ -14,8 +14,8 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General
<description>Bookmarks in text editors.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="TextEditor" version="2.0.90"/>
<dependency name="ProjectExplorer" version="2.0.90"/>
<dependency name="Core" version="2.0.90"/>
<dependency name="TextEditor" version="2.0.91"/>
<dependency name="ProjectExplorer" version="2.0.91"/>
<dependency name="Core" version="2.0.91"/>
</dependencyList>
</plugin>
<plugin name="ClassView" version="2.0.90" compatVersion="2.0.90">
<plugin name="ClassView" version="2.0.91" compatVersion="2.0.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2010 Denis Mingulov</copyright>
<license>
......@@ -14,9 +14,9 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General
<description>Class View component.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="Core" version="2.0.90"/>
<dependency name="CppTools" version="2.0.90"/>
<dependency name="ProjectExplorer" version="2.0.90"/>
<dependency name="TextEditor" version="2.0.90"/>
<dependency name="Core" version="2.0.91"/>
<dependency name="CppTools" version="2.0.91"/>
<dependency name="ProjectExplorer" version="2.0.91"/>
<dependency name="TextEditor" version="2.0.91"/>
</dependencyList>
</plugin>
<plugin name="CMakeProjectManager" version="2.0.90" compatVersion="2.0.90">
<plugin name="CMakeProjectManager" version="2.0.91" compatVersion="2.0.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2010 Nokia Corporation</copyright>
<license>
......@@ -14,9 +14,9 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General
<description>CMake support</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="TextEditor" version="2.0.90"/>
<dependency name="ProjectExplorer" version="2.0.90"/>
<dependency name="CppTools" version="2.0.90"/>
<dependency name="CppEditor" version="2.0.90"/>
<dependency name="TextEditor" version="2.0.91"/>
<dependency name="ProjectExplorer" version="2.0.91"/>
<dependency name="CppTools" version="2.0.91"/>
<dependency name="CppEditor" version="2.0.91"/>
</dependencyList>
</plugin>
......@@ -264,6 +264,7 @@ bool CMakeProject::parseCMakeLists()
}
emit buildTargetsChanged();
emit fileListChanged();
return true;
}
......
<plugin name="Core" version="2.0.90" compatVersion="2.0.90">
<plugin name="Core" version="2.0.91" compatVersion="2.0.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2010 Nokia Corporation</copyright>
<license>
......
......@@ -37,7 +37,7 @@ namespace Constants {
#define IDE_VERSION_MAJOR 2
#define IDE_VERSION_MINOR 0
#define IDE_VERSION_RELEASE 90
#define IDE_VERSION_RELEASE 91
#define STRINGIFY_INTERNAL(x) #x
#define STRINGIFY(x) STRINGIFY_INTERNAL(x)
......
<plugin name="CodePaster" version="2.0.90" compatVersion="2.0.90">
<plugin name="CodePaster" version="2.0.91" compatVersion="2.0.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2010 Nokia Corporation</copyright>
<license>
......@@ -13,8 +13,8 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General
<description>Codepaster plugin for pushing/fetching diff from server</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="TextEditor" version="2.0.90"/>
<dependency name="ProjectExplorer" version="2.0.90"/>
<dependency name="Core" version="2.0.90"/>
<dependency name="TextEditor" version="2.0.91"/>
<dependency name="ProjectExplorer" version="2.0.91"/>
<dependency name="Core" version="2.0.91"/>
</dependencyList>
</plugin>
<plugin name="CppEditor" version="2.0.90" compatVersion="2.0.90">
<plugin name="CppEditor" version="2.0.91" compatVersion="2.0.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2010 Nokia Corporation</copyright>
<license>
......@@ -14,8 +14,8 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General
<description>C/C++ editor component.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="Core" version="2.0.90"/>
<dependency name="TextEditor" version="2.0.90"/>
<dependency name="CppTools" version="2.0.90"/>
<dependency name="Core" version="2.0.91"/>
<dependency name="TextEditor" version="2.0.91"/>
<dependency name="CppTools" version="2.0.91"/>
</dependencyList>
</plugin>
......@@ -51,13 +51,13 @@ using CppEditor::CppRefactoringChanges;
namespace {
class Operation: public CppQuickFixOperation
class InsertDeclOperation: public CppQuickFixOperation
{
public:
Operation(const CppQuickFixState &state, int priority,
const QString &targetFileName, const Class *targetSymbol,
InsertionPointLocator::AccessSpec xsSpec,
const QString &decl)
InsertDeclOperation(const CppQuickFixState &state, int priority,
const QString &targetFileName, const Class *targetSymbol,
InsertionPointLocator::AccessSpec xsSpec,
const QString &decl)
: CppQuickFixOperation(state, priority)
, m_targetFileName(targetFileName)
, m_targetSymbol(targetSymbol)
......@@ -81,12 +81,12 @@ public:
void performChanges(CppRefactoringFile *, CppRefactoringChanges *refactoring)
{
CppRefactoringFile targetFile = refactoring->file(m_targetFileName);
Document::Ptr targetDoc = targetFile.cppDocument();
InsertionPointLocator locator(targetDoc);
const InsertionLocation loc = locator.methodDeclarationInClass(m_targetSymbol, m_xsSpec);
InsertionPointLocator locator(state().snapshot());
const InsertionLocation loc = locator.methodDeclarationInClass(
m_targetFileName, m_targetSymbol, m_xsSpec);
Q_ASSERT(loc.isValid());
CppRefactoringFile targetFile = refactoring->file(m_targetFileName);
int targetPosition1 = targetFile.position(loc.line(), loc.column());
int targetPosition2 = qMax(0, targetFile.position(loc.line(), 1) - 1);
......@@ -151,24 +151,36 @@ QList<CppQuickFixOperation::Ptr> DeclFromDef::match(const CppQuickFixState &stat
const QString decl = generateDeclaration(state,
method,
targetBinding);
results.append(singleResult(new Operation(state, idx, fn, clazz,
InsertionPointLocator::Public,
decl)));
results.append(singleResult(new Operation(state, idx, fn, clazz,
InsertionPointLocator::Protected,
decl)));
results.append(singleResult(new Operation(state, idx, fn, clazz,
InsertionPointLocator::Private,
decl)));
results.append(singleResult(new Operation(state, idx, fn, clazz,
InsertionPointLocator::PublicSlot,
decl)));
results.append(singleResult(new Operation(state, idx, fn, clazz,
InsertionPointLocator::ProtectedSlot,
decl)));
results.append(singleResult(new Operation(state, idx, fn, clazz,
InsertionPointLocator::PrivateSlot,
decl)));
results.append(
singleResult(
new InsertDeclOperation(state, idx, fn, clazz,
InsertionPointLocator::Public,
decl)));
results.append(
singleResult(
new InsertDeclOperation(state, idx, fn, clazz,
InsertionPointLocator::Protected,
decl)));
results.append(
singleResult(
new InsertDeclOperation(state, idx, fn, clazz,
InsertionPointLocator::Private,
decl)));
results.append(
singleResult(
new InsertDeclOperation(state, idx, fn, clazz,
InsertionPointLocator::PublicSlot,
decl)));
results.append(
singleResult(
new InsertDeclOperation(state, idx, fn, clazz,
InsertionPointLocator::ProtectedSlot,
decl)));
results.append(
singleResult(
new InsertDeclOperation(state, idx, fn, clazz,
InsertionPointLocator::PrivateSlot,
decl)));
return results;
} //! \todo support insertion of non-methods into namespaces
}
......@@ -194,3 +206,171 @@ QString DeclFromDef::generateDeclaration(const CppQuickFixState &,
return decl;
}
namespace {
static inline bool hasFunctionType(DeclarationAST *decl)
{
if (decl->asFunctionDefinition())
return true;
if (SimpleDeclarationAST *ast = decl->asSimpleDeclaration())
if (ast->symbols && ast->symbols->value && !ast->symbols->next)
if (Declaration *decl = ast->symbols->value->asDeclaration())
if (FullySpecifiedType ty = decl->type())
return ty->asFunctionType();
return false;
}
static QPair<DeclarationAST *, DeclarationAST *> findSurroundingDeclarations(
DeclarationListAST *members,
DeclarationAST *decl)
{
bool found = false;
DeclarationAST *last = 0, *next = 0, *prev = 0;
DeclarationListAST *iter = members;
for (; iter; iter = iter->next) {
DeclarationAST *value = iter->value;
if (value == decl) {
prev = last;
found = true;
} else if (hasFunctionType(value)) {
if (found) {
next = value;
break;
} else {
last = value;
}
}
}
return qMakePair(prev, next);
}
} // anonymous namespace
QList<CppQuickFixOperation::Ptr> DefFromDecl::match(const CppQuickFixState &state)
{
#if 0
qDebug() << Q_FUNC_INFO;
const QList<AST *> &path = state.path();
const CppRefactoringFile &file = state.currentFile();
DeclaratorAST *declAST = 0;
ClassSpecifierAST *classSpec = 0;
int idx = path.size() - 1;
for (; idx >= 0; --idx) {
AST *node = path.at(idx);
if (ClassSpecifierAST *clazz = node->asClassSpecifier()) {
classSpec = clazz;
continue;
}
if (idx <= 1) continue;
DeclaratorIdAST *declId = node->asDeclaratorId();
if (!declId) continue;
if (!file.isCursorOn(declId)) continue;
DeclaratorAST *candidate = path.at(idx - 1)->asDeclarator();
if (!candidate) continue;
if (!candidate->postfix_declarator_list) continue;
if (!candidate->postfix_declarator_list->value) continue;
if (candidate->postfix_declarator_list->next) continue;
FunctionDeclaratorAST *funDecl = candidate->postfix_declarator_list->value->asFunctionDeclarator();
if (!funDecl) continue;
if (funDecl->symbol->asFunctionType())
declAST = candidate;
}
if (!declAST || !classSpec || !classSpec->symbol)
return noResult();
if (!declAST->symbols || !declAST->symbols->value || declAST->symbols->next)
return noResult();
Declaration *decl = declAST->symbols->value->asDeclaration();
if (!decl)
return noResult();
Function *funTy = decl->type()->asFunctionType();
if (!funTy)
return noResult();
qDebug() << "-> Found funTy.";
QPair<DeclarationAST *, DeclarationAST *> surroundingNodes =
findSurroundingDeclarations(classSpec->member_specifier_list, declAST);
qDebug() << "->("<<surroundingNodes.first<<","<<surroundingNodes.second<<")";
if (surroundingNodes.first)
if (SimpleDeclarationAST *sd = surroundingNodes.first->asSimpleDeclaration())
qDebug()<<"-->prev@"<<sd->symbols->value->line()<<sd->symbols->value->column();
if (surroundingNodes.second)
if (SimpleDeclarationAST *sd=surroundingNodes.second->asSimpleDeclaration())
qDebug()<<"-->next@"<<sd->symbols->value->line()<<sd->symbols->value->column();
#endif
// if (ClassOrNamespace *targetBinding = state.context().lookupParent(method)) {
// foreach (Symbol *s, targetBinding->symbols()) {
// if (Class *clazz = s->asClass()) {
// QList<CppQuickFixOperation::Ptr> results;
// const QLatin1String fn(clazz->fileName());
// const QString decl = generateDeclaration(state,
// method,
// targetBinding);
// results.append(
// singleResult(
// new InsertDeclOperation(state, idx, fn, clazz,
// InsertionPointLocator::Public,
// decl)));
// results.append(
// singleResult(
// new InsertDeclOperation(state, idx, fn, clazz,
// InsertionPointLocator::Protected,
// decl)));
// results.append(
// singleResult(
// new InsertDeclOperation(state, idx, fn, clazz,
// InsertionPointLocator::Private,
// decl)));
// results.append(
// singleResult(
// new InsertDeclOperation(state, idx, fn, clazz,
// InsertionPointLocator::PublicSlot,
// decl)));
// results.append(
// singleResult(
// new InsertDeclOperation(state, idx, fn, clazz,
// InsertionPointLocator::ProtectedSlot,
// decl)));
// results.append(
// singleResult(
// new InsertDeclOperation(state, idx, fn, clazz,
// InsertionPointLocator::PrivateSlot,
// decl)));
// return results;
// } //! \todo support insertion into namespaces
// }
// }
return noResult();
}
QString DefFromDecl::generateDefinition(const CppQuickFixState &,
Function *method,
ClassOrNamespace *targetBinding)
{
Q_UNUSED(targetBinding);
Overview oo;
oo.setShowFunctionSignatures(true);
oo.setShowReturnTypes(true);
oo.setShowArgumentNames(true);
QString decl;
decl += oo(method->type(), method->unqualifiedName());
decl += QLatin1String(";\n");
return decl;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment