  public:
    SettingsDlg(QWidget *parent);
    void save();
    QSpinBox *fps;
    QSpinBox *log_size ;
    QSpinBox *cached_segment;
    QSpinBox *chart_height;
    QSpinBox *max_chart_x_range;
  };
  
 
</s> remove   int prev_row_count = messages.size();
 </s> add  </s> remove     messages = can->messages(msg_id);
  }
  int delta = messages.size() - prev_row_count;
  if (delta > 0) {
    beginInsertRows({}, prev_row_count, messages.size() - 1);
    endInsertRows();
  } else if (delta < 0) {
    beginRemoveRows({}, messages.size(), prev_row_count - 1);
    endRemoveRows();
 </s> add     uint64_t last_mono_time = messages.empty() ? 0 : messages.front().mono_time;
    auto new_msgs = fetchData(last_mono_time, (can->currentSec() + can->routeStartTime()) * 1e9);
    if ((has_more_data = !new_msgs.empty())) {
      beginInsertRows({}, 0, new_msgs.size() - 1);
      messages.insert(messages.begin(), std::move_iterator(new_msgs.begin()), std::move_iterator(new_msgs.end()));
      endInsertRows();
    } </s> remove 
      std::lock_guard lk(lock);
      auto &list = received_msgs[id];
      while (list.size() > settings.can_msg_log_size) {
        list.pop_back();
      }
      CanData &data = list.emplace_front();
 </s> add       CanData &data = (*new_msgs)[id];
  public:
    SettingsDlg(QWidget *parent);
    void save();
    QSpinBox *fps;

    QSpinBox *cached_segment;
    QSpinBox *chart_height;
    QSpinBox *max_chart_x_range;
  };
  
keep keep keep keep replace keep keep keep keep keep
 Cabana: display all logs in log view (#26659)

* fetch more

* clear log in showevent

* fix wrong time value

* check list size

* fix canmessages::process

* cache all events

* improve segment cache

* cleanup 
tools/cabana/settings.h