Skip to content

Commit

Permalink
Fix project history duplication on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
stargateaudio committed Nov 2, 2021
1 parent cc70221 commit 9e9a1c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sgui/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from sglib.lib import portable
from sglib.lib.translate import _
from sglib.lib.util import (
pi_path,
META_DOT_JSON,
PROJECT_FILE_TYPE,
set_file_setting,
Expand Down Expand Up @@ -115,16 +116,15 @@ def open_project(a_parent=None):
return False

def set_project(project):
project = pi_path(project)
set_file_setting("last-project", str(project))
history = get_history()
history = [pi_path(x) for x in get_history() if pi_path(x) != project]
if IS_PORTABLE_INSTALL:
project = portable.escape_path(project)
history = [
portable.escape_path(x)
for x in history
]
if project in history:
history.remove(project)
history.insert(0, project)
util.set_file_setting(
"project-history",
Expand Down

0 comments on commit 9e9a1c8

Please sign in to comment.