1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:47:45 +00:00

Everywhere: Use LibFileSystem where trivial

This commit is contained in:
Cameron Youell 2023-03-22 02:35:30 +11:00 committed by Linus Groh
parent edab0cbf41
commit 1d24f394c6
115 changed files with 275 additions and 228 deletions

View file

@ -8,7 +8,7 @@
#include "AlbumCoverVisualizationWidget.h"
#include <AK/LexicalPath.h>
#include <LibCore/DeprecatedFile.h>
#include <LibFileSystem/FileSystem.h>
#include <LibGUI/Painter.h>
#include <LibGfx/Rect.h>
@ -48,7 +48,7 @@ ErrorOr<NonnullRefPtr<Gfx::Bitmap>> AlbumCoverVisualizationWidget::get_album_cov
static constexpr auto possible_cover_filenames = Array { "cover.png"sv, "cover.jpg"sv };
for (auto& it : possible_cover_filenames) {
LexicalPath cover_path = LexicalPath::join(directory, it);
if (Core::DeprecatedFile::exists(cover_path.string()))
if (FileSystem::exists(cover_path.string()))
return Gfx::Bitmap::load_from_file(cover_path.string());
}

View file

@ -19,4 +19,4 @@ set(SOURCES
)
serenity_app(SoundPlayer ICON app-sound-player)
target_link_libraries(SoundPlayer PRIVATE LibAudio LibConfig LibCore LibDSP LibGfx LibGUI LibIPC LibMain LibThreading LibImageDecoderClient)
target_link_libraries(SoundPlayer PRIVATE LibAudio LibConfig LibCore LibFileSystem LibDSP LibGfx LibGUI LibIPC LibMain LibThreading LibImageDecoderClient)

View file

@ -7,7 +7,7 @@
#include "Player.h"
#include <LibAudio/FlacLoader.h>
#include <LibCore/DeprecatedFile.h>
#include <LibFileSystem/FileSystem.h>
Player::Player(Audio::ConnectionToServer& audio_client_connection)
: m_audio_client_connection(audio_client_connection)
@ -44,7 +44,7 @@ void Player::play_file_path(DeprecatedString const& path)
if (path.is_null())
return;
if (!Core::DeprecatedFile::exists(path)) {
if (!FileSystem::exists(path)) {
audio_load_error(path, "File does not exist"sv);
return;
}

View file

@ -10,7 +10,7 @@
#include <AK/LexicalPath.h>
#include <AK/Random.h>
#include <LibAudio/Loader.h>
#include <LibCore/DeprecatedFile.h>
#include <LibFileSystem/FileSystem.h>
#include <LibGUI/MessageBox.h>
bool Playlist::load(StringView path)
@ -39,11 +39,11 @@ void Playlist::try_fill_missing_info(Vector<M3UEntry>& entries, StringView path)
entry.path = DeprecatedString::formatted("{}/{}", playlist_path.dirname(), entry.path);
if (!entry.extended_info->file_size_in_bytes.has_value()) {
auto size = Core::DeprecatedFile::size(entry.path);
auto size = FileSystem::size(entry.path);
if (size.is_error())
continue;
entry.extended_info->file_size_in_bytes = size.value();
} else if (!Core::DeprecatedFile::exists(entry.path)) {
} else if (!FileSystem::exists(entry.path)) {
to_delete.append(&entry);
continue;
}