From 7455cf17c8a776ac32c5877e22d2063c7e47773a Mon Sep 17 00:00:00 2001 From: Davide Romanini Date: Sun, 29 Sep 2019 23:02:44 +0100 Subject: [PATCH] fix broken drag & drop on macOS (#142) --- comictaggerlib/taggerwindow.py | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/comictaggerlib/taggerwindow.py b/comictaggerlib/taggerwindow.py index 5b2bfab..4446c62 100644 --- a/comictaggerlib/taggerwindow.py +++ b/comictaggerlib/taggerwindow.py @@ -582,35 +582,8 @@ class TaggerWindow(QtWidgets.QMainWindow): if self.droppedFiles is not None: event.accept() - # http://stackoverflow.com/questions/34689562/pyqt-mimedata-filename def getUrlFromLocalFileID(self, localFileID): - import sys - if not sys.platform == 'darwin': - return localFileID.toLocalFile() - - import objc - import CoreFoundation as CF - localFileQString = QString(localFileID.toLocalFile()) - relCFStringRef = CF.CFStringCreateWithCString( - CF.kCFAllocatorDefault, - localFileQString.toUtf8(), - CF.kCFStringEncodingUTF8 - ) - relCFURL = CF.CFURLCreateWithFileSystemPath( - CF.kCFAllocatorDefault, - relCFStringRef, - CF.kCFURLPOSIXPathStyle, - False # is directory - ) - absCFURL = CF.CFURLCreateFilePathURL( - CF.kCFAllocatorDefault, - relCFURL, - objc.NULL - ) - - local = QUrl(str(absCFURL[0])).toLocalFile() - - return local + return localFileID.toLocalFile() def dropEvent(self, event): # if self.dirtyFlagVerification("Open Archive",