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

Everywhere: Rename to_{string => deprecated_string}() where applicable

This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.

One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
This commit is contained in:
Linus Groh 2022-12-06 01:12:49 +00:00 committed by Andreas Kling
parent 6e19ab2bbc
commit 57dc179b1f
597 changed files with 1973 additions and 1972 deletions

View file

@ -60,7 +60,7 @@ DisassemblyModel::DisassemblyModel(Debug::DebugSession const& debug_session, Ptr
if (!insn.has_value())
break;
FlatPtr address_in_profiled_program = symbol.value().value() + offset_into_symbol;
auto disassembly = insn.value().to_string(address_in_profiled_program, &symbol_provider);
auto disassembly = insn.value().to_deprecated_string(address_in_profiled_program, &symbol_provider);
StringView instruction_bytes = view.substring_view(offset_into_symbol, insn.value().length());
m_instructions.append({ insn.value(), disassembly, instruction_bytes, address_in_profiled_program });
@ -99,7 +99,7 @@ GUI::Variant DisassemblyModel::data(const GUI::ModelIndex& index, GUI::ModelRole
StringBuilder builder;
for (auto ch : insn.bytes)
builder.appendff("{:02x} ", static_cast<unsigned char>(ch));
return builder.to_string();
return builder.to_deprecated_string();
}
if (index.column() == Column::Disassembly)
return insn.disassembly;

View file

@ -117,7 +117,7 @@ void EditorWrapper::update_title()
if (editor().document().is_modified())
title.append(" (*)"sv);
m_filename_title = title.to_string();
m_filename_title = title.to_deprecated_string();
}
void EditorWrapper::set_debug_mode(bool enabled)

View file

@ -105,7 +105,7 @@ static RefPtr<SearchResultsModel> find_in_files(StringView text)
builder.append(file.document().text_in_range(range));
builder.append(0x02);
builder.append(right_part);
matches.append({ file.name(), range, builder.to_string() });
matches.append({ file.name(), range, builder.to_deprecated_string() });
}
});

View file

@ -54,7 +54,7 @@ void GitFilesView::mousedown_event(GUI::MouseEvent& event)
auto data = model()->index(item_index, model_column()).data();
VERIFY(data.is_string());
m_action_callback(data.to_string());
m_action_callback(data.to_deprecated_string());
}
};

View file

@ -279,7 +279,7 @@ void HackStudioWidget::open_project(DeprecatedString const& root_path)
if (recent_projects.size() > recent_projects_history_size)
recent_projects.shrink(recent_projects_history_size);
Config::write_string("HackStudio"sv, "Global"sv, "RecentProjects"sv, JsonArray(recent_projects).to_string());
Config::write_string("HackStudio"sv, "Global"sv, "RecentProjects"sv, JsonArray(recent_projects).to_deprecated_string());
update_recent_projects_submenu();
}
@ -1088,7 +1088,7 @@ DeprecatedString HackStudioWidget::get_full_path_of_serenity_source(DeprecatedSt
relative_path_builder.join('/', path_parts);
constexpr char SERENITY_LIBS_PREFIX[] = "/usr/src/serenity";
LexicalPath serenity_sources_base(SERENITY_LIBS_PREFIX);
return DeprecatedString::formatted("{}/{}", serenity_sources_base, relative_path_builder.to_string());
return DeprecatedString::formatted("{}/{}", serenity_sources_base, relative_path_builder.to_deprecated_string());
}
DeprecatedString HackStudioWidget::get_absolute_path(DeprecatedString const& path) const
@ -1246,7 +1246,7 @@ void HackStudioWidget::create_open_files_view(GUI::Widget& parent)
m_open_files_view->set_model(open_files_model);
m_open_files_view->on_activation = [this](auto& index) {
open_file(index.data().to_string());
open_file(index.data().to_deprecated_string());
};
}
@ -1559,7 +1559,7 @@ void HackStudioWidget::update_statusbar()
builder.appendff("Selected: {} {} ({} {})", selected_text.length(), selected_text.length() == 1 ? "character" : "characters", word_count, word_count != 1 ? "words" : "word");
}
m_statusbar->set_text(0, builder.to_string());
m_statusbar->set_text(0, builder.to_deprecated_string());
m_statusbar->set_text(1, current_editor_wrapper().editor().code_document().language_name());
m_statusbar->set_text(2, DeprecatedString::formatted("Ln {}, Col {}", current_editor().cursor().line() + 1, current_editor().cursor().column()));
}

View file

@ -176,7 +176,7 @@ DeprecatedString ProjectBuilder::generate_cmake_file_content() const
builder.appendff("target_link_libraries({} INTERFACE {})\n", library.key, DeprecatedString::join(' ', library.value->dependencies));
}
return builder.to_string();
return builder.to_deprecated_string();
}
HashMap<DeprecatedString, NonnullOwnPtr<ProjectBuilder::LibraryInfo>> ProjectBuilder::get_defined_libraries()

View file

@ -129,7 +129,7 @@ static void update_path_environment_variable()
if (path.length())
path.append(':');
path.append(DEFAULT_PATH_SV);
setenv("PATH", path.to_string().characters(), true);
setenv("PATH", path.to_deprecated_string().characters(), true);
}
static Optional<DeprecatedString> last_opened_project_path()