1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 04:17:34 +00:00

Everywhere: Pass AK::StringView by value

This commit is contained in:
Andreas Kling 2021-11-11 00:55:02 +01:00
parent ad5d217e76
commit 8b1108e485
392 changed files with 978 additions and 978 deletions

View file

@ -405,7 +405,7 @@ bool DirectoryView::open(String const& path)
return true;
}
void DirectoryView::set_status_message(StringView const& message)
void DirectoryView::set_status_message(StringView message)
{
if (on_status_message)
on_status_message(message);

View file

@ -66,10 +66,10 @@ public:
void launch(URL const&, LauncherHandler const&) const;
Function<void(StringView const& path, bool can_read_in_path, bool can_write_in_path)> on_path_change;
Function<void(StringView path, bool can_read_in_path, bool can_write_in_path)> on_path_change;
Function<void(GUI::AbstractView&)> on_selection_change;
Function<void(GUI::ModelIndex const&, GUI::ContextMenuEvent const&)> on_context_menu_request;
Function<void(StringView const&)> on_status_message;
Function<void(StringView)> on_status_message;
Function<void(int done, int total)> on_thumbnail_progress;
Function<void()> on_accepted_drop;
@ -156,7 +156,7 @@ private:
void handle_activation(GUI::ModelIndex const&);
void set_status_message(StringView const&);
void set_status_message(StringView);
void update_statusbar();
Mode m_mode { Mode::Normal };

View file

@ -115,7 +115,7 @@ void FileOperationProgressWidget::did_finish()
window()->close();
}
void FileOperationProgressWidget::did_error(StringView const& message)
void FileOperationProgressWidget::did_error(StringView message)
{
// FIXME: Communicate more with the user about errors.
close_pipe();
@ -157,7 +157,7 @@ String FileOperationProgressWidget::estimate_time(off_t bytes_done, off_t total_
return String::formatted("{} hours and {} minutes", hours_remaining, minutes_remaining);
}
void FileOperationProgressWidget::did_progress(off_t bytes_done, off_t total_byte_count, size_t files_done, size_t total_file_count, [[maybe_unused]] off_t current_file_done, [[maybe_unused]] off_t current_file_size, StringView const& current_filename)
void FileOperationProgressWidget::did_progress(off_t bytes_done, off_t total_byte_count, size_t files_done, size_t total_file_count, [[maybe_unused]] off_t current_file_done, [[maybe_unused]] off_t current_file_size, StringView current_filename)
{
auto& files_copied_label = *find_descendant_of_type_named<GUI::Label>("files_copied_label");
auto& current_file_label = *find_descendant_of_type_named<GUI::Label>("current_file_label");

View file

@ -22,8 +22,8 @@ private:
FileOperationProgressWidget(FileOperation, NonnullRefPtr<Core::File> helper_pipe);
void did_finish();
void did_error(StringView const& message);
void did_progress(off_t bytes_done, off_t total_byte_count, size_t files_done, size_t total_file_count, off_t current_file_done, off_t current_file_size, StringView const& current_filename);
void did_error(StringView message);
void did_progress(off_t bytes_done, off_t total_byte_count, size_t files_done, size_t total_file_count, off_t current_file_done, off_t current_file_size, StringView current_filename);
void close_pipe();

View file

@ -1020,7 +1020,7 @@ int run_in_windowed_mode(String initial_location, String entry_focused_on_init)
refresh_tree_view();
};
directory_view.on_status_message = [&](StringView const& message) {
directory_view.on_status_message = [&](StringView message) {
statusbar.set_text(message);
};