mirror of
https://github.com/evilsocket/opensnitch.git
synced 2025-03-04 08:34:40 +01:00
ui: fixed crash while refreshing views
There was a problem while refreshing and reconfiguring the views' columns, which caused segfaults.
This commit is contained in:
parent
174c63c3ff
commit
1b26acbd21
1 changed files with 6 additions and 0 deletions
|
@ -68,6 +68,10 @@ class GenericTableModel(QStandardItemModel):
|
|||
|
||||
# set columns based on query's fields
|
||||
def setModelColumns(self, newColumns):
|
||||
# Avoid firing signals while reconfiguring the view, it causes
|
||||
# segfaults.
|
||||
self.blockSignals(True);
|
||||
|
||||
self.headerLabels = []
|
||||
self.removeColumns(0, self.lastColumnCount)
|
||||
self.setHorizontalHeaderLabels(self.headerLabels)
|
||||
|
@ -77,6 +81,8 @@ class GenericTableModel(QStandardItemModel):
|
|||
self.setHorizontalHeaderLabels(self.headerLabels)
|
||||
self.setColumnCount(len(self.headerLabels))
|
||||
|
||||
self.blockSignals(False);
|
||||
|
||||
def setQuery(self, q, db):
|
||||
self.origQueryStr = q
|
||||
self.db = db
|
||||
|
|
Loading…
Add table
Reference in a new issue