mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-29 12:49:05 +00:00
LibCore: Use fallible version of StringBuilder::to_byte_buffer
... in MimeData. This function isn't used anywhere, not sure if it's useful?
This commit is contained in:
parent
63c4bdf5dc
commit
68d3f348d9
Notes:
sideshowbarker
2024-07-17 03:59:29 +09:00
Author: https://github.com/karolba
Commit: 68d3f348d9
Pull-request: https://github.com/SerenityOS/serenity/pull/17746
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
Reviewed-by: https://github.com/linusg
2 changed files with 5 additions and 3 deletions
|
@ -31,14 +31,16 @@ Vector<URL> MimeData::urls() const
|
||||||
return urls;
|
return urls;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MimeData::set_urls(Vector<URL> const& urls)
|
ErrorOr<void> MimeData::set_urls(Vector<URL> const& urls)
|
||||||
{
|
{
|
||||||
StringBuilder builder;
|
StringBuilder builder;
|
||||||
for (auto& url : urls) {
|
for (auto& url : urls) {
|
||||||
builder.append(url.to_deprecated_string());
|
builder.append(url.to_deprecated_string());
|
||||||
builder.append('\n');
|
builder.append('\n');
|
||||||
}
|
}
|
||||||
set_data("text/uri-list", builder.to_byte_buffer());
|
set_data("text/uri-list", TRY(builder.try_to_byte_buffer()));
|
||||||
|
|
||||||
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
DeprecatedString MimeData::text() const
|
DeprecatedString MimeData::text() const
|
||||||
|
|
|
@ -34,7 +34,7 @@ public:
|
||||||
// Convenience helpers for "text/uri-list"
|
// Convenience helpers for "text/uri-list"
|
||||||
bool has_urls() const { return has_format("text/uri-list"); }
|
bool has_urls() const { return has_format("text/uri-list"); }
|
||||||
Vector<URL> urls() const;
|
Vector<URL> urls() const;
|
||||||
void set_urls(Vector<URL> const&);
|
ErrorOr<void> set_urls(Vector<URL> const&);
|
||||||
|
|
||||||
HashMap<DeprecatedString, ByteBuffer> const& all_data() const { return m_data; }
|
HashMap<DeprecatedString, ByteBuffer> const& all_data() const { return m_data; }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue