mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:27:35 +00:00
LibGUI: Tweak API for getting the selected path
Return a String instead of a LexicalPath. Also call it a path instead of a file since that's what we're really returning.
This commit is contained in:
parent
8a6c37deef
commit
3773e72752
2 changed files with 5 additions and 5 deletions
|
@ -37,7 +37,7 @@ Optional<String> FilePicker::get_open_filepath(Window* parent_window, const Stri
|
||||||
picker->set_title(window_title);
|
picker->set_title(window_title);
|
||||||
|
|
||||||
if (picker->exec() == Dialog::ExecOK) {
|
if (picker->exec() == Dialog::ExecOK) {
|
||||||
String file_path = picker->selected_file().string();
|
String file_path = picker->selected_file();
|
||||||
|
|
||||||
if (file_path.is_null())
|
if (file_path.is_null())
|
||||||
return {};
|
return {};
|
||||||
|
@ -52,7 +52,7 @@ Optional<String> FilePicker::get_save_filepath(Window* parent_window, const Stri
|
||||||
auto picker = FilePicker::construct(parent_window, Mode::Save, String::formatted("{}.{}", title, extension), path);
|
auto picker = FilePicker::construct(parent_window, Mode::Save, String::formatted("{}.{}", title, extension), path);
|
||||||
|
|
||||||
if (picker->exec() == Dialog::ExecOK) {
|
if (picker->exec() == Dialog::ExecOK) {
|
||||||
String file_path = picker->selected_file().string();
|
String file_path = picker->selected_file();
|
||||||
|
|
||||||
if (file_path.is_null())
|
if (file_path.is_null())
|
||||||
return {};
|
return {};
|
||||||
|
@ -255,7 +255,7 @@ void FilePicker::on_file_return()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_selected_file = path;
|
m_selected_file = path.string();
|
||||||
done(ExecOK);
|
done(ExecOK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ public:
|
||||||
|
|
||||||
virtual ~FilePicker() override;
|
virtual ~FilePicker() override;
|
||||||
|
|
||||||
LexicalPath selected_file() const { return m_selected_file; }
|
String const& selected_file() const { return m_selected_file; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void on_file_return();
|
void on_file_return();
|
||||||
|
@ -66,7 +66,7 @@ private:
|
||||||
|
|
||||||
RefPtr<MultiView> m_view;
|
RefPtr<MultiView> m_view;
|
||||||
NonnullRefPtr<FileSystemModel> m_model;
|
NonnullRefPtr<FileSystemModel> m_model;
|
||||||
LexicalPath m_selected_file;
|
String m_selected_file;
|
||||||
|
|
||||||
RefPtr<TextBox> m_filename_textbox;
|
RefPtr<TextBox> m_filename_textbox;
|
||||||
RefPtr<TextBox> m_location_textbox;
|
RefPtr<TextBox> m_location_textbox;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue