Skip to content

Commit

Permalink
Fixed crash on reload; tables still to be fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashaduri committed Apr 25, 2024
1 parent 61fe92e commit 02bdf75
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/gsc_info_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1760,6 +1760,9 @@ void GscInfoWindow::cell_renderer_for_attributes(Gtk::CellRenderer* cr,
const Gtk::TreeModel::iterator& iter, [[maybe_unused]] int column_index) const
{
const AtaStorageProperty* prop = (*iter)[this->attribute_table_columns.storage_property];
if (!prop) {
return;
}
const auto& attribute = prop->get_value<AtaStorageAttribute>();

if (auto* crt = dynamic_cast<Gtk::CellRendererText*>(cr)) {
Expand Down Expand Up @@ -1809,6 +1812,9 @@ void GscInfoWindow::cell_renderer_for_statistics(Gtk::CellRenderer* cr,
const Gtk::TreeModel::iterator& iter, [[maybe_unused]] int column_index) const
{
const AtaStorageProperty* prop = (*iter)[this->statistics_table_columns.storage_property];
if (!prop) {
return;
}
const auto& statistic = prop->get_value<AtaStorageStatistic>();

if (auto* crt = dynamic_cast<Gtk::CellRendererText*>(cr)) {
Expand Down Expand Up @@ -1839,6 +1845,9 @@ void GscInfoWindow::cell_renderer_for_self_test_log(Gtk::CellRenderer* cr,
const Gtk::TreeModel::iterator& iter, [[maybe_unused]] int column_index) const
{
const AtaStorageProperty* prop = (*iter)[this->self_test_log_table_columns.storage_property];
if (!prop) {
return;
}

if (auto* crt = dynamic_cast<Gtk::CellRendererText*>(cr)) {
cell_renderer_set_warning_fg_bg(crt, *prop);
Expand Down Expand Up @@ -1870,6 +1879,9 @@ void GscInfoWindow::cell_renderer_for_error_log(Gtk::CellRenderer* cr,
const Gtk::TreeModel::iterator& iter, [[maybe_unused]] int column_index) const
{
const AtaStorageProperty* prop = (*iter)[this->error_log_table_columns.storage_property];
if (!prop) {
return;
}

if (auto* crt = dynamic_cast<Gtk::CellRendererText*>(cr)) {
cell_renderer_set_warning_fg_bg(crt, *prop);
Expand All @@ -1896,6 +1908,9 @@ void GscInfoWindow::cell_renderer_for_capabilities(Gtk::CellRenderer* cr,
const Gtk::TreeModel::iterator& iter, [[maybe_unused]] int column_index) const
{
const AtaStorageProperty* prop = (*iter)[this->capabilities_table_columns.storage_property];
if (!prop) {
return;
}

if (auto* crt = dynamic_cast<Gtk::CellRendererText*>(cr)) {
cell_renderer_set_warning_fg_bg(crt, *prop);
Expand Down Expand Up @@ -2231,7 +2246,7 @@ void GscInfoWindow::on_treeview_menu_copy_clicked(Gtk::TreeView* treeview)
{
std::string text;

int num_cols = static_cast<int>(treeview->get_n_columns());
const int num_cols = static_cast<int>(treeview->get_n_columns());
std::vector<std::string> col_texts;
for (int i = 0; i < num_cols; ++i) {
Gtk::TreeViewColumn* tcol = treeview->get_column(i);
Expand Down

0 comments on commit 02bdf75

Please sign in to comment.