break;
}
- current_chunk_ = &(data_->chunks[current_chunk_id_]);
+ current_chunk_ = data_->chunks[current_chunk_id_];
}
uint8_t QHexView::get_next_byte(bool* is_next_chunk)
if (is_next_chunk != nullptr)
*is_next_chunk = (current_chunk_offset_ == 0);
- uint8_t v = current_chunk_->data[current_chunk_offset_];
+ uint8_t v = current_chunk_.data[current_chunk_offset_];
current_offset_++;
current_chunk_offset_++;
- if (current_chunk_offset_ == current_chunk_->data.size()) {
+ if (current_chunk_offset_ == current_chunk_.data.size()) {
current_chunk_id_++;
current_chunk_offset_ = 0;
- current_chunk_ = &(data_->chunks[current_chunk_id_]);
+ current_chunk_ = data_->chunks[current_chunk_id_];
}
return v;
size_t selectBegin_, selectEnd_, selectInit_, cursorPos_;
size_t current_chunk_id_, current_chunk_offset_, current_offset_;
- const DecodeBinaryDataChunk* current_chunk_;
+ DecodeBinaryDataChunk current_chunk_; // Cache locally so that we're not messed up when the vector is re-allocating its data
vector<QColor> chunk_colors_;
};
void View::on_new_binary_data(unsigned int segment_id, void* decoder, unsigned int bin_class_id)
{
if ((segment_id == current_segment_) && (decoder == decoder_) && (bin_class_id == bin_class_id_))
- update_data();
+ if (!delayed_view_updater_.isActive())
+ delayed_view_updater_.start();
}
void View::on_decoder_stacked(void* decoder)
decoder_selector_->removeItem(index);
}
+void View::perform_delayed_view_update()
+{
+ update_data();
+}
+
} // namespace decoder_output
} // namespace views
void on_decoder_stacked(void* decoder);
void on_decoder_removed(void* decoder);
+ virtual void perform_delayed_view_update();
+
private:
QComboBox *decoder_selector_, *format_selector_, *class_selector_;
QStackedWidget *stacked_widget_;