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
7b4a0604
Commit
7b4a0604
authored
Feb 25, 2021
by
Marcell Fülöp
Committed by
Christoph Cullmann
Feb 25, 2021
Browse files
recommended improvements
parent
fae09d2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
kate/session/katesessionmanager.cpp
View file @
7b4a0604
...
...
@@ -331,7 +331,7 @@ void KateSessionManager::saveSessionTo(KConfig *sc) const
// Clear the session file to avoid to accumulate outdated entries
for
(
const
auto
&
group
:
sc
->
groupList
())
{
// Don't delete groups for loaded documents that have
// V
e
iwSpace config in session but do not have any views.
// Vi
e
wSpace config in session but do not have any views.
if
(
!
isViewLessDocumentViewSpaceGroup
(
group
))
{
sc
->
deleteGroup
(
group
);
}
...
...
@@ -645,15 +645,21 @@ void KateSessionManager::updateJumpListActions(const QStringList &sessionList)
bool
KateSessionManager
::
isViewLessDocumentViewSpaceGroup
(
const
QString
&
group
)
{
if
(
!
group
.
startsWith
(
QStringLiteral
(
"MainWindow"
)))
return
false
;
if
(
KateApp
::
self
()
->
sessionManager
()
->
activeSession
()
->
isAnonymous
())
{
return
false
;
}
if
(
!
group
.
startsWith
(
QStringLiteral
(
"MainWindow"
)))
{
return
false
;
}
QRegExp
re
(
QStringLiteral
(
"^MainWindow
\\
d+-ViewSpace
\\
s
\\
d+
\\
s(.*)$"
));
if
(
group
.
indexOf
(
re
)
>
-
1
)
{
QUrl
url
(
re
.
cap
(
1
));
static
const
QRegularExpression
re
(
QStringLiteral
(
"^MainWindow
\\
d+
\\
-ViewSpace
\\
s
\\
d+
\\
s(.*)$"
));
QRegularExpressionMatch
match
=
re
.
match
(
group
);
if
(
match
.
hasMatch
())
{
QUrl
url
(
match
.
captured
(
1
));
auto
*
docMan
=
KateApp
::
self
()
->
documentManager
();
auto
*
doc
=
docMan
->
findDocument
(
url
);
bool
anonSession
=
KateApp
::
self
()
->
sessionManager
()
->
activeSession
()
->
isAnonymous
();
if
(
doc
&&
doc
->
views
().
empty
()
&&
docMan
->
documentList
().
contains
(
doc
)
&&
!
anonSession
)
{
if
(
doc
&&
doc
->
views
().
empty
()
&&
docMan
->
documentList
().
contains
(
doc
))
{
return
true
;
}
}
...
...
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