| 17 | #include <QUrl> |
| 18 | |
| 19 | void FileNameLineEdit::dropEvent(QDropEvent* event) |
| 20 | { |
| 21 | assert(event->mimeData()->hasUrls());//Debugging aid in case FileNameLineEdit::dragEnterEvent is changed to accept other types. |
| 22 | |
| 23 | qCDebug(kdiffMain) << "Enter FileNameLineEdit::dropEvent"; |
| 24 | QList<QUrl> lst = event->mimeData()->urls(); |
| 25 | |
| 26 | if(lst.count() > 0) |
| 27 | { |
| 28 | /* |
| 29 | Do not use QUrl::toString() here. Sadly the Qt5 version does not permit Qt4 style |
| 30 | fullydecoded conversions. It also treats empty schemes as non-local. |
| 31 | */ |
| 32 | qCDebug(kdiffMain) << "Received Drop Event"; |
| 33 | qCDebug(kdiffMain) << "Url List Size: " << lst.count(); |
| 34 | qCDebug(kdiffMain) << "lst[0] = " << lst[0]; |
| 35 | setText(FileAccess::prettyAbsPath(lst[0])); |
| 36 | qCDebug(kdiffMain) << "Set line edit text to: " << text() ; |
| 37 | setFocus(); |
| 38 | Q_EMIT returnPressed(); |
| 39 | } |
| 40 | qCDebug(kdiffMain) << "Leave FileNameLineEdit::dropEvent"; |
| 41 | } |
| 42 | |
| 43 | void FileNameLineEdit::dragEnterEvent(QDragEnterEvent* e) |
| 44 | { |
nothing calls this directly
no outgoing calls
no test coverage detected