aboutsummaryrefslogtreecommitdiff
path: root/launcher
diff options
context:
space:
mode:
authorRachel Powers <508861+Ryex@users.noreply.github.com>2023-01-02 08:55:32 -0700
committerRachel Powers <508861+Ryex@users.noreply.github.com>2023-01-09 17:00:12 -0700
commita4870d4834f627f6c730d7b72237d7357aeacc8f (patch)
tree5864956e1326ba86e3fc9e6da60effb72605922b /launcher
parent30b01ef053df670dc2d1912d88a8e9ded46c3c5e (diff)
downloadPrismLauncher-a4870d4834f627f6c730d7b72237d7357aeacc8f.tar.gz
PrismLauncher-a4870d4834f627f6c730d7b72237d7357aeacc8f.tar.bz2
PrismLauncher-a4870d4834f627f6c730d7b72237d7357aeacc8f.zip
fix: fix #700
fixed by properly converting from a file path and converting to native seperators. should have known naive handling of file path as a URL would come back to bite us cross platform. Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher')
-rw-r--r--launcher/Application.cpp6
-rw-r--r--launcher/ui/MainWindow.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/launcher/Application.cpp b/launcher/Application.cpp
index 581e51ae..19d6d3c2 100644
--- a/launcher/Application.cpp
+++ b/launcher/Application.cpp
@@ -263,11 +263,11 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
m_instanceIdToShowWindowOf = parser.value("show");
for (auto zip_path : parser.values("import")){
- m_zipsToImport.append(QUrl(zip_path));
+ m_zipsToImport.append(QUrl::fromLocalFile(QFileInfo(zip_path).absoluteFilePath()));
}
for (auto zip_path : parser.positionalArguments()){ // treat unspesified positional arguments as import urls
- m_zipsToImport.append(QUrl(zip_path));
+ m_zipsToImport.append(QUrl::fromLocalFile(QFileInfo(zip_path).absoluteFilePath()));
}
@@ -1065,7 +1065,7 @@ void Application::messageReceived(const QByteArray& message)
qWarning() << "Received" << command << "message without a zip path/URL.";
return;
}
- m_mainWindow->processURLs({ QUrl(path) });
+ m_mainWindow->processURLs({ QUrl::fromLocalFile(QFileInfo(path).absoluteFilePath()) });
}
else if(command == "launch")
{
diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp
index 6412728a..d5aa4c1a 100644
--- a/launcher/ui/MainWindow.cpp
+++ b/launcher/ui/MainWindow.cpp
@@ -1827,7 +1827,7 @@ void MainWindow::processURLs(QList<QUrl> urls)
break;
}
- auto localFileName = url.toLocalFile();
+ auto localFileName = QDir::toNativeSeparators(url.toLocalFile()) ;
QFileInfo localFileInfo(localFileName);
auto type = ResourceUtils::identify(localFileInfo);