Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
a63fc274
Commit
a63fc274
authored
Feb 06, 2021
by
Waqar Ahmed
Committed by
Christoph Cullmann
Feb 07, 2021
Browse files
Restore loading of open documents in quickopen
parent
8befc8b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
kate/quickopen/katequickopenmodel.cpp
View file @
a63fc274
...
...
@@ -74,6 +74,7 @@ void KateQuickOpenModel::refresh()
{
QObject
*
projectView
=
m_mainWindow
->
pluginView
(
QStringLiteral
(
"kateprojectplugin"
));
const
QList
<
KTextEditor
::
View
*>
sortedViews
=
m_mainWindow
->
viewManager
()
->
sortedViews
();
const
QList
<
KTextEditor
::
Document
*>
openDocs
=
KateApp
::
self
()
->
documentManager
()
->
documentList
();
const
QStringList
projectDocs
=
projectView
?
(
m_listMode
==
CurrentProject
?
projectView
->
property
(
"projectFiles"
)
:
projectView
->
property
(
"allProjectsFiles"
)).
toStringList
()
:
QStringList
();
...
...
@@ -96,15 +97,28 @@ void KateQuickOpenModel::refresh()
QVector
<
ModelEntry
>
allDocuments
;
allDocuments
.
reserve
(
sortedViews
.
size
()
+
projectDocs
.
size
());
Q
Vector
<
QUrl
>
openedDocUrls
;
Q
Set
<
QUrl
>
openedDocUrls
;
openedDocUrls
.
reserve
(
sortedViews
.
size
());
for
(
auto
*
view
:
qAsConst
(
sortedViews
))
{
auto
doc
=
view
->
document
();
const
auto
url
=
doc
->
url
();
if
(
openedDocUrls
.
contains
(
url
))
{
continue
;
}
openedDocUrls
.
insert
(
url
);
allDocuments
.
push_back
(
{
url
,
doc
->
documentName
(),
url
.
toDisplayString
(
QUrl
::
NormalizePathSegments
|
QUrl
::
PreferLocalFile
).
remove
(
projectBase
),
true
,
-
1
});
openedDocUrls
.
push_back
(
url
);
}
for
(
auto
*
doc
:
qAsConst
(
openDocs
))
{
auto
url
=
doc
->
url
();
if
(
openedDocUrls
.
contains
(
url
))
{
continue
;
}
openedDocUrls
.
insert
(
url
);
const
auto
normalizedUrl
=
url
.
toString
(
QUrl
::
NormalizePathSegments
|
QUrl
::
PreferLocalFile
).
remove
(
projectBase
);
allDocuments
.
push_back
({
doc
->
url
(),
doc
->
documentName
(),
normalizedUrl
,
true
,
-
1
});
}
for
(
const
auto
&
file
:
qAsConst
(
projectDocs
))
{
...
...
Write
Preview
Supports
Markdown
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