Skip to content

Commit

Permalink
fix: also support ' and , as branch visualization characters
Browse files Browse the repository at this point in the history
My objdump from arch uses these chars now, so let's support them too
  • Loading branch information
milianw committed Sep 2, 2024
1 parent 221d60e commit f326ef0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/resultsdisassemblypage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,11 @@ class BranchDelegate : public QStyledItemDelegate
startHorizontalLine(x);
verticalLine();
break;
case '\'':
case '\\':
topRightEdge();
break;
case ',':
case '/':
bottomLeftEdge();
break;
Expand Down
7 changes: 4 additions & 3 deletions tests/modeltests/tst_disassemblyoutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,10 @@ private slots:
QVERIFY(result.errorMessage.isEmpty());

auto isValidVisualisationCharacter = [](QChar character) {
const static auto validCharacters = std::initializer_list<QChar> {
QLatin1Char(' '), QLatin1Char('\t'), QLatin1Char('|'), QLatin1Char('/'), QLatin1Char('\\'),
QLatin1Char('-'), QLatin1Char('>'), QLatin1Char('+'), QLatin1Char('X')};
const static auto validCharacters =
std::initializer_list<QChar> {QLatin1Char(' '), QLatin1Char('\t'), QLatin1Char('|'), QLatin1Char('/'),
QLatin1Char('\\'), QLatin1Char('-'), QLatin1Char('>'), QLatin1Char('+'),
QLatin1Char('X'), QLatin1Char(','), QLatin1Char('\'')};

return std::any_of(validCharacters.begin(), validCharacters.end(),
[character](auto validCharacter) { return character == validCharacter; });
Expand Down

0 comments on commit f326ef0

Please sign in to comment.