mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:27:35 +00:00
Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
This commit is contained in:
parent
e5f09ea170
commit
3f3f45580a
762 changed files with 8315 additions and 8316 deletions
|
@ -42,8 +42,8 @@ TreeView::TreeView()
|
|||
set_background_role(ColorRole::Base);
|
||||
set_foreground_role(ColorRole::BaseText);
|
||||
set_column_headers_visible(false);
|
||||
m_expand_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/serenity/treeview-expand.png").release_value_but_fixme_should_propagate_errors();
|
||||
m_collapse_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/serenity/treeview-collapse.png").release_value_but_fixme_should_propagate_errors();
|
||||
m_expand_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/serenity/treeview-expand.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_collapse_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/serenity/treeview-collapse.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
ModelIndex TreeView::index_at_event_position(Gfx::IntPoint const& a_position, bool& is_toggle) const
|
||||
|
@ -644,7 +644,7 @@ void TreeView::auto_resize_column(int column)
|
|||
|
||||
int header_width = column_header().font().width(model.column_name(column));
|
||||
if (column == m_key_column && model.is_column_sortable(column))
|
||||
header_width += font().width(" \xE2\xAC\x86");
|
||||
header_width += font().width(" \xE2\xAC\x86"sv);
|
||||
int column_width = header_width;
|
||||
|
||||
bool is_empty = true;
|
||||
|
@ -689,7 +689,7 @@ void TreeView::update_column_sizes()
|
|||
continue;
|
||||
int header_width = column_header().font().width(model.column_name(column));
|
||||
if (column == m_key_column && model.is_column_sortable(column))
|
||||
header_width += font().width(" \xE2\xAC\x86");
|
||||
header_width += font().width(" \xE2\xAC\x86"sv);
|
||||
int column_width = header_width;
|
||||
traverse_in_paint_order([&](ModelIndex const& index, Gfx::IntRect const&, Gfx::IntRect const&, int) {
|
||||
auto cell_data = model.index(index.row(), column, index.parent()).data();
|
||||
|
@ -710,7 +710,7 @@ void TreeView::update_column_sizes()
|
|||
|
||||
int tree_column_header_width = column_header().font().width(model.column_name(tree_column));
|
||||
if (tree_column == m_key_column && model.is_column_sortable(tree_column))
|
||||
tree_column_header_width += font().width(" \xE2\xAC\x86");
|
||||
tree_column_header_width += font().width(" \xE2\xAC\x86"sv);
|
||||
int tree_column_width = tree_column_header_width;
|
||||
traverse_in_paint_order([&](ModelIndex const& index, Gfx::IntRect const&, Gfx::IntRect const&, int indent_level) {
|
||||
auto cell_data = model.index(index.row(), tree_column, index.parent()).data();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue