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

Everywhere: Port to new LexicalPath APIs #146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions AndroidPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ ErrorOr<void> extract_tar_archive(DeprecatedString archive_file, DeprecatedStrin
break;
}

LexicalPath path = LexicalPath(header.filename());
LexicalPath path = TRY(LexicalPath::from_string(header.filename()));
if (!header.prefix().is_empty())
path = path.prepend(header.prefix());
DeprecatedString filename = get_override("path"sv).value_or(path.string());
path = TRY(path.prepend(header.prefix()));
DeprecatedString filename = get_override("path"sv).value_or(path.string().to_deprecated_string());

DeprecatedString absolute_path = Core::File::absolute_path(filename);
auto parent_path = LexicalPath(absolute_path).parent();
auto parent_path = TRY(TRY(LexicalPath::from_string(absolute_path)).parent().to_deprecated_string());

switch (header.type_flag()) {
case Archive::TarFileType::NormalFile:
Expand Down
8 changes: 7 additions & 1 deletion Utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ void platform_init()
if (Core::File::is_directory(home_lagom))
return home_lagom;
auto app_dir = ak_deprecated_string_from_qstring(QCoreApplication::applicationDirPath());
return LexicalPath(app_dir).parent().append("share"sv).string();
return LexicalPath::from_string(app_dir)
.release_value_but_fixme_should_propagate_errors()
.parent()
.release_value_but_fixme_should_propagate_errors()
.append("share"sv)
.release_value_but_fixme_should_propagate_errors()
.string().to_deprecated_string();
}();
#endif
}