mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:57:35 +00:00
LibCore+LibGUI+About: Use String in Core::Version and GUI::AboutDialog
The Core::Version API now returns ErrorOr<String>, and the GUI::AboutDialog API was adjusted to accommodate this.
This commit is contained in:
parent
ad4b4046f4
commit
d0977ac566
7 changed files with 40 additions and 33 deletions
|
@ -4,22 +4,20 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibCore/System.h>
|
||||
#include <LibCore/Version.h>
|
||||
|
||||
namespace Core::Version {
|
||||
|
||||
DeprecatedString read_long_version_string()
|
||||
ErrorOr<String> read_long_version_string()
|
||||
{
|
||||
auto result = Core::System::uname();
|
||||
if (result.is_error())
|
||||
return {};
|
||||
auto uname = TRY(Core::System::uname());
|
||||
|
||||
auto version = result.value().release;
|
||||
auto git_hash = result.value().version;
|
||||
auto const* version = uname.release;
|
||||
auto const* git_hash = uname.version;
|
||||
|
||||
return DeprecatedString::formatted("Version {} revision {}", version, git_hash);
|
||||
return String::formatted("Version {} revision {}", version, git_hash);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue