Skip to content

Commit

Permalink
Merge pull request #20 from sosiax/patch-2
Browse files Browse the repository at this point in the history
Removing some crashes that are allready  commented in isue #19
  • Loading branch information
frans-fuerst authored Mar 4, 2020
2 parents c60345d + 67c7561 commit 87069a5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions track_qt/rules_model_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,17 @@ def get_first_matching_key(self, app):
#Makes it editable:
def setData(self, index, value, role):
if value != "":
regex_str=str(value.toString())
regex_str=str(value)
try:
re.compile(regex_str)
is_valid = True
except re.error:
is_valid = False
if(is_valid):
self._rules[index.row()][index.column()-1] = str(value.toString())
self._rules[index.row()][index.column()-1] = regex_str
self.modified_rules.emit()
self.save_to_disk()
# TODO: save rule changes to disk
# self.save_to_disk()
else:
self._rules[index.row()][index.column()-1] = "invalid regex"
return True
Expand Down

0 comments on commit 87069a5

Please sign in to comment.