Skip to content

Commit

Permalink
Fix issue where items continually get suffixes appended to their name
Browse files Browse the repository at this point in the history
QLineEdit.editingFinished apparently gets emitted in all kinds of
circumstances where editing neither started nor finished
  • Loading branch information
L3337 committed Nov 24, 2022
1 parent 473aa4b commit 4064cfd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/sgui/daw/item_editor/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ def get_midi_channel(self):

def on_item_rename(self, a_val=None):
name = str(self.item_name_lineedit.text()).strip()
# Avoid shenanigans when Qt calls this event when the widget is not
# even focused or being edited
if name == shared.CURRENT_ITEM_NAME:
return
constants.DAW_PROJECT.rename_items([shared.CURRENT_ITEM_NAME], name)
constants.DAW_PROJECT.commit(_("Rename items"))
items_dict = constants.DAW_PROJECT.get_items_dict()
Expand Down

0 comments on commit 4064cfd

Please sign in to comment.