diff options
Diffstat (limited to 'Userland')
23 files changed, 24 insertions, 24 deletions
diff --git a/Userland/Applications/FileManager/DirectoryView.cpp b/Userland/Applications/FileManager/DirectoryView.cpp index 6d47d89671..ae30df2a4f 100644 --- a/Userland/Applications/FileManager/DirectoryView.cpp +++ b/Userland/Applications/FileManager/DirectoryView.cpp @@ -120,7 +120,7 @@ void DirectoryView::handle_activation(const GUI::ModelIndex& index) if (default_launcher) { launch(url, *default_launcher); } else { - auto error_message = String::format("Could not open %s", path.characters()); + auto error_message = String::formatted("Could not open {}", path); GUI::MessageBox::show(window(), error_message, "File Manager", GUI::MessageBox::Type::Error); } } diff --git a/Userland/Applications/SystemMonitor/DevicesModel.cpp b/Userland/Applications/SystemMonitor/DevicesModel.cpp index f0692cdd24..2efc4a117d 100644 --- a/Userland/Applications/SystemMonitor/DevicesModel.cpp +++ b/Userland/Applications/SystemMonitor/DevicesModel.cpp @@ -172,7 +172,7 @@ void DevicesModel::update() Core::DirIterator dir_iter { dir, Core::DirIterator::Flags::SkipDots }; while (dir_iter.has_next()) { auto name = dir_iter.next_path(); - auto path = String::format("%s/%s", dir.characters(), name.characters()); + auto path = String::formatted("{}/{}", dir, name); struct stat statbuf; if (lstat(path.characters(), &statbuf) != 0) { ASSERT_NOT_REACHED(); diff --git a/Userland/Applications/SystemMonitor/main.cpp b/Userland/Applications/SystemMonitor/main.cpp index 2de95c9a09..0296aaca63 100644 --- a/Userland/Applications/SystemMonitor/main.cpp +++ b/Userland/Applications/SystemMonitor/main.cpp @@ -245,7 +245,7 @@ int main(int argc, char** argv) Gfx::Bitmap::load_from_file("/res/icons/16x16/app-profiler.png"), [&](auto&) { pid_t pid = selected_id(ProcessModel::Column::PID); if (pid != -1) { - auto pid_string = String::format("%d", pid); + auto pid_string = String::number(pid); pid_t child; const char* argv[] = { "/bin/Profiler", "--pid", pid_string.characters(), nullptr }; if ((errno = posix_spawn(&child, "/bin/Profiler", nullptr, nullptr, const_cast<char**>(argv), environ))) { @@ -261,7 +261,7 @@ int main(int argc, char** argv) Gfx::Bitmap::load_from_file("/res/icons/16x16/app-inspector.png"), [&](auto&) { pid_t pid = selected_id(ProcessModel::Column::PID); if (pid != -1) { - auto pid_string = String::format("%d", pid); + auto pid_string = String::number(pid); pid_t child; const char* argv[] = { "/bin/Inspector", pid_string.characters(), nullptr }; if ((errno = posix_spawn(&child, "/bin/Inspector", nullptr, nullptr, const_cast<char**>(argv), environ))) { diff --git a/Userland/Demos/Fire/Fire.cpp b/Userland/Demos/Fire/Fire.cpp index f2861d0a11..3f1d2c1b63 100644 --- a/Userland/Demos/Fire/Fire.cpp +++ b/Userland/Demos/Fire/Fire.cpp @@ -172,7 +172,7 @@ void Fire::timer_event(Core::TimerEvent&) if ((cycles % 50) == 0) { dbgln("{} total cycles. finished 50 in {} ms, avg {} ms", cycles, timeAvg, timeAvg / 50); - stats->set_text(String::format("%d ms", timeAvg / 50)); + stats->set_text(String::formatted("{} ms", timeAvg / 50)); timeAvg = 0; } diff --git a/Userland/DevTools/Inspector/RemoteProcess.cpp b/Userland/DevTools/Inspector/RemoteProcess.cpp index aa36b46cae..cdfc4714ba 100644 --- a/Userland/DevTools/Inspector/RemoteProcess.cpp +++ b/Userland/DevTools/Inspector/RemoteProcess.cpp @@ -191,7 +191,7 @@ void RemoteProcess::update() } }; - auto success = m_socket->connect(Core::SocketAddress::local(String::format("/tmp/rpc/%d", m_pid))); + auto success = m_socket->connect(Core::SocketAddress::local(String::formatted("/tmp/rpc/{}", m_pid))); if (!success) { warnln("Couldn't connect to PID {}", m_pid); exit(1); diff --git a/Userland/DevTools/UserspaceEmulator/MmapRegion.cpp b/Userland/DevTools/UserspaceEmulator/MmapRegion.cpp index 9e5eda4e56..a5686cf273 100644 --- a/Userland/DevTools/UserspaceEmulator/MmapRegion.cpp +++ b/Userland/DevTools/UserspaceEmulator/MmapRegion.cpp @@ -44,7 +44,7 @@ NonnullOwnPtr<MmapRegion> MmapRegion::create_file_backed(u32 base, u32 size, u32 auto region = adopt_own(*new MmapRegion(base, size, prot)); region->m_file_backed = true; if (!name.is_empty()) { - name = String::format("%s (Emulated)", name.characters()); + name = String::formatted("{} (Emulated)", name); region->m_name = name; } region->m_data = (u8*)mmap_with_name(nullptr, size, prot, flags, fd, offset, name.is_empty() ? nullptr : name.characters()); diff --git a/Userland/Games/Minesweeper/Field.cpp b/Userland/Games/Minesweeper/Field.cpp index 351a900094..2bec8dcc27 100644 --- a/Userland/Games/Minesweeper/Field.cpp +++ b/Userland/Games/Minesweeper/Field.cpp @@ -142,7 +142,7 @@ Field::Field(GUI::Label& flag_label, GUI::Label& time_label, GUI::Button& face_b m_good_face_bitmap = Gfx::Bitmap::load_from_file("/res/icons/minesweeper/face-good.png"); m_bad_face_bitmap = Gfx::Bitmap::load_from_file("/res/icons/minesweeper/face-bad.png"); for (int i = 0; i < 8; ++i) - m_number_bitmap[i] = Gfx::Bitmap::load_from_file(String::format("/res/icons/minesweeper/%u.png", i + 1)); + m_number_bitmap[i] = Gfx::Bitmap::load_from_file(String::formatted("/res/icons/minesweeper/{}.png", i + 1)); set_fill_with_background_color(true); reset(); diff --git a/Userland/Games/Pong/Game.cpp b/Userland/Games/Pong/Game.cpp index f028bf914e..297b19b676 100644 --- a/Userland/Games/Pong/Game.cpp +++ b/Userland/Games/Pong/Game.cpp @@ -136,7 +136,7 @@ void Game::reset_ball(int serve_to_player) void Game::game_over(int winner) { - GUI::MessageBox::show(window(), String::format("Player %d wins!", winner), "Pong", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::OK); + GUI::MessageBox::show(window(), String::formatted("Player {} wins!", winner), "Pong", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::OK); } void Game::round_over(int winner) diff --git a/Userland/MenuApplets/Audio/main.cpp b/Userland/MenuApplets/Audio/main.cpp index 5c7cc73ce3..fdb5f94842 100644 --- a/Userland/MenuApplets/Audio/main.cpp +++ b/Userland/MenuApplets/Audio/main.cpp @@ -161,7 +161,7 @@ private: painter.blit({}, audio_bitmap, audio_bitmap.rect()); if (m_show_percent) { - auto volume_text = m_audio_muted ? "mute" : String::format("%d%%", m_audio_volume); + auto volume_text = m_audio_muted ? "mute" : String::formatted("{}%", m_audio_volume); painter.draw_text({ 16, 3, 24, 16 }, volume_text, Gfx::FontDatabase::default_fixed_width_font(), Gfx::TextAlignment::TopLeft, palette().window_text()); } } diff --git a/Userland/Services/LookupServer/LookupServer.cpp b/Userland/Services/LookupServer/LookupServer.cpp index 16761ec7e4..657cbc23ec 100644 --- a/Userland/Services/LookupServer/LookupServer.cpp +++ b/Userland/Services/LookupServer/LookupServer.cpp @@ -160,7 +160,7 @@ void LookupServer::service_client(RefPtr<Core::LocalSocket> socket) return; } for (auto& response : responses) { - auto line = String::format("%s\n", response.characters()); + auto line = String::formatted("{}\n", response); int nsent = socket->write(line); if (nsent < 0) { perror("write"); diff --git a/Userland/Services/SystemMenu/main.cpp b/Userland/Services/SystemMenu/main.cpp index 8bde6872a5..fde1a20fe0 100644 --- a/Userland/Services/SystemMenu/main.cpp +++ b/Userland/Services/SystemMenu/main.cpp @@ -176,7 +176,7 @@ NonnullRefPtr<GUI::Menu> build_system_menu() Core::DirIterator dt("/res/themes", Core::DirIterator::SkipDots); while (dt.has_next()) { auto theme_name = dt.next_path(); - auto theme_path = String::format("/res/themes/%s", theme_name.characters()); + auto theme_path = String::formatted("/res/themes/{}", theme_name); g_themes.append({ LexicalPath(theme_name).title(), theme_path }); } quick_sort(g_themes, [](auto& a, auto& b) { return a.name < b.name; }); diff --git a/Userland/Services/SystemServer/Service.cpp b/Userland/Services/SystemServer/Service.cpp index dc798ba8cb..b481e6cdc7 100644 --- a/Userland/Services/SystemServer/Service.cpp +++ b/Userland/Services/SystemServer/Service.cpp @@ -276,7 +276,7 @@ Service::Service(const Core::ConfigFile& config, const StringView& name) ASSERT(config.has_group(name)); set_name(name); - m_executable_path = config.read_entry(name, "Executable", String::format("/bin/%s", this->name().characters())); + m_executable_path = config.read_entry(name, "Executable", String::formatted("/bin/{}", this->name())); m_extra_arguments = config.read_entry(name, "Arguments", "").split(' '); m_stdio_file_path = config.read_entry(name, "StdIO"); diff --git a/Userland/Services/WindowServer/Compositor.cpp b/Userland/Services/WindowServer/Compositor.cpp index f564c4070b..0f64873308 100644 --- a/Userland/Services/WindowServer/Compositor.cpp +++ b/Userland/Services/WindowServer/Compositor.cpp @@ -761,7 +761,7 @@ bool Compositor::draw_geometry_label(Gfx::IntRect& geometry_label_damage_rect) if (!window_being_moved_or_resized->size_increment().is_null()) { int width_steps = (window_being_moved_or_resized->width() - window_being_moved_or_resized->base_size().width()) / window_being_moved_or_resized->size_increment().width(); int height_steps = (window_being_moved_or_resized->height() - window_being_moved_or_resized->base_size().height()) / window_being_moved_or_resized->size_increment().height(); - geometry_string = String::format("%s (%dx%d)", geometry_string.characters(), width_steps, height_steps); + geometry_string = String::formatted("{} ({}x{})", geometry_string, width_steps, height_steps); } auto geometry_label_rect = Gfx::IntRect { 0, 0, wm.font().width(geometry_string) + 16, wm.font().glyph_height() + 10 }; geometry_label_rect.center_within(window_being_moved_or_resized->rect()); diff --git a/Userland/Services/WindowServer/main.cpp b/Userland/Services/WindowServer/main.cpp index e2da920064..8792c37467 100644 --- a/Userland/Services/WindowServer/main.cpp +++ b/Userland/Services/WindowServer/main.cpp @@ -77,7 +77,7 @@ int main(int, char**) auto wm_config = Core::ConfigFile::open("/etc/WindowServer/WindowServer.ini"); auto theme_name = wm_config->read_entry("Theme", "Name", "Default"); - auto theme = Gfx::load_system_theme(String::format("/res/themes/%s.ini", theme_name.characters())); + auto theme = Gfx::load_system_theme(String::formatted("/res/themes/{}.ini", theme_name)); ASSERT(theme); Gfx::set_system_theme(*theme); auto palette = Gfx::PaletteImpl::create_with_shared_buffer(*theme); diff --git a/Userland/Utilities/checksum.cpp b/Userland/Utilities/checksum.cpp index d2c6e59e5b..21c0eb43ee 100644 --- a/Userland/Utilities/checksum.cpp +++ b/Userland/Utilities/checksum.cpp @@ -55,7 +55,7 @@ int main(int argc, char** argv) } auto hash_name = program_name.substring_view(0, program_name.length() - 3).to_string().to_uppercase(); - auto paths_help_string = String::format("File(s) to print %s checksum of", hash_name.characters()); + auto paths_help_string = String::formatted("File(s) to print {} checksum of", hash_name); Vector<const char*> paths; diff --git a/Userland/Utilities/disk_benchmark.cpp b/Userland/Utilities/disk_benchmark.cpp index de3ff19849..420c250692 100644 --- a/Userland/Utilities/disk_benchmark.cpp +++ b/Userland/Utilities/disk_benchmark.cpp @@ -108,7 +108,7 @@ int main(int argc, char** argv) umask(0644); - auto filename = String::format("%s/disk_benchmark.tmp", directory); + auto filename = String::formatted("{}/disk_benchmark.tmp", directory); for (auto file_size : file_sizes) { for (auto block_size : block_sizes) { diff --git a/Userland/Utilities/gunzip.cpp b/Userland/Utilities/gunzip.cpp index 58678d1b88..b7081d4a54 100644 --- a/Userland/Utilities/gunzip.cpp +++ b/Userland/Utilities/gunzip.cpp @@ -57,7 +57,7 @@ int main(int argc, char** argv) for (String filename : filenames) { if (!filename.ends_with(".gz")) - filename = String::format("%s.gz", filename.characters()); + filename = String::formatted("{}.gz", filename); const auto input_filename = filename; const auto output_filename = filename.substring_view(0, filename.length() - 3); diff --git a/Userland/Utilities/lsof.cpp b/Userland/Utilities/lsof.cpp index 029565cedc..9a9bafa0bd 100644 --- a/Userland/Utilities/lsof.cpp +++ b/Userland/Utilities/lsof.cpp @@ -84,7 +84,7 @@ static bool parse_name(StringView name, OpenFile& file) static Vector<OpenFile> get_open_files_by_pid(pid_t pid) { - auto file = Core::File::open(String::format("/proc/%d/fds", pid), Core::IODevice::OpenMode::ReadOnly); + auto file = Core::File::open(String::formatted("/proc/{}/fds", pid), Core::IODevice::OpenMode::ReadOnly); if (file.is_error()) { printf("lsof: PID %d: %s\n", pid, file.error().characters()); return Vector<OpenFile>(); diff --git a/Userland/Utilities/man.cpp b/Userland/Utilities/man.cpp index 079660494c..fc54db06e6 100644 --- a/Userland/Utilities/man.cpp +++ b/Userland/Utilities/man.cpp @@ -68,7 +68,7 @@ int main(int argc, char* argv[]) args_parser.parse(argc, argv); auto make_path = [name](const char* section) { - return String::format("/usr/share/man/man%s/%s.md", section, name); + return String::formatted("/usr/share/man/man{}/{}.md", section, name); }; if (!section) { const char* sections[] = { diff --git a/Userland/Utilities/mount.cpp b/Userland/Utilities/mount.cpp index 9e313d7a19..62b45d56d3 100644 --- a/Userland/Utilities/mount.cpp +++ b/Userland/Utilities/mount.cpp @@ -75,7 +75,7 @@ static int get_source_fd(const char* source) fd = open(source, O_RDONLY); if (fd < 0) { int saved_errno = errno; - auto message = String::format("Failed to open: %s\n", source); + auto message = String::formatted("Failed to open: {}\n", source); errno = saved_errno; perror(message.characters()); } diff --git a/Userland/Utilities/mv.cpp b/Userland/Utilities/mv.cpp index de07baf09b..d7f7a365b6 100644 --- a/Userland/Utilities/mv.cpp +++ b/Userland/Utilities/mv.cpp @@ -76,7 +76,7 @@ int main(int argc, char** argv) const char* new_path = original_new_path; if (rc == 0 && S_ISDIR(st.st_mode)) { auto old_basename = LexicalPath(old_path).basename(); - combined_new_path = String::format("%s/%s", original_new_path, old_basename.characters()); + combined_new_path = String::formatted("{}/{}", original_new_path, old_basename); new_path = combined_new_path.characters(); } diff --git a/Userland/Utilities/pmap.cpp b/Userland/Utilities/pmap.cpp index a0cdf12b72..2706b3fc4a 100644 --- a/Userland/Utilities/pmap.cpp +++ b/Userland/Utilities/pmap.cpp @@ -53,7 +53,7 @@ int main(int argc, char** argv) args_parser.add_positional_argument(pid, "PID", "PID", Core::ArgsParser::Required::Yes); args_parser.parse(argc, argv); - auto file = Core::File::construct(String::format("/proc/%s/vm", pid)); + auto file = Core::File::construct(String::formatted("/proc/{}/vm", pid)); if (!file->open(Core::IODevice::ReadOnly)) { fprintf(stderr, "Error: %s\n", file->error_string()); return 1; diff --git a/Userland/Utilities/pro.cpp b/Userland/Utilities/pro.cpp index 95f9a74ed0..9662d2300c 100644 --- a/Userland/Utilities/pro.cpp +++ b/Userland/Utilities/pro.cpp @@ -265,7 +265,7 @@ int main(int argc, char** argv) do { output_name = url.host(); if (i > -1) - output_name = String::format("%s.%d", output_name.characters(), i); + output_name = String::formatted("{}.{}", output_name, i); ++i; } while (Core::File::exists(output_name)); } |