summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-12-21 17:27:30 +0000
committerTim Flynn <trflynn89@pm.me>2023-01-26 09:57:14 -0500
commit4313c17d9510f62b93eb3a660662006b36ad26df (patch)
tree30ba99b2d443ee6c13691ea526091df96fa69652
parent04b3908172b86f38b066159654a8e0f970128fd0 (diff)
downloadserenity-4313c17d9510f62b93eb3a660662006b36ad26df.zip
LibDesktop: Replace uses of JsonObject::get_deprecated()/get_ptr()
-rw-r--r--Userland/Libraries/LibDesktop/Launcher.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibDesktop/Launcher.cpp b/Userland/Libraries/LibDesktop/Launcher.cpp
index 4667b946df..23032e9ed6 100644
--- a/Userland/Libraries/LibDesktop/Launcher.cpp
+++ b/Userland/Libraries/LibDesktop/Launcher.cpp
@@ -18,10 +18,10 @@ auto Launcher::Details::from_details_str(DeprecatedString const& details_str) ->
auto details = adopt_ref(*new Details);
auto json = JsonValue::from_string(details_str).release_value_but_fixme_should_propagate_errors();
auto const& obj = json.as_object();
- details->executable = obj.get_deprecated("executable"sv).to_deprecated_string();
- details->name = obj.get_deprecated("name"sv).to_deprecated_string();
- if (auto type_value = obj.get_ptr("type"sv)) {
- auto type_str = type_value->to_deprecated_string();
+ details->executable = obj.get_deprecated_string("executable"sv).value_or({});
+ details->name = obj.get_deprecated_string("name"sv).value_or({});
+ if (auto type_value = obj.get_deprecated_string("type"sv); type_value.has_value()) {
+ auto const& type_str = type_value.value();
if (type_str == "app")
details->launcher_type = LauncherType::Application;
else if (type_str == "userpreferred")