correctly extract local file name from dropped URI

This commit is contained in:
Axel Kohlmeyer
2023-08-19 15:13:25 -04:00
parent fb0712b66f
commit 89fc0ad68a

View File

@ -117,7 +117,7 @@ void CodeEditor::dropEvent(QDropEvent *event)
{
if (event->mimeData()->hasUrls()) {
event->accept();
auto file = event->mimeData()->urls()[0].url().remove("file://");
auto file = event->mimeData()->urls()[0].toLocalFile();
auto gui = dynamic_cast<LammpsGui *>(parent());
if (gui) {
moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor);