1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +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

@ -6,7 +6,7 @@
*/
#include <AK/Array.h>
#include <AK/DeprecatedString.h>
#include <AK/ByteString.h>
#include <AK/LexicalPath.h>
#include <LibCore/ConfigFile.h>
#include <LibCore/MappedFile.h>
@ -42,8 +42,8 @@ static Icon s_filetype_image_icon;
static RefPtr<Gfx::Bitmap> s_symlink_emblem;
static RefPtr<Gfx::Bitmap> s_symlink_emblem_small;
static HashMap<DeprecatedString, Icon> s_filetype_icons;
static HashMap<DeprecatedString, Vector<DeprecatedString>> s_filetype_patterns;
static HashMap<ByteString, Icon> s_filetype_icons;
static HashMap<ByteString, Vector<ByteString>> s_filetype_patterns;
static void initialize_executable_icon_if_needed()
{
@ -91,7 +91,7 @@ static void initialize_if_needed()
initialize_executable_icon_if_needed();
for (auto& filetype : config->keys("Icons")) {
s_filetype_icons.set(filetype, Icon::default_icon(DeprecatedString::formatted("filetype-{}", filetype)));
s_filetype_icons.set(filetype, Icon::default_icon(ByteString::formatted("filetype-{}", filetype)));
s_filetype_patterns.set(filetype, config->read_entry("Icons", filetype).split(','));
}
@ -154,9 +154,9 @@ Icon FileIconProvider::icon_for_path(StringView path)
return icon_for_path(path, stat_or_error.release_value().st_mode);
}
Icon FileIconProvider::icon_for_executable(DeprecatedString const& path)
Icon FileIconProvider::icon_for_executable(ByteString const& path)
{
static HashMap<DeprecatedString, Icon> app_icon_cache;
static HashMap<ByteString, Icon> app_icon_cache;
if (auto it = app_icon_cache.find(path); it != app_icon_cache.end())
return it->value;
@ -265,7 +265,7 @@ Icon FileIconProvider::icon_for_path(StringView path, mode_t mode)
if (raw_symlink_target.starts_with('/')) {
target_path = raw_symlink_target;
} else {
auto error_or_path = FileSystem::real_path(DeprecatedString::formatted("{}/{}", LexicalPath::dirname(path), raw_symlink_target));
auto error_or_path = FileSystem::real_path(ByteString::formatted("{}/{}", LexicalPath::dirname(path), raw_symlink_target));
if (error_or_path.is_error())
return s_symlink_icon;