mirror of
https://github.com/Syncplay/syncplay
synced 2024-12-17 12:24:38 +00:00
Hopefully make dropfile path detection work accross all platforms
This commit is contained in:
parent
73746d546c
commit
f323984814
@ -229,10 +229,7 @@ class ConfigDialog(QtGui.QDialog):
|
|||||||
data = event.mimeData()
|
data = event.mimeData()
|
||||||
urls = data.urls()
|
urls = data.urls()
|
||||||
if urls and urls[0].scheme() == 'file':
|
if urls and urls[0].scheme() == 'file':
|
||||||
if sys.platform.startswith('win'):
|
dropfilepath = unicode(event.mimeData().urls()[0].toLocalFile())
|
||||||
dropfilepath = unicode(urls[0].path())[1:] # Removes starting slash
|
|
||||||
else:
|
|
||||||
dropfilepath = unicode(urls[0].path())
|
|
||||||
if dropfilepath[-4:].lower() == ".exe":
|
if dropfilepath[-4:].lower() == ".exe":
|
||||||
self.executablepathCombobox.setEditText(dropfilepath)
|
self.executablepathCombobox.setEditText(dropfilepath)
|
||||||
else:
|
else:
|
||||||
|
@ -432,10 +432,7 @@ class MainWindow(QtGui.QMainWindow):
|
|||||||
data = event.mimeData()
|
data = event.mimeData()
|
||||||
urls = data.urls()
|
urls = data.urls()
|
||||||
if urls and urls[0].scheme() == 'file':
|
if urls and urls[0].scheme() == 'file':
|
||||||
if sys.platform.startswith('win'):
|
dropfilepath = unicode(event.mimeData().urls()[0].toLocalFile())
|
||||||
dropfilepath = unicode(urls[0].path().replace("/", "\\"))[1:] # Removes starting slash
|
|
||||||
else:
|
|
||||||
dropfilepath = unicode(urls[0].path())
|
|
||||||
if rewindFile == False:
|
if rewindFile == False:
|
||||||
self._syncplayClient._player.openFile(dropfilepath)
|
self._syncplayClient._player.openFile(dropfilepath)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user