mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +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:
parent
c75bd4ed15
commit
7245f6f11c
Notes:
sideshowbarker
2024-07-17 01:04:03 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/7245f6f11c Pull-request: https://github.com/SerenityOS/serenity/pull/23051 Reviewed-by: https://github.com/kalenikaliaksandr Reviewed-by: https://github.com/trflynn89 ✅
1 changed files with 4 additions and 3 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue