Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Christoph Roick
kdevelop
Commits
384e2db5
Commit
384e2db5
authored
Dec 07, 2020
by
Milian Wolff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup code and compare indexed declarations directly
parent
2536b760
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
plugins/quickopen/quickopenplugin.cpp
plugins/quickopen/quickopenplugin.cpp
+5
-11
No files found.
plugins/quickopen/quickopenplugin.cpp
View file @
384e2db5
...
...
@@ -808,12 +808,6 @@ void QuickOpenPlugin::jumpToNearestFunction(QuickOpenPlugin::FunctionJumpDirecti
struct
CreateOutlineDialog
{
CreateOutlineDialog
()
:
dialog
(
nullptr
)
,
cursorDecl
(
nullptr
)
,
model
(
nullptr
)
{
}
void
start
()
{
if
(
!
QuickOpenPlugin
::
self
()
->
freeModel
())
{
...
...
@@ -826,7 +820,7 @@ struct CreateOutlineDialog
return
;
}
KDevelop
::
DUChainReadLocker
lock
(
DUChain
::
lock
())
;
DUChainReadLocker
lock
;
TopDUContext
*
context
=
DUChainUtils
::
standardContextForUrl
(
doc
->
url
());
...
...
@@ -859,9 +853,9 @@ struct CreateOutlineDialog
void
finish
()
{
//Select the declaration that contains the cursor
if
(
cursorDecl
&&
dialog
)
{
if
(
cursorDecl
.
isValid
()
&&
dialog
)
{
auto
it
=
std
::
find_if
(
items
.
constBegin
(),
items
.
constEnd
(),
[
this
](
const
DUChainItem
&
item
)
{
return
item
.
m_item
.
data
()
==
cursorDecl
;
});
[
this
](
const
DUChainItem
&
item
)
{
return
item
.
m_item
==
cursorDecl
;
});
if
(
it
!=
items
.
constEnd
())
{
// Need to invoke the scrolling later. If we did it now, then it wouldn't have any effect,
// apparently because the widget internals aren't initialized yet properly (although we've
...
...
@@ -877,9 +871,9 @@ struct CreateOutlineDialog
}
}
QPointer
<
QuickOpenWidgetDialog
>
dialog
;
Declaration
*
cursorDecl
;
Indexed
Declaration
cursorDecl
;
QVector
<
DUChainItem
>
items
;
QuickOpenModel
*
model
;
QuickOpenModel
*
model
=
nullptr
;
};
class
OutlineQuickopenWidgetCreator
...
...
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