mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
LibGUI: Convert StringBuilder::appendf() => AK::Format
This commit is contained in:
parent
5b87276841
commit
8d5eb075d8
2 changed files with 12 additions and 13 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue