Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
1c56c56c
Commit
1c56c56c
authored
Sep 27, 2010
by
dt
Browse files
Merge remote branch 'origin/2.1'
parents
ca8b342a
2c6a08df
Changes
54
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
1c56c56c
...
...
@@ -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
README
View file @
1c56c56c
Qt Creator 2.0.9
0
Qt Creator 2.0.9
1
===============
Qt Creator is a crossplatform C++ IDE for development with the Qt framework.
...
...
doc/qt-html-templates.qdocconf
View file @
1c56c56c
...
...
@@ -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.9
0
</a></span></li>\n" \
" <li class=\"shortCut-topleft-inactive\"><span><a href=\"index.html\">Qt Creator 2.0.9
1
</a></span></li>\n" \
" <li class=\"shortCut-topleft-active\"><a href=\"http://doc.qt.nokia.com\">ALL VERSIONS" \
" </a></li>\n" \
" </ul>\n" \
...
...
doc/qtcreator.qdoc
View file @
1c56c56c
...
...
@@ -39,7 +39,7 @@
\
title
Qt
Creator
Manual
\
section1
Version
2.0.9
0
\
section1
Version
2.0.9
1
Qt
Creator
provides
a
cross
-
platform
,
complete
integrated
development
environment
(
IDE
)
for
application
developers
to
create
applications
for
...
...
doc/qtcreator.qdocconf
View file @
1c56c56c
...
...
@@ -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.209
0
qhp.QtCreator.namespace = com.nokia.qtcreator.209
1
qhp.QtCreator.virtualFolder = doc
qhp.QtCreator.indexTitle = Qt Creator
qhp.QtCreator.filterAttributes = qtcreator 2.0.9
0
qhp.QtCreator.customFilters.QtCreator.name = Qt Creator 2.0.9
0
qhp.QtCreator.customFilters.QtCreator.filterAttributes = qtcreator 2.0.9
0
qhp.QtCreator.filterAttributes = qtcreator 2.0.9
1
qhp.QtCreator.customFilters.QtCreator.name = Qt Creator 2.0.9
1
qhp.QtCreator.customFilters.QtCreator.filterAttributes = qtcreator 2.0.9
1
qhp.QtCreator.indexRoot =
qhp.QtCreator.extraFiles = style/style.css \
style/style_ie6.css \
...
...
share/qtcreator/gdbmacros/dumper.py
View file @
1c56c56c
...
...
@@ -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)
...
...
share/qtcreator/templates/wizards/qtcreatorplugin/MyPlugin.pluginspec
View file @
1c56c56c
...
...
@@ -5,6 +5,6 @@
<description>%Description%</description>
<url>%URL%</url>
<dependencyList>
<dependency name="Core" version="2.0.9
0
"/>
<dependency name="Core" version="2.0.9
1
"/>
</dependencyList>
</plugin>
src/app/Info.plist
View file @
1c56c56c
...
...
@@ -212,8 +212,8 @@
<key>
CFBundleIdentifier
</key>
<string>
com.nokia.qtcreator
</string>
<key>
CFBundleVersion
</key>
<string>
2.0.9
0
</string>
<string>
2.0.9
1
</string>
<key>
CFBundleShortVersionString
</key>
<string>
2.0.9
0
</string>
<string>
2.0.9
1
</string>
</dict>
</plist>
src/libs/cplusplus/InsertionPointLocator.cpp
View file @
1c56c56c
...
...
@@ -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
;
}
src/libs/cplusplus/InsertionPointLocator.h
View file @
1c56c56c
...
...
@@ -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
...
...
src/plugins/bineditor/BinEditor.pluginspec
View file @
1c56c56c
<plugin name="BinEditor" version="2.0.9
0
" compatVersion="2.0.9
0
">
<plugin name="BinEditor" version="2.0.9
1
" compatVersion="2.0.9
1
">
<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.9
0
"/>
<dependency name="TextEditor" version="2.0.9
0
"/>
<dependency name="Core" version="2.0.9
1
"/>
<dependency name="TextEditor" version="2.0.9
1
"/>
</dependencyList>
</plugin>
src/plugins/bookmarks/Bookmarks.pluginspec
View file @
1c56c56c
<plugin name="Bookmarks" version="2.0.9
0
" compatVersion="2.0.9
0
">
<plugin name="Bookmarks" version="2.0.9
1
" compatVersion="2.0.9
1
">
<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.9
0
"/>
<dependency name="ProjectExplorer" version="2.0.9
0
"/>
<dependency name="Core" version="2.0.9
0
"/>
<dependency name="TextEditor" version="2.0.9
1
"/>
<dependency name="ProjectExplorer" version="2.0.9
1
"/>
<dependency name="Core" version="2.0.9
1
"/>
</dependencyList>
</plugin>
src/plugins/classview/ClassView.pluginspec
View file @
1c56c56c
<plugin name="ClassView" version="2.0.9
0
" compatVersion="2.0.9
0
">
<plugin name="ClassView" version="2.0.9
1
" compatVersion="2.0.9
1
">
<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.9
0
"/>
<dependency name="CppTools" version="2.0.9
0
"/>
<dependency name="ProjectExplorer" version="2.0.9
0
"/>
<dependency name="TextEditor" version="2.0.9
0
"/>
<dependency name="Core" version="2.0.9
1
"/>
<dependency name="CppTools" version="2.0.9
1
"/>
<dependency name="ProjectExplorer" version="2.0.9
1
"/>
<dependency name="TextEditor" version="2.0.9
1
"/>
</dependencyList>
</plugin>
src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec
View file @
1c56c56c
<plugin name="CMakeProjectManager" version="2.0.9
0
" compatVersion="2.0.9
0
">
<plugin name="CMakeProjectManager" version="2.0.9
1
" compatVersion="2.0.9
1
">
<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.9
0
"/>
<dependency name="ProjectExplorer" version="2.0.9
0
"/>
<dependency name="CppTools" version="2.0.9
0
"/>
<dependency name="CppEditor" version="2.0.9
0
"/>
<dependency name="TextEditor" version="2.0.9
1
"/>
<dependency name="ProjectExplorer" version="2.0.9
1
"/>
<dependency name="CppTools" version="2.0.9
1
"/>
<dependency name="CppEditor" version="2.0.9
1
"/>
</dependencyList>
</plugin>
src/plugins/cmakeprojectmanager/cmakeproject.cpp
View file @
1c56c56c
...
...
@@ -264,6 +264,7 @@ bool CMakeProject::parseCMakeLists()
}
emit
buildTargetsChanged
();
emit
fileListChanged
();
return
true
;
}
...
...
src/plugins/coreplugin/Core.pluginspec
View file @
1c56c56c
<plugin name="Core" version="2.0.9
0
" compatVersion="2.0.9
0
">
<plugin name="Core" version="2.0.9
1
" compatVersion="2.0.9
1
">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2010 Nokia Corporation</copyright>
<license>
...
...
src/plugins/coreplugin/coreconstants.h
View file @
1c56c56c
...
...
@@ -37,7 +37,7 @@ namespace Constants {
#define IDE_VERSION_MAJOR 2
#define IDE_VERSION_MINOR 0
#define IDE_VERSION_RELEASE 9
0
#define IDE_VERSION_RELEASE 9
1
#define STRINGIFY_INTERNAL(x) #x
#define STRINGIFY(x) STRINGIFY_INTERNAL(x)
...
...
src/plugins/cpaster/CodePaster.pluginspec
View file @
1c56c56c
<plugin name="CodePaster" version="2.0.9
0
" compatVersion="2.0.9
0
">
<plugin name="CodePaster" version="2.0.9
1
" compatVersion="2.0.9
1
">
<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.9
0
"/>
<dependency name="ProjectExplorer" version="2.0.9
0
"/>
<dependency name="Core" version="2.0.9
0
"/>
<dependency name="TextEditor" version="2.0.9
1
"/>
<dependency name="ProjectExplorer" version="2.0.9
1
"/>
<dependency name="Core" version="2.0.9
1
"/>
</dependencyList>
</plugin>
src/plugins/cppeditor/CppEditor.pluginspec
View file @
1c56c56c
<plugin name="CppEditor" version="2.0.9
0
" compatVersion="2.0.9
0
">
<plugin name="CppEditor" version="2.0.9
1
" compatVersion="2.0.9
1
">
<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.9
0
"/>
<dependency name="TextEditor" version="2.0.9
0
"/>
<dependency name="CppTools" version="2.0.9
0
"/>
<dependency name="Core" version="2.0.9
1
"/>
<dependency name="TextEditor" version="2.0.9
1
"/>
<dependency name="CppTools" version="2.0.9
1
"/>
</dependencyList>
</plugin>
src/plugins/cppeditor/cppinsertdecldef.cpp
View file @
1c56c56c
...
...
@@ -51,13 +51,13 @@ using CppEditor::CppRefactoringChanges;
namespace
{
class
Operation
:
public
CppQuickFixOperation
class
InsertDecl
Operation
:
public
CppQuickFixOperation
{
public:
Operation
(
const
CppQuickFixState
&
state
,
int
priority
,
const
QString
&
targetFileName
,
const
Class
*
targetSymbol
,
InsertionPointLocator
::
AccessSpec
xsSpec
,
const
QString
&
decl
)
InsertDecl
Operation
(
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
;
}
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel