Skip to content

Commit

Permalink
Fix Toggle Diagnostics Action Check (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertBColton committed Mar 7, 2020
1 parent 6e955fa commit c0c406c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions MainWindow.cpp
Expand Up @@ -42,13 +42,15 @@ static QTextEdit *diagnosticTextEdit = nullptr;
static QAction *toggleDiagnosticsAction = nullptr;

void diagnosticHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg) {
if (toggleDiagnosticsAction && !toggleDiagnosticsAction->isChecked()) {
toggleDiagnosticsAction->setIcon(QIcon(":/actions/log-debug.png"));
toggleDiagnosticsAction->setToolTip(
QT_TR_NOOP("The editor encountered issues which have been logged in the diagnostics output."));
if (toggleDiagnosticsAction) {
if (!toggleDiagnosticsAction->isChecked()) {
toggleDiagnosticsAction->setIcon(QIcon(":/actions/log-debug.png"));
toggleDiagnosticsAction->setToolTip(
QT_TR_NOOP("The editor encountered issues which have been logged in the diagnostics output."));
}
} else {
// this should never happen!
// NOTE: if we used R_EXPECT_V here it would be recursive
// NOTE: if we used R_EXPECT_V here it would be infinite recursion
std::cerr << "Critical: Diagnostics toggle button does not exist!" << std::endl;
}

Expand Down

0 comments on commit c0c406c

Please sign in to comment.