correctly extract local file name from dropped URI
This commit is contained in:
@ -117,7 +117,7 @@ void CodeEditor::dropEvent(QDropEvent *event)
|
|||||||
{
|
{
|
||||||
if (event->mimeData()->hasUrls()) {
|
if (event->mimeData()->hasUrls()) {
|
||||||
event->accept();
|
event->accept();
|
||||||
auto file = event->mimeData()->urls()[0].url().remove("file://");
|
auto file = event->mimeData()->urls()[0].toLocalFile();
|
||||||
auto gui = dynamic_cast<LammpsGui *>(parent());
|
auto gui = dynamic_cast<LammpsGui *>(parent());
|
||||||
if (gui) {
|
if (gui) {
|
||||||
moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor);
|
moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor);
|
||||||
|
|||||||
Reference in New Issue
Block a user