Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Cantor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Education
Cantor
Commits
4f40d69c
Commit
4f40d69c
authored
Feb 21, 2020
by
Nikita Sirgienko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix problem with missing backend icon for created sessions
parent
83575703
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
src/cantor.cpp
src/cantor.cpp
+5
-3
src/cantor_part.cpp
src/cantor_part.cpp
+4
-4
src/cantor_part.h
src/cantor_part.h
+3
-1
No files found.
src/cantor.cpp
View file @
4f40d69c
...
@@ -351,6 +351,9 @@ void CantorShell::addWorksheet(const QString& backendName)
...
@@ -351,6 +351,9 @@ void CantorShell::addWorksheet(const QString& backendName)
// Setting focus on worksheet view, because Qt clear focus of added widget inside addTab
// 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
// This fix https://bugs.kde.org/show_bug.cgi?id=395976
part
->
widget
()
->
findChild
<
QGraphicsView
*>
()
->
setFocus
();
part
->
widget
()
->
findChild
<
QGraphicsView
*>
()
->
setFocus
();
// Force run updateCaption for getting proper backend icon
QMetaObject
::
invokeMethod
(
part
,
"updateCaption"
);
}
}
else
else
{
{
...
@@ -405,12 +408,11 @@ void CantorShell::activateWorksheet(int index)
...
@@ -405,12 +408,11 @@ void CantorShell::activateWorksheet(int index)
void
CantorShell
::
setTabCaption
(
const
QString
&
caption
,
const
QIcon
&
icon
)
void
CantorShell
::
setTabCaption
(
const
QString
&
caption
,
const
QIcon
&
icon
)
{
{
if
(
caption
.
isEmpty
())
return
;
KParts
::
ReadWritePart
*
part
=
dynamic_cast
<
KParts
::
ReadWritePart
*>
(
sender
());
KParts
::
ReadWritePart
*
part
=
dynamic_cast
<
KParts
::
ReadWritePart
*>
(
sender
());
if
(
part
)
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
);
m_tabWidget
->
setTabIcon
(
m_tabWidget
->
indexOf
(
part
->
widget
()),
icon
);
}
}
}
}
...
...
src/cantor_part.cpp
View file @
4f40d69c
...
@@ -724,11 +724,11 @@ void CantorPart::updateCaption()
...
@@ -724,11 +724,11 @@ void CantorPart::updateCaption()
//strip away the extension
//strip away the extension
filename
=
filename
.
left
(
filename
.
lastIndexOf
(
QLatin1Char
(
'.'
)));
filename
=
filename
.
left
(
filename
.
lastIndexOf
(
QLatin1Char
(
'.'
)));
if
(
filename
.
isEmpty
())
filename
=
i18n
(
"Unnamed"
);
if
(
!
m_worksheet
->
isReadOnly
())
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
else
emit
setCaption
(
filename
+
QLatin1Char
(
' '
)
+
i18n
(
"[read-only]"
),
QIcon
());
emit
setCaption
(
filename
+
QLatin1Char
(
' '
)
+
i18n
(
"[read-only]"
),
QIcon
());
}
}
...
...
src/cantor_part.h
View file @
4f40d69c
...
@@ -84,6 +84,9 @@ Q_SIGNALS:
...
@@ -84,6 +84,9 @@ Q_SIGNALS:
void
showHelp
(
const
QString
&
help
);
void
showHelp
(
const
QString
&
help
);
void
worksheetSave
(
const
QUrl
&
url
);
void
worksheetSave
(
const
QUrl
&
url
);
public
Q_SLOTS
:
void
updateCaption
();
protected:
protected:
/**
/**
* This must be implemented by each part
* This must be implemented by each part
...
@@ -123,7 +126,6 @@ protected Q_SLOTS:
...
@@ -123,7 +126,6 @@ protected Q_SLOTS:
void
worksheetSessionLoginStarted
();
void
worksheetSessionLoginStarted
();
void
worksheetSessionLoginDone
();
void
worksheetSessionLoginDone
();
void
initialized
();
void
initialized
();
void
updateCaption
();
void
pluginsChanged
();
void
pluginsChanged
();
void
runCommand
(
const
QString
&
value
);
void
runCommand
(
const
QString
&
value
);
...
...
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