Commit 10d6bc79 authored by Harald Sitter's avatar Harald Sitter 🏳️‍🌈
Browse files

quit giving out the debugger from the generator

it's leaky abstraction and makes porting to qml a bit more annoying
parent dc8579af
Pipeline #154067 passed with stage
in 5 minutes and 41 seconds
......@@ -202,3 +202,13 @@ void BacktraceGenerator::setBackendPrepared()
m_proc->start();
}
bool BacktraceGenerator::debuggerIsGDB() const
{
return m_debugger.codeName() == QLatin1String("gdb");
}
QString BacktraceGenerator::debuggerName() const
{
return m_debugger.displayName();
}
......@@ -49,14 +49,12 @@ public:
return m_parsedBacktrace;
}
const Debugger debugger() const
{
return m_debugger;
}
// Called by manager when it is ready for us.
void setBackendPrepared();
Q_INVOKABLE bool debuggerIsGDB() const;
Q_INVOKABLE QString debuggerName() const;
public Q_SLOTS:
void start();
......
......@@ -221,7 +221,7 @@ void BacktraceWidget::loadData()
}
// highlight if possible
if (m_btGenerator->debugger().codeName() == QLatin1String("gdb")) {
if (m_btGenerator->debuggerIsGDB()) {
KSyntaxHighlighting::Repository repository;
m_highlighter = new KSyntaxHighlighting::SyntaxHighlighter(ui.m_backtraceEdit->document());
m_highlighter->setTheme((palette().color(QPalette::Base).lightness() < 128) ? repository.defaultTheme(KSyntaxHighlighting::Repository::DarkTheme)
......@@ -322,7 +322,7 @@ void BacktraceWidget::loadData()
"<strong>You need to first install the debugger "
"application (%1) then click the <interface>Reload"
"</interface> button.</strong>",
m_btGenerator->debugger().displayName()));
m_btGenerator->debuggerName()));
}
ui.m_reloadBacktraceButton->setEnabled(true);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment