diff options
author | Andreas Kling <kling@serenityos.org> | 2021-05-07 16:32:31 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-07 21:12:09 +0200 |
commit | 8d5eb075d87aecfe4998fc231d5952b10e4ac30b (patch) | |
tree | 1b8663f0eb16864944e1f41e30ea0b98201d12ba /Userland/Libraries/LibGUI | |
parent | 5b87276841f5dd7d29e2e02fff5540dabc40bfa8 (diff) | |
download | serenity-8d5eb075d87aecfe4998fc231d5952b10e4ac30b.zip |
LibGUI: Convert StringBuilder::appendf() => AK::Format
Diffstat (limited to 'Userland/Libraries/LibGUI')
-rw-r--r-- | Userland/Libraries/LibGUI/FileSystemModel.cpp | 21 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/Progressbar.cpp | 4 |
2 files changed, 12 insertions, 13 deletions
diff --git a/Userland/Libraries/LibGUI/FileSystemModel.cpp b/Userland/Libraries/LibGUI/FileSystemModel.cpp index 4b63d81805..f6c7cea890 100644 --- a/Userland/Libraries/LibGUI/FileSystemModel.cpp +++ b/Userland/Libraries/LibGUI/FileSystemModel.cpp @@ -268,20 +268,19 @@ static String permission_string(mode_t mode) else builder.append("?"); - builder.appendf("%c%c%c%c%c%c%c%c", - mode & S_IRUSR ? 'r' : '-', - mode & S_IWUSR ? 'w' : '-', - mode & S_ISUID ? 's' : (mode & S_IXUSR ? 'x' : '-'), - mode & S_IRGRP ? 'r' : '-', - mode & S_IWGRP ? 'w' : '-', - mode & S_ISGID ? 's' : (mode & S_IXGRP ? 'x' : '-'), - mode & S_IROTH ? 'r' : '-', - mode & S_IWOTH ? 'w' : '-'); + builder.append(mode & S_IRUSR ? 'r' : '-'); + builder.append(mode & S_IWUSR ? 'w' : '-'); + builder.append(mode & S_ISUID ? 's' : (mode & S_IXUSR ? 'x' : '-')); + builder.append(mode & S_IRGRP ? 'r' : '-'); + builder.append(mode & S_IWGRP ? 'w' : '-'); + builder.append(mode & S_ISGID ? 's' : (mode & S_IXGRP ? 'x' : '-')); + builder.append(mode & S_IROTH ? 'r' : '-'); + builder.append(mode & S_IWOTH ? 'w' : '-'); if (mode & S_ISVTX) - builder.append("t"); + builder.append('t'); else - builder.appendf("%c", mode & S_IXOTH ? 'x' : '-'); + builder.append(mode & S_IXOTH ? 'x' : '-'); return builder.to_string(); } diff --git a/Userland/Libraries/LibGUI/Progressbar.cpp b/Userland/Libraries/LibGUI/Progressbar.cpp index df5300ac30..dcdd409142 100644 --- a/Userland/Libraries/LibGUI/Progressbar.cpp +++ b/Userland/Libraries/LibGUI/Progressbar.cpp @@ -66,9 +66,9 @@ void Progressbar::paint_event(PaintEvent& event) if (m_format == Format::Percentage) { float range_size = m_max - m_min; float progress = (m_value - m_min) / range_size; - builder.appendf("%d%%", (int)(progress * 100)); + builder.appendff("{}%", (int)(progress * 100)); } else if (m_format == Format::ValueSlashMax) { - builder.appendf("%d/%d", m_value, m_max); + builder.appendff("{}/{}", m_value, m_max); } progress_text = builder.to_string(); } |