Skip to content
This repository was archived by the owner on Dec 25, 2022. It is now read-only.

Commit 828d1e2

Browse files
committed
Everywhere: Port to new LexicalPath APIs
1 parent 94e2442 commit 828d1e2

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

AndroidPlatform.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,13 @@ ErrorOr<void> extract_tar_archive(DeprecatedString archive_file, DeprecatedStrin
150150
break;
151151
}
152152

153-
LexicalPath path = LexicalPath(header.filename());
153+
LexicalPath path = TRY(LexicalPath::from_string(header.filename()));
154154
if (!header.prefix().is_empty())
155-
path = path.prepend(header.prefix());
156-
DeprecatedString filename = get_override("path"sv).value_or(path.string());
155+
path = TRY(path.prepend(header.prefix()));
156+
DeprecatedString filename = get_override("path"sv).value_or(path.string().to_deprecated_string());
157157

158158
DeprecatedString absolute_path = Core::File::absolute_path(filename);
159-
auto parent_path = LexicalPath(absolute_path).parent();
159+
auto parent_path = TRY(TRY(LexicalPath::from_string(absolute_path)).parent().to_deprecated_string());
160160

161161
switch (header.type_flag()) {
162162
case Archive::TarFileType::NormalFile:

Utilities.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,13 @@ void platform_init()
4141
if (Core::File::is_directory(home_lagom))
4242
return home_lagom;
4343
auto app_dir = ak_deprecated_string_from_qstring(QCoreApplication::applicationDirPath());
44-
return LexicalPath(app_dir).parent().append("share"sv).string();
44+
return LexicalPath::from_string(app_dir)
45+
.release_value_but_fixme_should_propagate_errors()
46+
.parent()
47+
.release_value_but_fixme_should_propagate_errors()
48+
.append("share"sv)
49+
.release_value_but_fixme_should_propagate_errors()
50+
.string().to_deprecated_string();
4551
}();
4652
#endif
4753
}

0 commit comments

Comments
 (0)