diff options
author | asynts <asynts@gmail.com> | 2020-10-06 14:32:29 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-10-06 15:28:39 +0200 |
commit | 97660ad46c4fe01cee9ced8bcbfec0e19d10c6b7 (patch) | |
tree | 1814f1c9b1ff0678ebd8e97c0c20a35fac9e4f24 | |
parent | 0b29c5e41d47db8a1c5652e35837f64477fd2fab (diff) | |
download | serenity-97660ad46c4fe01cee9ced8bcbfec0e19d10c6b7.zip |
QuickShow: Use new format functions.
-rw-r--r-- | Applications/QuickShow/QSWidget.cpp | 6 | ||||
-rw-r--r-- | Applications/QuickShow/main.cpp | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/Applications/QuickShow/QSWidget.cpp b/Applications/QuickShow/QSWidget.cpp index 8aa989ea0e..6e88a12693 100644 --- a/Applications/QuickShow/QSWidget.cpp +++ b/Applications/QuickShow/QSWidget.cpp @@ -98,14 +98,14 @@ void QSWidget::navigate(Directions direction) size_t index = current_index.value(); if (direction == Directions::Back) { if (index == 0) { - GUI::MessageBox::show(window(), String::format("This is the first file.", index), "Cannot open image", GUI::MessageBox::Type::Error); + GUI::MessageBox::show(window(), "This is the first file.", "Cannot open image", GUI::MessageBox::Type::Error); return; } index--; } else if (direction == Directions::Forward) { if (index == m_files_in_same_dir.size() - 1) { - GUI::MessageBox::show(window(), String::format("This is the last file.", index), "Cannot open image", GUI::MessageBox::Type::Error); + GUI::MessageBox::show(window(), "This is the last file.", "Cannot open image", GUI::MessageBox::Type::Error); return; } @@ -249,7 +249,7 @@ void QSWidget::load_from_file(const String& path) { auto bitmap = Gfx::Bitmap::load_from_file(path); if (!bitmap) { - GUI::MessageBox::show(window(), String::format("Failed to open %s", path.characters()), "Cannot open image", GUI::MessageBox::Type::Error); + GUI::MessageBox::show(window(), String::formatted("Failed to open {}", path), "Cannot open image", GUI::MessageBox::Type::Error); return; } diff --git a/Applications/QuickShow/main.cpp b/Applications/QuickShow/main.cpp index 22671684fe..220f752843 100644 --- a/Applications/QuickShow/main.cpp +++ b/Applications/QuickShow/main.cpp @@ -90,7 +90,7 @@ int main(int argc, char** argv) return; } - window->set_title(String::format("%s %s %d%% - QuickShow", widget.path().characters(), widget.bitmap()->size().to_string().characters(), scale)); + window->set_title(String::formatted("{} {} {}% - QuickShow", widget.path(), widget.bitmap()->size().to_string(), scale)); if (window->is_fullscreen()) return; @@ -146,7 +146,7 @@ int main(int argc, char** argv) return; auto msgbox_result = GUI::MessageBox::show(window, - String::format("Really delete %s?", path.characters()), + String::formatted("Really delete {}?", path), "Confirm deletion", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::OKCancel); @@ -155,12 +155,12 @@ int main(int argc, char** argv) return; auto unlink_result = unlink(widget.path().characters()); - dbg() << "unlink_result::" << unlink_result; + dbgln("unlink_result::{}", unlink_result); if (unlink_result < 0) { int saved_errno = errno; GUI::MessageBox::show(window, - String::format("unlink(%s) failed: %s", path.characters(), strerror(saved_errno)), + String::formatted("unlink({}) failed: {}", path, strerror(saved_errno)), "Delete failed", GUI::MessageBox::Type::Error); |