mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
FileManager: Switch FileOperationProgressWidget::did_error() to SV&
This commit is contained in:
parent
469bca9d3a
commit
9ac757647f
Notes:
sideshowbarker
2024-07-18 08:34:08 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/9ac757647f2 Pull-request: https://github.com/SerenityOS/serenity/pull/8117 Reviewed-by: https://github.com/MaxWipfli ✅
|
@ -66,7 +66,7 @@ FileOperationProgressWidget::FileOperationProgressWidget(FileOperation operation
|
|||
m_notifier->on_ready_to_read = [this] {
|
||||
auto line = m_helper_pipe->read_line();
|
||||
if (line.is_null()) {
|
||||
did_error("Read from pipe returned null.");
|
||||
did_error("Read from pipe returned null."sv);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -74,12 +74,12 @@ FileOperationProgressWidget::FileOperationProgressWidget(FileOperation operation
|
|||
VERIFY(!parts.is_empty());
|
||||
|
||||
if (parts[0] == "ERROR"sv) {
|
||||
did_error(line.substring(6));
|
||||
did_error(line.substring_view(6));
|
||||
return;
|
||||
}
|
||||
|
||||
if (parts[0] == "WARN"sv) {
|
||||
did_error(line.substring(5));
|
||||
did_error(line.substring_view(5));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ void FileOperationProgressWidget::did_finish()
|
|||
window()->close();
|
||||
}
|
||||
|
||||
void FileOperationProgressWidget::did_error(String const message)
|
||||
void FileOperationProgressWidget::did_error(StringView const& message)
|
||||
{
|
||||
// FIXME: Communicate more with the user about errors.
|
||||
close_pipe();
|
||||
|
|
|
@ -22,7 +22,7 @@ private:
|
|||
FileOperationProgressWidget(FileOperation, NonnullRefPtr<Core::File> helper_pipe);
|
||||
|
||||
void did_finish();
|
||||
void did_error(String message);
|
||||
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 close_pipe();
|
||||
|
|
Loading…
Reference in a new issue