mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
Userland: Compare event MIME type list with a StringView
The following commit will port MIME types to String. Traits<String> - used in Vector::contains_slow - can't compare String type with char*, so we need to use StringView instead.
This commit is contained in:
parent
2f35348104
commit
e75d694974
Notes:
sideshowbarker
2024-07-17 04:09:56 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/e75d694974 Pull-request: https://github.com/SerenityOS/serenity/pull/21179 Reviewed-by: https://github.com/AtkinsSJ ✅
16 changed files with 16 additions and 16 deletions
|
@ -128,7 +128,7 @@ private:
|
|||
void GLContextWidget::drag_enter_event(GUI::DragEvent& event)
|
||||
{
|
||||
auto const& mime_types = event.mime_types();
|
||||
if (mime_types.contains_slow("text/uri-list"))
|
||||
if (mime_types.contains_slow("text/uri-list"sv))
|
||||
event.accept();
|
||||
}
|
||||
|
||||
|
|
|
@ -987,7 +987,7 @@ void MainWidget::update_preview()
|
|||
void MainWidget::drag_enter_event(GUI::DragEvent& event)
|
||||
{
|
||||
auto const& mime_types = event.mime_types();
|
||||
if (mime_types.contains_slow("text/uri-list"))
|
||||
if (mime_types.contains_slow("text/uri-list"sv))
|
||||
event.accept();
|
||||
}
|
||||
|
||||
|
|
|
@ -624,7 +624,7 @@ void HexEditorWidget::set_value_inspector_visible(bool visible)
|
|||
void HexEditorWidget::drag_enter_event(GUI::DragEvent& event)
|
||||
{
|
||||
auto const& mime_types = event.mime_types();
|
||||
if (mime_types.contains_slow("text/uri-list"))
|
||||
if (mime_types.contains_slow("text/uri-list"sv))
|
||||
event.accept();
|
||||
}
|
||||
|
||||
|
|
|
@ -283,7 +283,7 @@ ErrorOr<void> ViewWidget::try_open_file(String const& path, Core::File& file)
|
|||
void ViewWidget::drag_enter_event(GUI::DragEvent& event)
|
||||
{
|
||||
auto const& mime_types = event.mime_types();
|
||||
if (mime_types.contains_slow("text/uri-list"))
|
||||
if (mime_types.contains_slow("text/uri-list"sv))
|
||||
event.accept();
|
||||
}
|
||||
|
||||
|
|
|
@ -1473,7 +1473,7 @@ ImageEditor& MainWidget::create_new_editor(NonnullRefPtr<Image> image)
|
|||
void MainWidget::drag_enter_event(GUI::DragEvent& event)
|
||||
{
|
||||
auto const& mime_types = event.mime_types();
|
||||
if (mime_types.contains_slow("text/uri-list"))
|
||||
if (mime_types.contains_slow("text/uri-list"sv))
|
||||
event.accept();
|
||||
}
|
||||
|
||||
|
|
|
@ -203,7 +203,7 @@ void PresenterWidget::second_paint_event(GUI::PaintEvent& event)
|
|||
void PresenterWidget::drag_enter_event(GUI::DragEvent& event)
|
||||
{
|
||||
auto const& mime_types = event.mime_types();
|
||||
if (mime_types.contains_slow("text/uri-list"))
|
||||
if (mime_types.contains_slow("text/uri-list"sv))
|
||||
event.accept();
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ void SoundPlayerWidget::set_nonlinear_volume_slider(bool nonlinear)
|
|||
void SoundPlayerWidget::drag_enter_event(GUI::DragEvent& event)
|
||||
{
|
||||
auto const& mime_types = event.mime_types();
|
||||
if (mime_types.contains_slow("text/uri-list"))
|
||||
if (mime_types.contains_slow("text/uri-list"sv))
|
||||
event.accept();
|
||||
}
|
||||
|
||||
|
|
|
@ -832,7 +832,7 @@ bool MainWidget::request_close()
|
|||
void MainWidget::drag_enter_event(GUI::DragEvent& event)
|
||||
{
|
||||
auto const& mime_types = event.mime_types();
|
||||
if (mime_types.contains_slow("text/uri-list"))
|
||||
if (mime_types.contains_slow("text/uri-list"sv))
|
||||
event.accept();
|
||||
}
|
||||
|
||||
|
|
|
@ -678,7 +678,7 @@ ErrorOr<void> MainWidget::load_from_file(String const& filename, NonnullOwnPtr<C
|
|||
void MainWidget::drag_enter_event(GUI::DragEvent& event)
|
||||
{
|
||||
auto const& mime_types = event.mime_types();
|
||||
if (mime_types.contains_slow("text/uri-list"))
|
||||
if (mime_types.contains_slow("text/uri-list"sv))
|
||||
event.accept();
|
||||
}
|
||||
|
||||
|
|
|
@ -317,7 +317,7 @@ GUI::Window::CloseRequestDecision MainWidget::request_close()
|
|||
void MainWidget::drag_enter_event(GUI::DragEvent& event)
|
||||
{
|
||||
auto const& mime_types = event.mime_types();
|
||||
if (mime_types.contains_slow("text/uri-list"))
|
||||
if (mime_types.contains_slow("text/uri-list"sv))
|
||||
event.accept();
|
||||
}
|
||||
|
||||
|
|
|
@ -350,7 +350,7 @@ void Editor::mousedown_event(GUI::MouseEvent& event)
|
|||
void Editor::drag_enter_event(GUI::DragEvent& event)
|
||||
{
|
||||
auto const& mime_types = event.mime_types();
|
||||
if (mime_types.contains_slow("text/uri-list"))
|
||||
if (mime_types.contains_slow("text/uri-list"sv))
|
||||
event.accept();
|
||||
}
|
||||
|
||||
|
|
|
@ -470,7 +470,7 @@ void MainWidget::update_editor_actions(ScriptEditor* editor)
|
|||
void MainWidget::drag_enter_event(GUI::DragEvent& event)
|
||||
{
|
||||
auto const& mime_types = event.mime_types();
|
||||
if (mime_types.contains_slow("text/uri-list"))
|
||||
if (mime_types.contains_slow("text/uri-list"sv))
|
||||
event.accept();
|
||||
}
|
||||
|
||||
|
|
|
@ -789,7 +789,7 @@ ErrorOr<String> FileSystemModel::column_name(int column) const
|
|||
|
||||
bool FileSystemModel::accepts_drag(ModelIndex const& index, Vector<DeprecatedString> const& mime_types) const
|
||||
{
|
||||
if (!mime_types.contains_slow("text/uri-list"))
|
||||
if (!mime_types.contains_slow("text/uri-list"sv))
|
||||
return false;
|
||||
|
||||
if (!index.is_valid())
|
||||
|
|
|
@ -69,7 +69,7 @@ PathBreadcrumbbar::PathBreadcrumbbar(NonnullRefPtr<GUI::TextBox> location_text_b
|
|||
};
|
||||
|
||||
m_breadcrumbbar->on_segment_drag_enter = [&](size_t, GUI::DragEvent& event) {
|
||||
if (event.mime_types().contains_slow("text/uri-list"))
|
||||
if (event.mime_types().contains_slow("text/uri-list"sv))
|
||||
event.accept();
|
||||
};
|
||||
|
||||
|
|
|
@ -1164,7 +1164,7 @@ void TerminalWidget::context_menu_event(GUI::ContextMenuEvent& event)
|
|||
void TerminalWidget::drag_enter_event(GUI::DragEvent& event)
|
||||
{
|
||||
auto const& mime_types = event.mime_types();
|
||||
if (mime_types.contains_slow("text/plain") || mime_types.contains_slow("text/uri-list"))
|
||||
if (mime_types.contains_slow("text/plain"sv) || mime_types.contains_slow("text/uri-list"sv))
|
||||
event.accept();
|
||||
}
|
||||
|
||||
|
|
|
@ -232,7 +232,7 @@ void QuickLaunchWidget::config_string_did_change(StringView domain, StringView g
|
|||
void QuickLaunchWidget::drag_enter_event(GUI::DragEvent& event)
|
||||
{
|
||||
auto const& mime_types = event.mime_types();
|
||||
if (mime_types.contains_slow("text/uri-list"))
|
||||
if (mime_types.contains_slow("text/uri-list"sv))
|
||||
event.accept();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue