summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/AboutDialog.cpp
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2021-08-14 18:50:10 -0400
committerAndreas Kling <kling@serenityos.org>2021-08-15 01:22:45 +0200
commitfaa2c74b49e19723c9da52dab051a66b0cebfb17 (patch)
treeb34155d0ab22008e84a42285f20dcdbb7edc38bb /Userland/Libraries/LibGUI/AboutDialog.cpp
parenta45b6dbc0781a3968a730582509e838b370a31cb (diff)
downloadserenity-faa2c74b49e19723c9da52dab051a66b0cebfb17.zip
LibGUI: Simplify AboutDialog::version_string()
No behavior change.
Diffstat (limited to 'Userland/Libraries/LibGUI/AboutDialog.cpp')
-rw-r--r--Userland/Libraries/LibGUI/AboutDialog.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/Userland/Libraries/LibGUI/AboutDialog.cpp b/Userland/Libraries/LibGUI/AboutDialog.cpp
index e85a2a1610..09d01d45b0 100644
--- a/Userland/Libraries/LibGUI/AboutDialog.cpp
+++ b/Userland/Libraries/LibGUI/AboutDialog.cpp
@@ -95,19 +95,11 @@ String AboutDialog::version_string() const
auto version_config = Core::ConfigFile::open("/res/version.ini");
auto major_version = version_config->read_entry("Version", "Major", "0");
auto minor_version = version_config->read_entry("Version", "Minor", "0");
- auto git_version = version_config->read_entry("Version", "Git", "");
StringBuilder builder;
- builder.append("Version ");
- builder.append(major_version);
- builder.append('.');
- builder.append(minor_version);
-
- if (git_version != "") {
- builder.append(".g");
- builder.append(git_version);
- }
-
+ builder.appendff("Version {}.{}", major_version, minor_version);
+ if (auto git_version = version_config->read_entry("Version", "Git", ""); git_version != "")
+ builder.appendff(".g{}", git_version);
return builder.to_string();
}