Skip to content

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
samj1912 committed Jan 16, 2017
1 parent 25aceb3 commit 73c35fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions picard/ui/metadatabox.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,16 +330,16 @@ def contextMenuEvent(self, event):
event.accept()

@staticmethod
def _make_preserved_tags_string(preserved_tags):
return ", ".join(uniqify(preserved_tags))
def _save_preserved_tags(preserved_tags):
config.setting['preserved_tags'] = ", ".join(uniqify(preserved_tags))

def add_to_preserved_tags(self, name, preserved_tags):
preserved_tags.append(name)
config.setting['preserved_tags'] = self._make_preserved_tags_string(preserved_tags)
self._save_preserved_tags(preserved_tags)

def remove_from_preserved_tags(self, name, preserved_tags):
preserved_tags = filter(lambda x: x != name, preserved_tags)
config.setting['preserved_tags'] = self._make_preserved_tags_string(preserved_tags)
self._save_preserved_tags(preserved_tags)

def edit_tag(self, tag):
EditTagDialog(self.parent, tag).exec_()
Expand Down

0 comments on commit 73c35fa

Please sign in to comment.