Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
flatpak-qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marco Bubke
flatpak-qt-creator
Commits
77942894
Commit
77942894
authored
14 years ago
by
Roberto Raggi
Browse files
Options
Downloads
Patches
Plain Diff
Get rid of Oveview::prettyTypeWithName() and LookupContext::minimalName()
parent
d3761d10
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/libs/cplusplus/Overview.cpp
+0
-21
0 additions, 21 deletions
src/libs/cplusplus/Overview.cpp
src/libs/cplusplus/Overview.h
+0
-4
0 additions, 4 deletions
src/libs/cplusplus/Overview.h
src/plugins/cppeditor/cppdeclfromdef.cpp
+9
-39
9 additions, 39 deletions
src/plugins/cppeditor/cppdeclfromdef.cpp
with
9 additions
and
64 deletions
src/libs/cplusplus/Overview.cpp
+
0
−
21
View file @
77942894
...
...
@@ -150,24 +150,3 @@ QString Overview::prettyType(const FullySpecifiedType &ty,
return
pp
(
ty
,
name
);
}
/**
* Pretty-prints the given fully-specified type, but replacing the contained
* type with the given name.
*
* \param type the fully-specified type to convert to string
* \param the name for the named-type to use
* \param the control where the name is registered
* \return the pretty-printed name
*
* \todo Remove this method, and do it "for real" using the class CPlusPlus::Rewrite.
*/
QString
Overview
::
prettyTypeWithName
(
const
FullySpecifiedType
&
type
,
const
Name
*
name
,
Control
*
control
)
{
NamedType
*
namedTy
=
control
->
namedType
(
name
);
FullySpecifiedType
newTy
=
type
;
newTy
.
setType
(
namedTy
);
return
prettyType
(
newTy
);
}
This diff is collapsed.
Click to expand it.
src/libs/cplusplus/Overview.h
+
0
−
4
View file @
77942894
...
...
@@ -80,10 +80,6 @@ public:
QString
prettyType
(
const
FullySpecifiedType
&
type
,
const
Name
*
name
=
0
)
const
;
QString
prettyType
(
const
FullySpecifiedType
&
type
,
const
QString
&
name
)
const
;
QString
prettyTypeWithName
(
const
FullySpecifiedType
&
type
,
const
Name
*
name
,
Control
*
control
);
private
:
unsigned
_markedArgument
;
int
_markedArgumentBegin
;
...
...
This diff is collapsed.
Click to expand it.
src/plugins/cppeditor/cppdeclfromdef.cpp
+
9
−
39
View file @
77942894
...
...
@@ -54,23 +54,6 @@ using CppEditor::CppRefactoringChanges;
namespace
{
//! \todo This method should probably be changed when Overview#prettyTypeWithName is removed.
QString
prettyMinimalType
(
const
FullySpecifiedType
&
ty
,
const
LookupContext
&
context
,
Scope
*
source
,
ClassOrNamespace
*
target
)
{
Overview
oo
;
if
(
const
NamedType
*
namedTy
=
ty
->
asNamedType
())
return
oo
.
prettyTypeWithName
(
ty
,
context
.
minimalName
(
namedTy
->
name
(),
source
,
target
),
context
.
control
().
data
());
else
return
oo
(
ty
);
}
class
Operation
:
public
CppQuickFixOperation
{
public:
...
...
@@ -103,7 +86,7 @@ public:
changes
->
changeFile
(
m_targetFileName
,
target
);
changes
->
reindent
(
m_targetFileName
,
Utils
::
ChangeSet
::
Range
(
targetPosition
1
,
targetPosition
2
));
Utils
::
ChangeSet
::
Range
(
targetPosition
2
,
targetPosition
1
));
changes
->
openEditor
(
m_targetFileName
,
loc
.
line
(),
loc
.
column
());
}
...
...
@@ -157,29 +140,16 @@ QString DeclFromDef::generateDeclaration(const CppQuickFixState &state,
Function
*
method
,
ClassOrNamespace
*
targetBinding
)
{
Q_UNUSED
(
targetBinding
);
Overview
oo
;
QString
decl
;
oo
.
setShowFunctionSignatures
(
true
);
oo
.
setShowReturnTypes
(
true
);
oo
.
setShowArgumentNames
(
true
);
decl
.
append
(
prettyMinimalType
(
method
->
returnType
(),
state
.
context
(),
method
->
scope
(),
targetBinding
));
decl
.
append
(
QLatin1Char
(
' '
));
decl
.
append
(
QLatin1String
(
method
->
name
()
->
identifier
()
->
chars
()));
decl
.
append
(
QLatin1Char
(
'('
));
for
(
unsigned
argIdx
=
0
;
argIdx
<
method
->
argumentCount
();
++
argIdx
)
{
if
(
argIdx
>
0
)
decl
.
append
(
QLatin1String
(
", "
));
Argument
*
arg
=
method
->
argumentAt
(
argIdx
)
->
asArgument
();
decl
.
append
(
prettyMinimalType
(
arg
->
type
(),
state
.
context
(),
method
->
members
(),
targetBinding
));
decl
.
append
(
QLatin1Char
(
' '
));
decl
.
append
(
oo
(
arg
->
name
()));
}
decl
.
append
(
QLatin1String
(
");
\n\n
"
));
QString
decl
;
decl
+=
oo
(
method
->
type
(),
method
->
identity
());
decl
+=
QLatin1String
(
";
\n
"
);
return
decl
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment