Hopefully make dropfile path detection work accross all platforms

This commit is contained in:
Et0h 2014-11-09 10:53:53 +00:00
parent 73746d546c
commit f323984814
2 changed files with 2 additions and 8 deletions

View File

@ -229,10 +229,7 @@ class ConfigDialog(QtGui.QDialog):
data = event.mimeData()
urls = data.urls()
if urls and urls[0].scheme() == 'file':
if sys.platform.startswith('win'):
dropfilepath = unicode(urls[0].path())[1:] # Removes starting slash
else:
dropfilepath = unicode(urls[0].path())
dropfilepath = unicode(event.mimeData().urls()[0].toLocalFile())
if dropfilepath[-4:].lower() == ".exe":
self.executablepathCombobox.setEditText(dropfilepath)
else:

View File

@ -432,10 +432,7 @@ class MainWindow(QtGui.QMainWindow):
data = event.mimeData()
urls = data.urls()
if urls and urls[0].scheme() == 'file':
if sys.platform.startswith('win'):
dropfilepath = unicode(urls[0].path().replace("/", "\\"))[1:] # Removes starting slash
else:
dropfilepath = unicode(urls[0].path())
dropfilepath = unicode(event.mimeData().urls()[0].toLocalFile())
if rewindFile == False:
self._syncplayClient._player.openFile(dropfilepath)
else: