1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 17:37:34 +00:00

Everywhere: Convert a handful of String::format() => formatted()

This commit is contained in:
Andreas Kling 2021-01-16 12:00:33 +01:00
parent c90b7881a7
commit c71807a3fc
23 changed files with 24 additions and 24 deletions

View file

@ -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);
}
}

View file

@ -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();

View file

@ -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))) {