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>
This commit is contained in:
Rachel Powers 2023-01-02 08:55:32 -07:00
parent 30b01ef053
commit a4870d4834
2 changed files with 4 additions and 4 deletions

View File

@ -263,11 +263,11 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
m_instanceIdToShowWindowOf = parser.value("show"); m_instanceIdToShowWindowOf = parser.value("show");
for (auto zip_path : parser.values("import")){ 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 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."; qWarning() << "Received" << command << "message without a zip path/URL.";
return; return;
} }
m_mainWindow->processURLs({ QUrl(path) }); m_mainWindow->processURLs({ QUrl::fromLocalFile(QFileInfo(path).absoluteFilePath()) });
} }
else if(command == "launch") else if(command == "launch")
{ {

View File

@ -1827,7 +1827,7 @@ void MainWindow::processURLs(QList<QUrl> urls)
break; break;
} }
auto localFileName = url.toLocalFile(); auto localFileName = QDir::toNativeSeparators(url.toLocalFile()) ;
QFileInfo localFileInfo(localFileName); QFileInfo localFileInfo(localFileName);
auto type = ResourceUtils::identify(localFileInfo); auto type = ResourceUtils::identify(localFileInfo);