Skip to content

Commit

Permalink
Cleanup in generating list of players in gui
Browse files Browse the repository at this point in the history
  • Loading branch information
Uriziel committed Nov 14, 2013
1 parent 9a7d2c1 commit b60c73f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions syncplay/ui/GuiConfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ def _tryToFillPlayerPath(self, playerpath, playerpathlist):
settings = QSettings("Syncplay", "PlayerList")
settings.beginGroup("PlayerList")
savedPlayers = settings.value("PlayerList", [])
playerpathlist = list(set([os.path.normcase(os.path.normpath(path)) for path in set(playerpathlist + savedPlayers)]))
if(not isinstance(savedPlayers, list)):
savedPlayers = []
playerpathlist = list(set(os.path.normcase(os.path.normpath(path)) for path in set(playerpathlist + savedPlayers)))
settings.endGroup()
foundpath = ""

Expand All @@ -96,7 +98,7 @@ def _tryToFillPlayerPath(self, playerpath, playerpathlist):
if foundpath != "":
settings.beginGroup("PlayerList")
playerpathlist.append(os.path.normcase(os.path.normpath(foundpath)))
settings.setValue("PlayerList", list(set([os.path.normcase(os.path.normpath(path)) for path in set(playerpathlist)])))
settings.setValue("PlayerList", list(set(os.path.normcase(os.path.normpath(path)) for path in set(playerpathlist))))
settings.endGroup()
return(foundpath)

Expand Down Expand Up @@ -335,7 +337,7 @@ def __init__(self, config, playerpaths, error):
self.executablepathCombobox = QtGui.QComboBox(self)
self.executablepathCombobox.setEditable(True)
self.executablepathCombobox.currentIndexChanged.connect(self.updateExecutableIcon)
self.executablepathCombobox.setEditText(self._tryToFillPlayerPath(config['playerPath'],playerpaths))
self.executablepathCombobox.setEditText(self._tryToFillPlayerPath(config['playerPath'], playerpaths))
self.executablepathCombobox.setMinimumWidth(200)
self.executablepathCombobox.setMaximumWidth(200)
self.executablepathCombobox.editTextChanged.connect(self.updateExecutableIcon)
Expand Down

0 comments on commit b60c73f

Please sign in to comment.