Skip to content

Commit

Permalink
fix: fix #700
Browse files Browse the repository at this point in the history
fixed by properly converting from a file path and converting to native seperators. should have known nieve handeling of fily path's as URL would come back to bite us cross platform.

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
  • Loading branch information
Ryex committed Jan 2, 2023
1 parent 3982b51 commit cc3b244
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions launcher/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}


Expand Down Expand Up @@ -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")
{
Expand Down
2 changes: 1 addition & 1 deletion launcher/ui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1826,7 +1826,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);
Expand Down

0 comments on commit cc3b244

Please sign in to comment.