mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:47:44 +00:00
Everywhere: Use LibFileSystem
where trivial
This commit is contained in:
parent
edab0cbf41
commit
1d24f394c6
115 changed files with 275 additions and 228 deletions
|
@ -11,6 +11,7 @@
|
|||
#include <LibCore/ConfigFile.h>
|
||||
#include <LibCore/DeprecatedFile.h>
|
||||
#include <LibCore/DirIterator.h>
|
||||
#include <LibFileSystem/FileSystem.h>
|
||||
#include <fcntl.h>
|
||||
#include <spawn.h>
|
||||
#include <sys/stat.h>
|
||||
|
@ -52,7 +53,7 @@ RefPtr<ProjectTemplate> ProjectTemplate::load_from_manifest(DeprecatedString con
|
|||
|
||||
auto bitmap_path_32 = DeprecatedString::formatted("/res/icons/hackstudio/templates-32x32/{}.png", config->read_entry("HackStudioTemplate", "IconName32x"));
|
||||
|
||||
if (Core::DeprecatedFile::exists(bitmap_path_32)) {
|
||||
if (FileSystem::exists(bitmap_path_32)) {
|
||||
auto bitmap_or_error = Gfx::Bitmap::load_from_file(bitmap_path_32);
|
||||
if (!bitmap_or_error.is_error())
|
||||
icon = GUI::Icon(bitmap_or_error.release_value());
|
||||
|
@ -64,14 +65,14 @@ RefPtr<ProjectTemplate> ProjectTemplate::load_from_manifest(DeprecatedString con
|
|||
Result<void, DeprecatedString> ProjectTemplate::create_project(DeprecatedString const& name, DeprecatedString const& path)
|
||||
{
|
||||
// Check if a file or directory already exists at the project path
|
||||
if (Core::DeprecatedFile::exists(path))
|
||||
if (FileSystem::exists(path))
|
||||
return DeprecatedString("File or directory already exists at specified location.");
|
||||
|
||||
dbgln("Creating project at path '{}' with name '{}'", path, name);
|
||||
|
||||
// Verify that the template content directory exists. If it does, copy it's contents.
|
||||
// Otherwise, create an empty directory at the project path.
|
||||
if (Core::DeprecatedFile::is_directory(content_path())) {
|
||||
if (FileSystem::is_directory(content_path())) {
|
||||
auto result = Core::DeprecatedFile::copy_file_or_directory(path, content_path());
|
||||
dbgln("Copying {} -> {}", content_path(), path);
|
||||
if (result.is_error())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue