Skip to content

Commit

Permalink
Remove old presets files to allow creating preset directories
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohayo committed Sep 15, 2011
1 parent 436d849 commit 6c2759c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pitivi/ui/preset.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ def loadAll(self):

def saveAll(self):
"""Write changes to disk for all presets"""
if os.path.isfile(self.user_path):
# We used to save presets as a single file instead of a directory
os.remove(self.user_path)
if not os.path.exists(self.user_path):
os.makedirs(self.user_path)
for name, properties in self.ordered:
Expand Down Expand Up @@ -210,6 +213,9 @@ def savePreset(self):
"""Update the preset values and write to disk"""
if self.cur_preset != "No preset":
self._updatePreset()
if os.path.isfile(self.user_path):
# We used to save presets as a single file instead of a directory
os.remove(self.user_path)
if not os.path.exists(self.user_path):
os.makedirs(self.user_path)
try:
Expand Down

0 comments on commit 6c2759c

Please sign in to comment.