Commit cf360ee9 authored by Lorenz Meier's avatar Lorenz Meier

Toolbar: Ensure initialization sequence

parent d5715d5c
......@@ -470,7 +470,9 @@ void QGCToolBar::updateView()
// toolBarStateLabel->setText(QString("%1").arg(state));
toolBarModeLabel->setText(QString("%1").arg(mode));
if (mode.size() > 0) {
toolBarModeLabel->setText(QString("%1").arg(mode));
}
toolBarNameLabel->setText(systemName);
// expire after 15 seconds
......@@ -541,8 +543,16 @@ void QGCToolBar::updateMode(int system, QString name, QString description)
{
Q_UNUSED(system);
Q_UNUSED(description);
if (mode != name) changed = true;
mode = name;
if (name.size() == 0) {
qDebug() << "EMPTY MODE, RETURN";
}
QString shortMode = name;
shortMode = shortMode.replace("D|", "");
shortMode = shortMode.replace("A|", "");
if (mode != shortMode) changed = true;
mode = shortMode;
/* important, immediately update */
updateView();
}
......
Markdown is supported
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