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
9e82505f
Commit
9e82505f
authored
Aug 06, 2022
by
Ahmad Samir
Committed by
Christoph Cullmann
Aug 07, 2022
Browse files
KateMDI: use an enum for some QAction::data()
parent
1dadb0fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
apps/lib/katemdi.cpp
View file @
9e82505f
...
...
@@ -796,7 +796,7 @@ bool Sidebar::eventFilter(QObject *obj, QEvent *ev)
if
(
!
tview
->
plugin
.
isNull
())
{
if
(
tview
->
plugin
.
data
()
->
configPages
()
>
0
)
{
menu
.
addAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"configure"
)),
i18n
(
"Configure..."
))
->
setData
(
20
);
menu
.
addAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"configure"
)),
i18n
(
"Configure..."
))
->
setData
(
ConfigureAction
);
}
}
...
...
@@ -804,9 +804,9 @@ bool Sidebar::eventFilter(QObject *obj, QEvent *ev)
const
QIcon
icon
=
tview
->
persistent
?
QIcon
::
fromTheme
(
QStringLiteral
(
"view-restore"
))
:
QIcon
::
fromTheme
(
QStringLiteral
(
"view-fullscreen"
));
const
QString
txt
=
tview
->
persistent
?
i18n
(
"Make Non-Persistent"
)
:
i18n
(
"Make Persistent"
);
menu
.
addAction
(
icon
,
txt
)
->
setData
(
10
);
menu
.
addAction
(
icon
,
txt
)
->
setData
(
PersistAction
);
menu
.
addAction
(
i18n
(
"Hide Button"
))
->
setData
(
11
);
menu
.
addAction
(
i18n
(
"Hide Button"
))
->
setData
(
HideButtonAction
);
addMoveActions
(
menu
,
position
());
...
...
@@ -843,12 +843,12 @@ void Sidebar::buttonPopupActivate(QAction *a)
}
// toggle persistent
if
(
id
==
10
)
{
if
(
id
==
PersistAction
)
{
w
->
persistent
=
!
w
->
persistent
;
}
// configure actionCollection
if
(
id
==
20
)
{
if
(
id
==
ConfigureAction
)
{
if
(
!
w
->
plugin
.
isNull
())
{
if
(
w
->
plugin
.
data
()
->
configPages
()
>
0
)
{
Q_EMIT
sigShowPluginConfigPage
(
w
->
plugin
.
data
(),
0
);
...
...
@@ -856,7 +856,7 @@ void Sidebar::buttonPopupActivate(QAction *a)
}
}
if
(
id
==
11
)
{
if
(
id
==
HideButtonAction
)
{
showToolviewTab
(
w
,
false
);
}
}
...
...
apps/lib/katemdi.h
View file @
9e82505f
...
...
@@ -266,6 +266,12 @@ private Q_SLOTS:
void
buttonPopupActivate
(
QAction
*
);
private:
enum
ActionIds
{
PersistAction
=
10
,
HideButtonAction
=
11
,
ConfigureAction
=
20
,
};
MainWindow
*
m_mainWin
;
KMultiTabBar
::
KMultiTabBarPosition
m_pos
{};
...
...
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