1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:07:35 +00:00

TextEditor+LibGUI: Use unveil and FileSystemAccessServer

Making use of the new FileSystemAccessServer we are able to use
unveil without restricting our ability to open and save files.
A file argument will be unveiled automatically however all other files
require user action via the FileSystemAccessServer to gain access.
This commit is contained in:
Timothy 2021-06-30 06:13:06 -07:00 committed by Andreas Kling
parent 41ce2debda
commit 73ae5200a9
6 changed files with 109 additions and 18 deletions

View file

@ -116,7 +116,8 @@ public:
TextRange normalized_selection() const { return m_selection.normalized(); }
void insert_at_cursor_or_replace_selection(const StringView&);
bool write_to_file(const String& path);
bool write_to_file(String const& path);
bool write_to_file_and_close(int fd);
bool has_selection() const { return m_selection.is_valid(); }
String selected_text() const;
size_t number_of_selected_words() const;