mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
drkonqi: highlight signals from LLDB output
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
6877554745
commit
422237177c
2 changed files with 14 additions and 2 deletions
|
@ -28,6 +28,7 @@ LldbHighlighter::LldbHighlighter(QTextDocument* parent, const QList<BacktraceLin
|
||||||
|
|
||||||
KColorScheme kcolorscheme(QPalette::Active);
|
KColorScheme kcolorscheme(QPalette::Active);
|
||||||
m_crapformat.setForeground(kcolorscheme.foreground(KColorScheme::InactiveText));
|
m_crapformat.setForeground(kcolorscheme.foreground(KColorScheme::InactiveText));
|
||||||
|
m_signalformat.setForeground(kcolorscheme.foreground(KColorScheme::NegativeText));
|
||||||
m_idformat.setForeground(kcolorscheme.foreground(KColorScheme::PositiveText));
|
m_idformat.setForeground(kcolorscheme.foreground(KColorScheme::PositiveText));
|
||||||
m_hexformat.setForeground(kcolorscheme.foreground(KColorScheme::NegativeText));
|
m_hexformat.setForeground(kcolorscheme.foreground(KColorScheme::NegativeText));
|
||||||
m_hexformat.setFontWeight(QFont::Bold);
|
m_hexformat.setFontWeight(QFont::Bold);
|
||||||
|
@ -40,11 +41,21 @@ LldbHighlighter::LldbHighlighter(QTextDocument* parent, const QList<BacktraceLin
|
||||||
void LldbHighlighter::highlightBlock(const QString &text)
|
void LldbHighlighter::highlightBlock(const QString &text)
|
||||||
{
|
{
|
||||||
// qDebug() << Q_FUNC_INFO << text << currentBlock().position() << currentBlock().length();
|
// qDebug() << Q_FUNC_INFO << text << currentBlock().position() << currentBlock().length();
|
||||||
if (!text.contains(QLatin1String(" thread #"))
|
const bool hasthread = text.contains(QLatin1String(" thread #"));
|
||||||
&& !text.contains(QLatin1String(" frame #"))) {
|
if (!hasthread && !text.contains(QLatin1String(" frame #"))) {
|
||||||
setFormat(0, text.length(), m_crapformat);
|
setFormat(0, text.length(), m_crapformat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hasthread) {
|
||||||
|
int partlength = 0;
|
||||||
|
foreach (const QString &textpart, text.split(QLatin1Char(' '))) {
|
||||||
|
if (textpart.startsWith(QLatin1String("SIG"))) {
|
||||||
|
setFormat(partlength, textpart.length(), m_signalformat);
|
||||||
|
}
|
||||||
|
partlength += (textpart.length() + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int partlength = 0;
|
int partlength = 0;
|
||||||
int partscounter = 0;
|
int partscounter = 0;
|
||||||
const QStringList textparts = text.split(QLatin1Char(' '));
|
const QStringList textparts = text.split(QLatin1Char(' '));
|
||||||
|
|
|
@ -34,6 +34,7 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QTextCharFormat m_crapformat;
|
QTextCharFormat m_crapformat;
|
||||||
|
QTextCharFormat m_signalformat;
|
||||||
QTextCharFormat m_idformat;
|
QTextCharFormat m_idformat;
|
||||||
QTextCharFormat m_hexformat;
|
QTextCharFormat m_hexformat;
|
||||||
QTextCharFormat m_libraryformat;
|
QTextCharFormat m_libraryformat;
|
||||||
|
|
Loading…
Add table
Reference in a new issue