Skip to content

Commit

Permalink
set_columns, handle case with zero columns while setting a new db (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmichela authored Sep 17, 2024
1 parent 687ffde commit c36f975
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions damnit/gui/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,15 @@ def set_columns(self, columns, statuses):
QtWidgets.QSizePolicy.Minimum)

# Remove the static columns
columns, statuses = map(list, zip(*[x for x in zip(columns, statuses)
if x[0] not in static_columns]))
self.add_new_columns(columns, statuses)
new_columns = []
new_statuses = []
for col, status in zip(columns, statuses):
if col in static_columns:
continue
new_columns.append(col)
new_statuses.append(status)

self.add_new_columns(new_columns, new_statuses)

def get_column_states(self):
column_states = { }
Expand Down

0 comments on commit c36f975

Please sign in to comment.