Skip to content

Commit

Permalink
minor typo correction: unknown
Browse files Browse the repository at this point in the history
additional: reordered checks in brushSystem
  • Loading branch information
GitMensch committed Oct 24, 2023
1 parent cdc66a4 commit ffc17c4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
11 changes: 4 additions & 7 deletions src/flamegraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,15 +377,12 @@ QBrush brushSystem(const Data::Symbol& symbol)
{
static const auto system = QBrush(QColor(0, 125, 0, 125));
static const auto user = QBrush(QColor(200, 200, 0, 125));
static const auto unkown = QBrush(QColor(50, 50, 50, 125));
static const auto unknown = QBrush(QColor(50, 50, 50, 125));

// I have seen [ only on kernel calls
// remark lievenhey: I have seen [ only on kernel calls
if (symbol.path.isEmpty() || symbol.path.startsWith(QLatin1Char('['))) {
return unkown;
} else if (isSystemPath(symbol.path)) {
if (isUserPath(symbol.path)) {
return user;
}
return unknown;
} else if (!isUserPath(symbol.path) && isSystemPath(symbol.path)) {
return system;
}
return user;
Expand Down
9 changes: 4 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ int main(int argc, char** argv)
<< parser.helpText();
return 1;
}
const auto originalArguments = QCoreApplication::arguments();
// remove leading executable name and trailing positional arguments
const auto minimalArguments = originalArguments.mid(1, originalArguments.size() - 1 - files.size());

auto* guiApp = qobject_cast<QApplication*>(app.get());
MainWindow* window = nullptr;
Expand All @@ -202,12 +205,8 @@ int main(int argc, char** argv)
window = new MainWindow();
}

const auto originalArguments = QCoreApplication::arguments();
// remove leading executable name and trailing positional arguments
const auto minimalArguments = originalArguments.mid(1, originalArguments.size() - 1 - files.size());

// spawn new instances if we have more than one file argument
while (files.size() > 1) {
// spawn new instances if we have more than one file argument
const auto file = files.takeLast();
MainWindow::openInNewWindow(file, minimalArguments);
}
Expand Down
2 changes: 1 addition & 1 deletion src/resultsdisassemblypage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ ResultsDisassemblyPage::ResultsDisassemblyPage(CostContextMenu* costContextMenu,
m_stackIndex++;
emit stackChanged();
} else {
ui->symbolNotFound->setText(tr("unkown symbol %1").arg(functionName));
ui->symbolNotFound->setText(tr("unknown symbol %1").arg(functionName));
ui->symbolNotFound->show();
}
}
Expand Down

0 comments on commit ffc17c4

Please sign in to comment.