1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:44:58 +00:00

Ladybird: Open files from the open files dialog as a QURL

This prevents us from needing to properly prepend file:// to the
returned filename.
This commit is contained in:
Andrew Kaster 2024-01-30 19:29:00 -07:00 committed by Tim Flynn
parent c75bd4ed15
commit 7245f6f11c

View file

@ -720,9 +720,10 @@ void Tab::location_edit_return_pressed()
void Tab::open_file()
{
auto filename = QFileDialog::getOpenFileName(this, "Open file", QDir::homePath(), "All Files (*.*)");
if (!filename.isNull())
navigate(ak_url_from_qstring(filename));
auto filename = QFileDialog::getOpenFileUrl(this, "Open file", QDir::homePath(), "All Files (*.*)");
if (filename.isValid()) {
navigate(ak_url_from_qurl(filename));
}
}
int Tab::tab_index()