Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
kdevelop
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Schöps
kdevelop
Commits
9577677d
Commit
9577677d
authored
Aug 18, 2019
by
Friedrich W. H. Kossebau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid repeated lookup of the MIME type by sourceFormatterController
parent
207c78ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
kdevplatform/language/codegen/documentchangeset.cpp
kdevplatform/language/codegen/documentchangeset.cpp
+4
-5
No files found.
kdevplatform/language/codegen/documentchangeset.cpp
View file @
9577677d
...
...
@@ -392,17 +392,16 @@ DocumentChangeSet::ChangeResult DocumentChangeSetPrivate::generateNewText(const
const
CodeRepresentation
*
repr
,
QString
&
output
)
{
ISourceFormatter
*
formatter
=
nullptr
;
if
(
ICore
::
self
())
{
formatter
=
ICore
::
self
()
->
sourceFormatterController
()
->
formatterForUrl
(
file
.
toUrl
());
}
//Create the actual new modified file
QStringList
textLines
=
repr
->
text
().
split
(
QLatin1Char
(
'\n'
));
QUrl
url
=
file
.
toUrl
();
QMimeType
mime
=
QMimeDatabase
().
mimeTypeForUrl
(
url
);
auto
core
=
ICore
::
self
();
ISourceFormatter
*
formatter
=
core
?
core
->
sourceFormatterController
()
->
formatterForUrl
(
file
.
toUrl
(),
mime
)
:
nullptr
;
QVector
<
int
>
removedLines
;
for
(
int
pos
=
sortedChanges
.
size
()
-
1
;
pos
>=
0
;
--
pos
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment