summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2020-05-06 18:18:24 +0100
committerAndreas Kling <kling@serenityos.org>2020-05-06 19:28:59 +0200
commit9dbab2d05e2893584dc4f9b42741fc0597718966 (patch)
tree1627952ac73604757a6791d1de0437bd954a2791 /Libraries
parent107ca2e4ba8f88f39f58c4a92d238ea642aa0d39 (diff)
downloadserenity-9dbab2d05e2893584dc4f9b42741fc0597718966.zip
Misc: Replace "String(string_view)" with "string_view.to_string()"
StringView::to_string() was added in 917ccb1 but not actually used anywhere yet.
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibCore/DirIterator.cpp2
-rw-r--r--Libraries/LibGUI/FilePicker.cpp2
-rw-r--r--Libraries/LibGUI/Icon.cpp4
-rw-r--r--Libraries/LibGfx/Bitmap.cpp2
-rw-r--r--Libraries/LibGfx/Color.cpp2
5 files changed, 6 insertions, 6 deletions
diff --git a/Libraries/LibCore/DirIterator.cpp b/Libraries/LibCore/DirIterator.cpp
index de9707c0ff..537b29eb85 100644
--- a/Libraries/LibCore/DirIterator.cpp
+++ b/Libraries/LibCore/DirIterator.cpp
@@ -33,7 +33,7 @@ DirIterator::DirIterator(const StringView& path, Flags flags)
: m_path(path)
, m_flags(flags)
{
- m_dir = opendir(String(path).characters());
+ m_dir = opendir(path.to_string().characters());
if (!m_dir) {
m_error = errno;
}
diff --git a/Libraries/LibGUI/FilePicker.cpp b/Libraries/LibGUI/FilePicker.cpp
index b4e7e4d6f8..019a47d590 100644
--- a/Libraries/LibGUI/FilePicker.cpp
+++ b/Libraries/LibGUI/FilePicker.cpp
@@ -307,7 +307,7 @@ void FilePicker::on_file_return()
bool FilePicker::file_exists(const StringView& path)
{
struct stat st;
- int rc = stat(String(path).characters(), &st);
+ int rc = stat(path.to_string().characters(), &st);
if (rc < 0) {
if (errno == ENOENT)
return false;
diff --git a/Libraries/LibGUI/Icon.cpp b/Libraries/LibGUI/Icon.cpp
index a6f1254a17..01e13443ef 100644
--- a/Libraries/LibGUI/Icon.cpp
+++ b/Libraries/LibGUI/Icon.cpp
@@ -94,8 +94,8 @@ void IconImpl::set_bitmap_for_size(int size, RefPtr<Gfx::Bitmap>&& bitmap)
Icon Icon::default_icon(const StringView& name)
{
- auto bitmap16 = Gfx::Bitmap::load_from_file(String::format("/res/icons/16x16/%s.png", String(name).characters()));
- auto bitmap32 = Gfx::Bitmap::load_from_file(String::format("/res/icons/32x32/%s.png", String(name).characters()));
+ auto bitmap16 = Gfx::Bitmap::load_from_file(String::format("/res/icons/16x16/%s.png", name.to_string().characters()));
+ auto bitmap32 = Gfx::Bitmap::load_from_file(String::format("/res/icons/32x32/%s.png", name.to_string().characters()));
return Icon(move(bitmap16), move(bitmap32));
}
diff --git a/Libraries/LibGfx/Bitmap.cpp b/Libraries/LibGfx/Bitmap.cpp
index d254b60dae..e885833110 100644
--- a/Libraries/LibGfx/Bitmap.cpp
+++ b/Libraries/LibGfx/Bitmap.cpp
@@ -194,7 +194,7 @@ Bitmap::~Bitmap()
void Bitmap::set_mmap_name(const StringView& name)
{
ASSERT(m_needs_munmap);
- ::set_mmap_name(m_data, size_in_bytes(), String(name).characters());
+ ::set_mmap_name(m_data, size_in_bytes(), name.to_string().characters());
}
void Bitmap::fill(Color color)
diff --git a/Libraries/LibGfx/Color.cpp b/Libraries/LibGfx/Color.cpp
index 80de68c496..41e9a013ea 100644
--- a/Libraries/LibGfx/Color.cpp
+++ b/Libraries/LibGfx/Color.cpp
@@ -182,7 +182,7 @@ static Optional<Color> parse_rgba_color(const StringView& string)
if (!ok)
return {};
- double alpha = strtod(String(parts[3]).characters(), nullptr);
+ double alpha = strtod(parts[3].to_string().characters(), nullptr);
int a = alpha * 255;
if (r < 0 || r > 255)