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

Take StringView in more places

We should work towards a pattern where we take StringView as function
arguments, and store String as member, to push the String construction
to the last possible moment.
This commit is contained in:
Robin Burchell 2019-06-02 12:26:28 +02:00 committed by Andreas Kling
parent b55b6cd7fc
commit 7bce096afd
14 changed files with 28 additions and 36 deletions

View file

@ -12,7 +12,7 @@ public:
explicit DirectoryView(GWidget* parent);
virtual ~DirectoryView() override;
void open(const String& path);
void open(const StringView& path);
String path() const { return model().path(); }
void open_parent_directory();
void open_previous_directory();
@ -22,8 +22,8 @@ public:
void refresh();
Function<void(const String&)> on_path_change;
Function<void(String)> on_status_message;
Function<void(const StringView&)> on_path_change;
Function<void(const StringView&)> on_status_message;
Function<void(int done, int total)> on_thumbnail_progress;
enum ViewMode
@ -41,14 +41,14 @@ private:
void handle_activation(const GModelIndex&);
void set_status_message(const String&);
void set_status_message(const StringView&);
ViewMode m_view_mode { Invalid };
Retained<GDirectoryModel> m_model;
int m_path_history_position { 0 };
Vector<String> m_path_history;
void add_path_to_history(const String& path);
void add_path_to_history(const StringView& path);
GTableView* m_table_view { nullptr };
GItemView* m_item_view { nullptr };