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 <flowlnlnln@gmail.com>
This commit is contained in:
flow 2022-12-01 22:54:03 -03:00
parent f3279a0697
commit 3cc987a5b4
No known key found for this signature in database
GPG Key ID: 8D0F221F0A59F469

View File

@ -1817,6 +1817,10 @@ void MainWindow::droppedURLs(QList<QUrl> urls)
{ {
// NOTE: This loop only processes one dropped file! // NOTE: This loop only processes one dropped file!
for (auto& url : urls) { 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 if (!url.isLocalFile()) { // probably instance/modpack
addInstance(url.toString()); addInstance(url.toString());
break; break;