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
Notes: sideshowbarker 2024-07-17 01:04:03 +09:00

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()