diff --git a/Userland/Applications/Browser/CookieJar.cpp b/Userland/Applications/Browser/CookieJar.cpp index 67e7fcce7a..7d6705bebd 100644 --- a/Userland/Applications/Browser/CookieJar.cpp +++ b/Userland/Applications/Browser/CookieJar.cpp @@ -7,6 +7,7 @@ #include "CookieJar.h" #include #include +#include #include #include #include @@ -48,9 +49,9 @@ void CookieJar::set_cookie(const URL& url, const Web::Cookie::ParsedCookie& pars void CookieJar::dump_cookies() const { - static const char* key_color = "\033[34;1m"; - static const char* attribute_color = "\033[33m"; - static const char* no_color = "\033[0m"; + constexpr StringView key_color = "\033[34;1m"; + constexpr StringView attribute_color = "\033[33m"; + constexpr StringView no_color = "\033[0m"; StringBuilder builder; builder.appendff("{} cookies stored\n", m_cookies.size()); diff --git a/Userland/Applications/Calendar/AddEventDialog.cpp b/Userland/Applications/Calendar/AddEventDialog.cpp index 9f972ea291..53e47da257 100644 --- a/Userland/Applications/Calendar/AddEventDialog.cpp +++ b/Userland/Applications/Calendar/AddEventDialog.cpp @@ -5,6 +5,7 @@ */ #include "AddEventDialog.h" +#include #include #include #include @@ -20,11 +21,6 @@ #include #include -static const char* short_month_names[] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" -}; - AddEventDialog::AddEventDialog(Core::DateTime date_time, Window* parent_window) : Dialog(parent_window) , m_date_time(date_time) @@ -121,6 +117,11 @@ String AddEventDialog::MonthListModel::column_name(int column) const GUI::Variant AddEventDialog::MonthListModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) const { + constexpr StringView short_month_names[] = { + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" + }; + auto& month = short_month_names[index.row()]; if (role == GUI::ModelRole::Display) { switch (index.column()) { diff --git a/Userland/Applications/FontEditor/FontEditor.cpp b/Userland/Applications/FontEditor/FontEditor.cpp index 7aae6efb87..82d35d36e4 100644 --- a/Userland/Applications/FontEditor/FontEditor.cpp +++ b/Userland/Applications/FontEditor/FontEditor.cpp @@ -9,6 +9,7 @@ #include "GlyphMapWidget.h" #include "NewFontDialog.h" #include +#include #include #include #include @@ -37,19 +38,19 @@ #include #include -static constexpr int s_pangram_count = 7; -static const char* pangrams[s_pangram_count] = { - "quick fox jumps nightly above wizard", - "five quacking zephyrs jolt my wax bed", - "pack my box with five dozen liquor jugs", - "quick brown fox jumps over the lazy dog", - "waxy and quivering jocks fumble the pizza", - "~#:[@_1%]*{$2.3}/4^(5'6\")-&|7+8!=<9,0\\>?;", - "byxfjärmat föl gick på duvshowen" -}; - static RefPtr create_font_preview_window(FontEditorWidget& editor) { + constexpr int pangram_count = 7; + constexpr StringView pangrams[pangram_count] = { + "quick fox jumps nightly above wizard", + "five quacking zephyrs jolt my wax bed", + "pack my box with five dozen liquor jugs", + "quick brown fox jumps over the lazy dog", + "waxy and quivering jocks fumble the pizza", + "~#:[@_1%]*{$2.3}/4^(5'6\")-&|7+8!=<9,0\\>?;", + "byxfjärmat föl gick på duvshowen" + }; + auto window = GUI::Window::construct(); window->set_window_type(GUI::WindowType::ToolWindow); window->set_title("Font preview"); @@ -94,7 +95,7 @@ static RefPtr create_font_preview_window(FontEditorWidget& editor) reload_button.set_fixed_width(22); reload_button.on_click = [&] { static int i = 1; - if (i >= s_pangram_count) + if (i >= pangram_count) i = 0; preview_textbox.set_text(pangrams[i]); i++; diff --git a/Userland/Applications/HexEditor/FindDialog.cpp b/Userland/Applications/HexEditor/FindDialog.cpp index e5ec83f429..668752fb92 100644 --- a/Userland/Applications/HexEditor/FindDialog.cpp +++ b/Userland/Applications/HexEditor/FindDialog.cpp @@ -5,9 +5,9 @@ */ #include "FindDialog.h" +#include #include #include -#include #include #include #include @@ -19,17 +19,12 @@ #include struct Option { - String title; + StringView title; OptionId opt; bool enabled; bool default_action; }; -static const Vector