Skip to content
GitLab
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
4abbd6dc
Commit
4abbd6dc
authored
Sep 18, 2022
by
Christoph Cullmann
🍨
Committed by
Eric Armbruster
Sep 19, 2022
Browse files
ensure to really register all new documents
there were more code paths to open something via the view manager
parent
245243e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
apps/lib/kateviewmanager.cpp
View file @
4abbd6dc
...
...
@@ -348,17 +348,11 @@ void KateViewManager::slotDocumentClose()
KTextEditor
::
Document
*
KateViewManager
::
openUrl
(
const
QUrl
&
url
,
const
QString
&
encoding
,
bool
activate
,
bool
ignoreForRecentFiles
,
const
KateDocumentInfo
&
docInfo
)
{
auto
doc
=
KateApp
::
self
()
->
documentManager
()
->
openUrl
(
url
,
encoding
,
docInfo
);
auto
doc
=
openUrl
s
({
url
}
,
encoding
,
docInfo
);
if
(
!
doc
)
{
return
nullptr
;
}
// forward to currently active view space
activeViewSpace
()
->
registerDocument
(
doc
);
// to update open recent files on saving
connect
(
doc
,
&
KTextEditor
::
Document
::
documentSavedOrUploaded
,
this
,
&
KateViewManager
::
documentSavedOrUploaded
);
if
(
!
ignoreForRecentFiles
)
{
m_mainWindow
->
addRecentOpenedFile
(
doc
->
url
());
}
...
...
@@ -373,13 +367,17 @@ KateViewManager::openUrl(const QUrl &url, const QString &encoding, bool activate
KTextEditor
::
Document
*
KateViewManager
::
openUrls
(
const
QList
<
QUrl
>
&
urls
,
const
QString
&
encoding
,
const
KateDocumentInfo
&
docInfo
)
{
const
std
::
vector
<
KTextEditor
::
Document
*>
docs
=
KateApp
::
self
()
->
documentManager
()
->
openUrls
(
urls
,
encoding
,
docInfo
);
for
(
auto
doc
:
docs
)
{
// forward to currently active view space
activeViewSpace
()
->
registerDocument
(
doc
);
connect
(
doc
,
&
KTextEditor
::
Document
::
documentSavedOrUploaded
,
this
,
&
KateViewManager
::
documentSavedOrUploaded
);
}
return
docs
.
empty
()
?
nullptr
:
docs
.
back
();
}
KTextEditor
::
View
*
KateViewManager
::
openUrlWithView
(
const
QUrl
&
url
,
const
QString
&
encoding
)
{
KTextEditor
::
Document
*
doc
=
KateApp
::
self
()
->
documentManager
()
->
openUrl
(
url
,
encoding
);
KTextEditor
::
Document
*
doc
=
openUrls
({
url
},
encoding
);
if
(
!
doc
)
{
return
nullptr
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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