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

Everywhere: Rename {Deprecated => Byte}String

This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).

This commit is auto-generated:
  $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
    Meta Ports Ladybird Tests Kernel)
  $ perl -pie 's/\bDeprecatedString\b/ByteString/g;
    s/deprecated_string/byte_string/g' $xs
  $ clang-format --style=file -i \
    $(git diff --name-only | grep \.cpp\|\.h)
  $ gn format $(git ls-files '*.gn' '*.gni')
This commit is contained in:
Ali Mohammad Pur 2023-12-16 17:49:34 +03:30 committed by Ali Mohammad Pur
parent 38d62563b3
commit 5e1499d104
1615 changed files with 10257 additions and 10257 deletions

View file

@ -16,9 +16,9 @@
namespace Desktop {
DeprecatedString AppFile::app_file_path_for_app(StringView app_name)
ByteString AppFile::app_file_path_for_app(StringView app_name)
{
return DeprecatedString::formatted("{}/{}.af", APP_FILES_DIRECTORY, app_name);
return ByteString::formatted("{}/{}.af", APP_FILES_DIRECTORY, app_name);
}
bool AppFile::exists_for_app(StringView app_name)
@ -45,7 +45,7 @@ void AppFile::for_each(Function<void(NonnullRefPtr<AppFile>)> callback, StringVi
auto name = di.next_path();
if (!name.ends_with(".af"sv))
continue;
auto path = DeprecatedString::formatted("{}/{}", directory, name);
auto path = ByteString::formatted("{}/{}", directory, name);
auto af = AppFile::open(path);
if (!af->is_valid())
continue;
@ -68,36 +68,36 @@ bool AppFile::validate() const
return true;
}
DeprecatedString AppFile::name() const
ByteString AppFile::name() const
{
auto name = m_config->read_entry("App", "Name").trim_whitespace();
VERIFY(!name.is_empty());
return name;
}
DeprecatedString AppFile::executable() const
ByteString AppFile::executable() const
{
auto executable = m_config->read_entry("App", "Executable").trim_whitespace();
VERIFY(!executable.is_empty());
return executable;
}
DeprecatedString AppFile::description() const
ByteString AppFile::description() const
{
return m_config->read_entry("App", "Description").trim_whitespace();
}
DeprecatedString AppFile::category() const
ByteString AppFile::category() const
{
return m_config->read_entry("App", "Category").trim_whitespace();
}
DeprecatedString AppFile::working_directory() const
ByteString AppFile::working_directory() const
{
return m_config->read_entry("App", "WorkingDirectory").trim_whitespace();
}
DeprecatedString AppFile::icon_path() const
ByteString AppFile::icon_path() const
{
return m_config->read_entry("App", "IconPath").trim_whitespace();
}
@ -127,9 +127,9 @@ bool AppFile::exclude_from_system_menu() const
return m_config->read_bool_entry("App", "ExcludeFromSystemMenu", false);
}
Vector<DeprecatedString> AppFile::launcher_mime_types() const
Vector<ByteString> AppFile::launcher_mime_types() const
{
Vector<DeprecatedString> mime_types;
Vector<ByteString> mime_types;
for (auto& entry : m_config->read_entry("Launcher", "MimeTypes").split(',')) {
entry = entry.trim_whitespace();
if (!entry.is_empty())
@ -138,9 +138,9 @@ Vector<DeprecatedString> AppFile::launcher_mime_types() const
return mime_types;
}
Vector<DeprecatedString> AppFile::launcher_file_types() const
Vector<ByteString> AppFile::launcher_file_types() const
{
Vector<DeprecatedString> file_types;
Vector<ByteString> file_types;
for (auto& entry : m_config->read_entry("Launcher", "FileTypes").split(',')) {
entry = entry.trim_whitespace();
if (!entry.is_empty())
@ -149,9 +149,9 @@ Vector<DeprecatedString> AppFile::launcher_file_types() const
return file_types;
}
Vector<DeprecatedString> AppFile::launcher_protocols() const
Vector<ByteString> AppFile::launcher_protocols() const
{
Vector<DeprecatedString> protocols;
Vector<ByteString> protocols;
for (auto& entry : m_config->read_entry("Launcher", "Protocols").split(',')) {
entry = entry.trim_whitespace();
if (!entry.is_empty())