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
2c899011
Commit
2c899011
authored
Nov 04, 2022
by
Eric Armbruster
🍁
Browse files
Allow setting breakpoints from the icon border
Adds a convenient way to set a breakpoint.
parent
f515898b
Changes
2
Hide whitespace changes
Inline
Side-by-side
addons/gdbplugin/plugin_kategdb.cpp
View file @
2c899011
...
...
@@ -292,6 +292,13 @@ KatePluginGDBView::KatePluginGDBView(KTextEditor::Plugin *plugin, KTextEditor::M
connect
(
m_mainWin
,
&
KTextEditor
::
MainWindow
::
unhandledShortcutOverride
,
this
,
&
KatePluginGDBView
::
handleEsc
);
const
auto
documents
=
KTextEditor
::
Editor
::
instance
()
->
application
()
->
documents
();
for
(
auto
doc
:
documents
)
{
enableBreakpointMarks
(
doc
);
}
connect
(
KTextEditor
::
Editor
::
instance
()
->
application
(),
&
KTextEditor
::
Application
::
documentCreated
,
this
,
&
KatePluginGDBView
::
enableBreakpointMarks
);
m_toolView
->
installEventFilter
(
this
);
m_mainWin
->
guiFactory
()
->
addClient
(
this
);
...
...
@@ -396,8 +403,6 @@ void KatePluginGDBView::slotBreakpointSet(const QUrl &file, int line)
KTextEditor
::
MarkInterfaceV2
*
iface
=
qobject_cast
<
KTextEditor
::
MarkInterfaceV2
*>
(
m_kateApplication
->
findUrl
(
file
));
if
(
iface
)
{
iface
->
setMarkDescription
(
KTextEditor
::
MarkInterface
::
BreakpointActive
,
i18n
(
"Breakpoint"
));
iface
->
setMarkIcon
(
KTextEditor
::
MarkInterface
::
BreakpointActive
,
QIcon
::
fromTheme
(
QStringLiteral
(
"media-playback-pause"
)));
iface
->
addMark
(
line
,
KTextEditor
::
MarkInterface
::
BreakpointActive
);
}
}
...
...
@@ -818,6 +823,17 @@ void KatePluginGDBView::handleEsc(QEvent *e)
}
}
void
KatePluginGDBView
::
enableBreakpointMarks
(
KTextEditor
::
Document
*
document
)
{
KTextEditor
::
MarkInterfaceV2
*
iface
=
qobject_cast
<
KTextEditor
::
MarkInterfaceV2
*>
(
document
);
if
(
iface
)
{
iface
->
setEditableMarks
(
iface
->
editableMarks
()
|
KTextEditor
::
MarkInterface
::
BreakpointActive
);
iface
->
setMarkDescription
(
KTextEditor
::
MarkInterface
::
BreakpointActive
,
i18n
(
"Breakpoint"
));
iface
->
setMarkIcon
(
KTextEditor
::
MarkInterface
::
BreakpointActive
,
QIcon
::
fromTheme
(
QStringLiteral
(
"media-playback-pause"
)));
}
}
void
KatePluginGDBView
::
displayMessage
(
const
QString
&
msg
,
KTextEditor
::
Message
::
MessageType
level
)
{
KTextEditor
::
View
*
kv
=
m_mainWin
->
activeView
();
...
...
addons/gdbplugin/plugin_kategdb.h
View file @
2c899011
...
...
@@ -90,6 +90,7 @@ private Q_SLOTS:
void
addErrorText
(
QString
const
&
text
);
void
clearMarks
();
void
handleEsc
(
QEvent
*
e
);
void
enableBreakpointMarks
(
KTextEditor
::
Document
*
document
);
protected:
bool
eventFilter
(
QObject
*
obj
,
QEvent
*
ev
)
override
;
...
...
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