diff options
author | Max Wipfli <mail@maxwipfli.ch> | 2021-06-29 13:11:03 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-30 11:13:54 +0200 |
commit | 9b8f35259c375f6911b76c38ec37e6d422b26bbe (patch) | |
tree | e26b761d81f3d0f5ceb0b4489fe1604abe5545bb /Userland/DevTools/HackStudio/Dialogs | |
parent | caa9daf59e82e7299e88d069ef7745b339a0758a (diff) | |
download | serenity-9b8f35259c375f6911b76c38ec37e6d422b26bbe.zip |
AK: Remove the LexicalPath::is_valid() API
Since this is always set to true on the non-default constructor and
subsequently never modified, it is somewhat pointless. Furthermore,
there are arguably no invalid relative paths.
Diffstat (limited to 'Userland/DevTools/HackStudio/Dialogs')
-rw-r--r-- | Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp b/Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp index 512d34db6e..95f262f0db 100644 --- a/Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp +++ b/Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp @@ -182,18 +182,10 @@ Optional<String> NewProjectDialog::get_project_full_path() auto create_in = m_create_in_input->text(); auto maybe_project_name = get_available_project_name(); - if (!maybe_project_name.has_value()) { - return {}; - } - - auto project_name = maybe_project_name.value(); - auto full_path = LexicalPath(String::formatted("{}/{}", create_in, project_name)); - - // Do not permit otherwise invalid paths. - if (!full_path.is_valid()) + if (!maybe_project_name.has_value()) return {}; - return full_path.string(); + return LexicalPath::join(create_in, *maybe_project_name).string(); } void NewProjectDialog::do_create_project() |