1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:17:35 +00:00

LibCore: Rename File to DeprecatedFile

As usual, this removes many unused includes and moves used includes
further down the chain.
This commit is contained in:
Tim Schumacher 2023-02-08 21:08:01 +01:00 committed by Linus Groh
parent 14951b92ca
commit d43a7eae54
193 changed files with 536 additions and 556 deletions

View file

@ -11,7 +11,6 @@
#include <AK/LexicalPath.h>
#include <AK/StringView.h>
#include <LibCore/ConfigFile.h>
#include <LibCore/File.h>
#include <LibGUI/AbstractThemePreview.h>
#include <LibGUI/Painter.h>
#include <LibGfx/Bitmap.h>

View file

@ -8,7 +8,7 @@
#include <AK/JsonArray.h>
#include <AK/JsonObject.h>
#include <AK/Vector.h>
#include <LibCore/File.h>
#include <LibCore/DeprecatedFile.h>
#include <LibCore/StandardPaths.h>
#include <LibCore/Stream.h>
#include <LibGUI/CommonLocationsProvider.h>
@ -25,7 +25,7 @@ static void initialize_if_needed()
return;
auto user_config = DeprecatedString::formatted("{}/CommonLocations.json", Core::StandardPaths::config_directory());
if (Core::File::exists(user_config)) {
if (Core::DeprecatedFile::exists(user_config)) {
auto maybe_error = CommonLocationsProvider::load_from_json(user_config);
if (!maybe_error.is_error())
return;

View file

@ -9,7 +9,7 @@
#include <AK/DeprecatedString.h>
#include <AK/LexicalPath.h>
#include <LibCore/ConfigFile.h>
#include <LibCore/File.h>
#include <LibCore/DeprecatedFile.h>
#include <LibCore/MappedFile.h>
#include <LibCore/StandardPaths.h>
#include <LibELF/Image.h>
@ -255,7 +255,7 @@ Icon FileIconProvider::icon_for_path(DeprecatedString const& path, mode_t mode)
return s_directory_icon;
}
if (S_ISLNK(mode)) {
auto raw_symlink_target_or_error = Core::File::read_link(path);
auto raw_symlink_target_or_error = Core::DeprecatedFile::read_link(path);
if (raw_symlink_target_or_error.is_error())
return s_symlink_icon;
@ -267,7 +267,7 @@ Icon FileIconProvider::icon_for_path(DeprecatedString const& path, mode_t mode)
if (raw_symlink_target.starts_with('/')) {
target_path = raw_symlink_target;
} else {
target_path = Core::File::real_path_for(DeprecatedString::formatted("{}/{}", LexicalPath::dirname(path), raw_symlink_target));
target_path = Core::DeprecatedFile::real_path_for(DeprecatedString::formatted("{}/{}", LexicalPath::dirname(path), raw_symlink_target));
}
auto target_icon = icon_for_path(target_path);

View file

@ -6,7 +6,7 @@
#include <AK/Function.h>
#include <AK/LexicalPath.h>
#include <LibCore/File.h>
#include <LibCore/DeprecatedFile.h>
#include <LibCore/StandardPaths.h>
#include <LibGUI/Action.h>
#include <LibGUI/BoxLayout.h>
@ -310,7 +310,7 @@ void FilePicker::on_file_return()
path = LexicalPath::join(m_model->root_path(), path).string();
}
bool file_exists = Core::File::exists(path);
bool file_exists = Core::DeprecatedFile::exists(path);
if (!file_exists && (m_mode == Mode::Open || m_mode == Mode::OpenFolder)) {
MessageBox::show(this, DeprecatedString::formatted("No such file or directory: {}", m_filename_textbox->text()), "File not found"sv, MessageBox::Type::Error, MessageBox::InputType::OK);

View file

@ -10,8 +10,8 @@
#include <AK/NumberFormat.h>
#include <AK/QuickSort.h>
#include <AK/StringBuilder.h>
#include <LibCore/DeprecatedFile.h>
#include <LibCore/DirIterator.h>
#include <LibCore/File.h>
#include <LibCore/StandardPaths.h>
#include <LibGUI/AbstractView.h>
#include <LibGUI/FileIconProvider.h>
@ -61,7 +61,7 @@ bool FileSystemModel::Node::fetch_data(DeprecatedString const& full_path, bool i
mtime = st.st_mtime;
if (S_ISLNK(mode)) {
auto sym_link_target_or_error = Core::File::read_link(full_path);
auto sym_link_target_or_error = Core::DeprecatedFile::read_link(full_path);
if (sym_link_target_or_error.is_error())
perror("readlink");
else {

View file

@ -5,14 +5,14 @@
*/
#include <AK/JsonObject.h>
#include <LibCore/File.h>
#include <LibCore/DeprecatedFile.h>
#include <LibGUI/JsonArrayModel.h>
namespace GUI {
void JsonArrayModel::invalidate()
{
auto file = Core::File::construct(m_json_path);
auto file = Core::DeprecatedFile::construct(m_json_path);
if (!file->open(Core::OpenMode::ReadOnly)) {
dbgln("Unable to open {}", file->filename());
m_array.clear();
@ -30,7 +30,7 @@ void JsonArrayModel::invalidate()
void JsonArrayModel::update()
{
auto file = Core::File::construct(m_json_path);
auto file = Core::DeprecatedFile::construct(m_json_path);
if (!file->open(Core::OpenMode::ReadOnly)) {
dbgln("Unable to open {}", file->filename());
m_array.clear();
@ -48,7 +48,7 @@ void JsonArrayModel::update()
bool JsonArrayModel::store()
{
auto file = Core::File::construct(m_json_path);
auto file = Core::DeprecatedFile::construct(m_json_path);
if (!file->open(Core::OpenMode::WriteOnly)) {
dbgln("Unable to open {}", file->filename());
return false;

View file

@ -11,7 +11,7 @@
#include <AK/ScopeGuard.h>
#include <AK/StringBuilder.h>
#include <AK/TemporaryChange.h>
#include <LibCore/File.h>
#include <LibCore/DeprecatedFile.h>
#include <LibCore/Timer.h>
#include <LibGUI/Action.h>
#include <LibGUI/AutocompleteProvider.h>