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
b2e196f0
Commit
b2e196f0
authored
Sep 14, 2020
by
Christoph Cullmann
🐮
Browse files
ensure we don't assert for non-existing tab buttons
parent
14e0da66
Changes
1
Hide whitespace changes
Inline
Side-by-side
kate/kateviewspace.cpp
View file @
b2e196f0
...
...
@@ -364,17 +364,21 @@ void KateViewSpace::documentDestroyed(QObject *doc)
void
KateViewSpace
::
updateDocumentName
(
KTextEditor
::
Document
*
doc
)
{
// update tab button if available, might not be the case for tab limit set!
const
int
buttonId
=
m_tabBar
->
documentIdx
(
doc
);
Q_ASSERT
(
buttonId
>=
0
);
m_tabBar
->
setTabText
(
buttonId
,
doc
->
documentName
());
m_tabBar
->
setTabToolTip
(
buttonId
,
doc
->
url
().
toDisplayString
());
if
(
buttonId
>=
0
)
{
m_tabBar
->
setTabText
(
buttonId
,
doc
->
documentName
());
m_tabBar
->
setTabToolTip
(
buttonId
,
doc
->
url
().
toDisplayString
());
}
}
void
KateViewSpace
::
updateDocumentUrl
(
KTextEditor
::
Document
*
doc
)
{
// update tab button if available, might not be the case for tab limit set!
const
int
buttonId
=
m_tabBar
->
documentIdx
(
doc
);
Q_ASSERT
(
buttonId
>=
0
);
m_tabBar
->
setTabUrl
(
buttonId
,
doc
->
url
());
if
(
buttonId
>=
0
)
{
m_tabBar
->
setTabUrl
(
buttonId
,
doc
->
url
());
}
}
void
KateViewSpace
::
updateDocumentState
(
KTextEditor
::
Document
*
doc
)
...
...
@@ -384,8 +388,11 @@ void KateViewSpace::updateDocumentState(KTextEditor::Document *doc)
icon
=
QIcon
::
fromTheme
(
QStringLiteral
(
"document-save"
));
}
// update tab button if available, might not be the case for tab limit set!
const
int
buttonId
=
m_tabBar
->
documentIdx
(
doc
);
m_tabBar
->
setTabIcon
(
buttonId
,
icon
);
if
(
buttonId
>=
0
)
{
m_tabBar
->
setTabIcon
(
buttonId
,
icon
);
}
}
void
KateViewSpace
::
closeTabRequest
(
int
idx
)
...
...
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