-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mon_gui] Logging enable, crash fix #1878
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
@@ -241,7 +241,9 @@ void LogModel::insertLogs(const eCAL::pb::LogMessageList& logging_pb) | |||
// Add new elements to the bottom | |||
size_before = logs_.size(); | |||
int size_after = (size_before + inserted_row_count < max_entries_ ? size_before + inserted_row_count : max_entries_); | |||
beginInsertRows(QModelIndex(), size_before, size_after - 1); | |||
bool insert_row = size_before <= size_after - 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'insert_row' of type 'bool' can be declared 'const' [misc-const-correctness]
bool insert_row = size_before <= size_after - 1; | |
;const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 😃
Description
Enable logging receiving in mon_gui.
Check size of rows before adding them in log_model.cpp . Without that size check, in debug the monitor crashed through an assert.