From 3cc987a5b4afdc0b8df5be420fc6d1e2a19fbe66 Mon Sep 17 00:00:00 2001 From: flow Date: Thu, 1 Dec 2022 22:54:03 -0300 Subject: [PATCH] fix: explicitly set scheme for local file in -I argument Otherwise isLocalFile() will return false for local files without the file:// thingy. Signed-off-by: flow --- launcher/ui/MainWindow.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index e2fb10954..b626bbae5 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -1817,6 +1817,10 @@ void MainWindow::droppedURLs(QList urls) { // NOTE: This loop only processes one dropped file! for (auto& url : urls) { + // The isLocalFile() check below doesn't work as intended without an explicit scheme. + if (url.scheme().isEmpty()) + url.setScheme("file"); + if (!url.isLocalFile()) { // probably instance/modpack addInstance(url.toString()); break;