Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Friedrich W. H. Kossebau
kdevelop
Commits
38ffd39e
Commit
38ffd39e
authored
Dec 06, 2019
by
Thomas Schöps
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '5.4'
parents
360bf1b5
54597a6a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
+12
-9
kdevplatform/shell/textdocument.cpp
kdevplatform/shell/textdocument.cpp
+5
-0
kdevplatform/util/foregroundlock.cpp
kdevplatform/util/foregroundlock.cpp
+2
-1
plugins/clang/duchain/clangproblem.cpp
plugins/clang/duchain/clangproblem.cpp
+5
-8
No files found.
kdevplatform/shell/textdocument.cpp
View file @
38ffd39e
...
...
@@ -47,6 +47,8 @@
#include <language/interfaces/editorcontext.h>
#include <language/backgroundparser/backgroundparser.h>
#include <util/foregroundlock.h>
#include "core.h"
#include "mainwindow.h"
#include "uicontroller.h"
...
...
@@ -527,6 +529,7 @@ KTextEditor::Range TextDocument::textSelection() const
QString
TextDocument
::
text
(
const
KTextEditor
::
Range
&
range
)
const
{
VERIFY_FOREGROUND_LOCKED
Q_D
(
const
TextDocument
);
if
(
!
d
->
document
)
{
...
...
@@ -538,6 +541,7 @@ QString TextDocument::text(const KTextEditor::Range &range) const
QString
TextDocument
::
textLine
()
const
{
VERIFY_FOREGROUND_LOCKED
Q_D
(
const
TextDocument
);
if
(
!
d
->
document
)
{
...
...
@@ -555,6 +559,7 @@ QString TextDocument::textLine() const
QString
TextDocument
::
textWord
()
const
{
VERIFY_FOREGROUND_LOCKED
Q_D
(
const
TextDocument
);
if
(
!
d
->
document
)
{
...
...
kdevplatform/util/foregroundlock.cpp
View file @
38ffd39e
...
...
@@ -148,7 +148,8 @@ public:
bool
KDevelop
::
ForegroundLock
::
isLockedForThread
()
{
return
QThread
::
currentThread
()
==
holderThread
;
return
QThread
::
currentThread
()
==
holderThread
||
QThread
::
currentThread
()
==
QApplication
::
instance
()
->
thread
();
}
bool
KDevelop
::
ForegroundLock
::
tryLock
()
...
...
plugins/clang/duchain/clangproblem.cpp
View file @
38ffd39e
...
...
@@ -25,6 +25,7 @@
#include "util/clangtypes.h"
#include "util/clangdebug.h"
#include "util/clangutils.h"
#include <language/duchain/duchainlock.h>
#include <language/codegen/documentchangeset.h>
...
...
@@ -66,7 +67,7 @@ inline QString prettyDiagnosticSpelling(const QString& str)
return
ret
;
}
ClangFixits
fixitsForDiagnostic
(
CXDiagnostic
diagnostic
)
ClangFixits
fixitsForDiagnostic
(
CXDiagnostic
diagnostic
,
CXTranslationUnit
unit
)
{
ClangFixits
fixits
;
auto
numFixits
=
clang_getDiagnosticNumFixIts
(
diagnostic
);
...
...
@@ -74,12 +75,8 @@ ClangFixits fixitsForDiagnostic(CXDiagnostic diagnostic)
for
(
uint
i
=
0
;
i
<
numFixits
;
++
i
)
{
CXSourceRange
range
;
const
QString
replacementText
=
ClangString
(
clang_getDiagnosticFixIt
(
diagnostic
,
i
,
&
range
)).
toString
();
const
auto
docRange
=
ClangRange
(
range
).
toDocumentRange
();
auto
doc
=
KDevelop
::
ICore
::
self
()
->
documentController
()
->
documentForUrl
(
docRange
.
document
.
toUrl
());
const
QString
original
=
doc
?
doc
->
text
(
docRange
)
:
QString
{};
fixits
<<
ClangFixit
{
replacementText
,
docRange
,
QString
(),
original
};
QByteArray
original
=
ClangUtils
::
getRawContents
(
unit
,
range
);
fixits
<<
ClangFixit
{
replacementText
,
ClangRange
(
range
).
toDocumentRange
(),
QString
(),
QString
::
fromLocal8Bit
(
original
)};
}
return
fixits
;
}
...
...
@@ -168,7 +165,7 @@ ClangProblem::ClangProblem(CXDiagnostic diagnostic, CXTranslationUnit unit)
}
}
setFixits
(
fixitsForDiagnostic
(
diagnostic
));
setFixits
(
fixitsForDiagnostic
(
diagnostic
,
unit
));
setFinalLocation
(
docRange
);
setSource
(
IProblem
::
SemanticAnalysis
);
...
...
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