mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:27:43 +00:00
Userland: Store MIME keys as String in Core::MimeData
This commit is contained in:
parent
4f638d3af2
commit
2f35348104
13 changed files with 22 additions and 22 deletions
|
@ -349,7 +349,7 @@ void ConnectionToWindowServer::applet_area_rect_changed(Gfx::IntRect const& rect
|
|||
});
|
||||
}
|
||||
|
||||
void ConnectionToWindowServer::drag_dropped(i32 window_id, Gfx::IntPoint mouse_position, DeprecatedString const& text, HashMap<DeprecatedString, ByteBuffer> const& mime_data)
|
||||
void ConnectionToWindowServer::drag_dropped(i32 window_id, Gfx::IntPoint mouse_position, DeprecatedString const& text, HashMap<String, ByteBuffer> const& mime_data)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(window_id)) {
|
||||
auto mime_data_obj = Core::MimeData::construct(mime_data);
|
||||
|
|
|
@ -48,7 +48,7 @@ private:
|
|||
virtual void menu_visibility_did_change(i32, bool) override;
|
||||
virtual void screen_rects_changed(Vector<Gfx::IntRect> const&, u32, u32, u32) override;
|
||||
virtual void applet_area_rect_changed(Gfx::IntRect const&) override;
|
||||
virtual void drag_dropped(i32, Gfx::IntPoint, DeprecatedString const&, HashMap<DeprecatedString, ByteBuffer> const&) override;
|
||||
virtual void drag_dropped(i32, Gfx::IntPoint, DeprecatedString const&, HashMap<String, ByteBuffer> const&) override;
|
||||
virtual void drag_accepted() override;
|
||||
virtual void drag_cancelled() override;
|
||||
virtual void update_system_theme(Core::AnonymousBuffer const&) override;
|
||||
|
|
|
@ -84,9 +84,9 @@ void DragOperation::set_bitmap(Gfx::Bitmap const* bitmap)
|
|||
if (!m_mime_data)
|
||||
m_mime_data = Core::MimeData::construct();
|
||||
if (bitmap)
|
||||
m_mime_data->set_data("image/x-raw-bitmap", bitmap->serialize_to_byte_buffer().release_value_but_fixme_should_propagate_errors());
|
||||
m_mime_data->set_data("image/x-raw-bitmap"_string, bitmap->serialize_to_byte_buffer().release_value_but_fixme_should_propagate_errors());
|
||||
}
|
||||
void DragOperation::set_data(DeprecatedString const& data_type, DeprecatedString const& data)
|
||||
void DragOperation::set_data(String const& data_type, DeprecatedString const& data)
|
||||
{
|
||||
if (!m_mime_data)
|
||||
m_mime_data = Core::MimeData::construct();
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
void set_mime_data(RefPtr<Core::MimeData> mime_data) { m_mime_data = move(mime_data); }
|
||||
void set_text(DeprecatedString const& text);
|
||||
void set_bitmap(Gfx::Bitmap const* bitmap);
|
||||
void set_data(DeprecatedString const& data_type, DeprecatedString const& data);
|
||||
void set_data(String const& data_type, DeprecatedString const& data);
|
||||
|
||||
Outcome exec();
|
||||
Outcome outcome() const { return m_outcome; }
|
||||
|
|
|
@ -125,10 +125,10 @@ RefPtr<Core::MimeData> Model::mime_data(ModelSelection const& selection) const
|
|||
}
|
||||
});
|
||||
|
||||
mime_data->set_data(drag_data_type(), data_builder.to_byte_buffer().release_value_but_fixme_should_propagate_errors());
|
||||
mime_data->set_data(MUST(String::from_utf8(drag_data_type())), data_builder.to_byte_buffer().release_value_but_fixme_should_propagate_errors());
|
||||
mime_data->set_text(text_builder.to_deprecated_string());
|
||||
if (bitmap)
|
||||
mime_data->set_data("image/x-raw-bitmap", bitmap->serialize_to_byte_buffer().release_value_but_fixme_should_propagate_errors());
|
||||
mime_data->set_data("image/x-raw-bitmap"_string, bitmap->serialize_to_byte_buffer().release_value_but_fixme_should_propagate_errors());
|
||||
|
||||
return mime_data;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue