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
Education
Cantor
Commits
4f40d69c
Commit
4f40d69c
authored
Feb 21, 2020
by
Nikita Sirgienko
Browse files
Fix problem with missing backend icon for created sessions
parent
83575703
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/cantor.cpp
View file @
4f40d69c
...
...
@@ -351,6 +351,9 @@ void CantorShell::addWorksheet(const QString& backendName)
// Setting focus on worksheet view, because Qt clear focus of added widget inside addTab
// This fix https://bugs.kde.org/show_bug.cgi?id=395976
part
->
widget
()
->
findChild
<
QGraphicsView
*>
()
->
setFocus
();
// Force run updateCaption for getting proper backend icon
QMetaObject
::
invokeMethod
(
part
,
"updateCaption"
);
}
else
{
...
...
@@ -405,12 +408,11 @@ void CantorShell::activateWorksheet(int index)
void
CantorShell
::
setTabCaption
(
const
QString
&
caption
,
const
QIcon
&
icon
)
{
if
(
caption
.
isEmpty
())
return
;
KParts
::
ReadWritePart
*
part
=
dynamic_cast
<
KParts
::
ReadWritePart
*>
(
sender
());
if
(
part
)
{
m_tabWidget
->
setTabText
(
m_tabWidget
->
indexOf
(
part
->
widget
()),
caption
);
if
(
!
caption
.
isEmpty
())
m_tabWidget
->
setTabText
(
m_tabWidget
->
indexOf
(
part
->
widget
()),
caption
);
m_tabWidget
->
setTabIcon
(
m_tabWidget
->
indexOf
(
part
->
widget
()),
icon
);
}
}
...
...
src/cantor_part.cpp
View file @
4f40d69c
...
...
@@ -724,11 +724,11 @@ void CantorPart::updateCaption()
//strip away the extension
filename
=
filename
.
left
(
filename
.
lastIndexOf
(
QLatin1Char
(
'.'
)));
if
(
filename
.
isEmpty
())
filename
=
i18n
(
"Unnamed"
);
if
(
!
m_worksheet
->
isReadOnly
())
emit
setCaption
(
filename
,
QIcon
::
fromTheme
(
m_worksheet
->
session
()
->
backend
()
->
icon
()));
{
if
(
m_worksheet
->
session
())
emit
setCaption
(
filename
,
QIcon
::
fromTheme
(
m_worksheet
->
session
()
->
backend
()
->
icon
()));
}
else
emit
setCaption
(
filename
+
QLatin1Char
(
' '
)
+
i18n
(
"[read-only]"
),
QIcon
());
}
...
...
src/cantor_part.h
View file @
4f40d69c
...
...
@@ -84,6 +84,9 @@ Q_SIGNALS:
void
showHelp
(
const
QString
&
help
);
void
worksheetSave
(
const
QUrl
&
url
);
public
Q_SLOTS
:
void
updateCaption
();
protected:
/**
* This must be implemented by each part
...
...
@@ -123,7 +126,6 @@ protected Q_SLOTS:
void
worksheetSessionLoginStarted
();
void
worksheetSessionLoginDone
();
void
initialized
();
void
updateCaption
();
void
pluginsChanged
();
void
runCommand
(
const
QString
&
value
);
...
...
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