(self, event)
| 414 | super(MainWindow.PlaylistWidget, self).dragMoveEvent(event) |
| 415 | |
| 416 | def dropEvent(self, event): |
| 417 | window = self.parent().parent().parent().parent().parent().parent() |
| 418 | if not window.playlist.isEnabled(): |
| 419 | return |
| 420 | window.setPlaylistInsertPosition(None) |
| 421 | if QtGui.QDropEvent.proposedAction(event) == Qt.MoveAction: |
| 422 | QtGui.QDropEvent.setDropAction(event, Qt.CopyAction) # Avoids file being deleted |
| 423 | data = event.mimeData() |
| 424 | urls = data.urls() |
| 425 | |
| 426 | if urls and urls[0].scheme() == 'file': |
| 427 | indexRow = self.indexAt(event.pos()).row() |
| 428 | if not window.clearedPlaylistNote: |
| 429 | indexRow = 0 |
| 430 | if indexRow == -1: |
| 431 | indexRow = window.playlist.count() |
| 432 | for url in urls[::-1]: |
| 433 | if isMacOS() and IsPySide: |
| 434 | macURL = NSString.alloc().initWithString_(str(url.toString())) |
| 435 | pathString = macURL.stringByAddingPercentEscapesUsingEncoding_(NSUTF8StringEncoding) |
| 436 | dropfilepath = os.path.abspath(NSURL.URLWithString_(pathString).filePathURL().path()) |
| 437 | else: |
| 438 | dropfilepath = os.path.abspath(str(url.toLocalFile())) |
| 439 | if os.path.isfile(dropfilepath): |
| 440 | window.addFileToPlaylist(dropfilepath, indexRow) |
| 441 | elif os.path.isdir(dropfilepath): |
| 442 | window.addFolderToPlaylist(dropfilepath) |
| 443 | else: |
| 444 | super(MainWindow.PlaylistWidget, self).dropEvent(event) |
| 445 | |
| 446 | class topSplitter(QtWidgets.QSplitter): |
| 447 | def createHandle(self): |
nothing calls this directly
no test coverage detected