mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 16:47:34 +00:00
Everywhere: "file name" => "filename"
This commit is contained in:
parent
def1f1444a
commit
7ae7170d61
59 changed files with 181 additions and 181 deletions
|
@ -38,7 +38,7 @@ constexpr const char* posix1_tar_version = ""; // POSIX.1-1988 format version
|
|||
|
||||
class [[gnu::packed]] TarFileHeader {
|
||||
public:
|
||||
const StringView file_name() const { return m_file_name; }
|
||||
const StringView filename() const { return m_filename; }
|
||||
mode_t mode() const { return get_tar_field(m_mode); }
|
||||
uid_t uid() const { return get_tar_field(m_uid); }
|
||||
gid_t gid() const { return get_tar_field(m_gid); }
|
||||
|
@ -57,7 +57,7 @@ public:
|
|||
// FIXME: support ustar filename prefix
|
||||
const StringView prefix() const { return m_prefix; }
|
||||
|
||||
void set_file_name(const String& file_name) { VERIFY(file_name.copy_characters_to_buffer(m_file_name, sizeof(m_file_name))); }
|
||||
void set_filename(const String& filename) { VERIFY(filename.copy_characters_to_buffer(m_filename, sizeof(m_filename))); }
|
||||
void set_mode(mode_t mode) { VERIFY(String::formatted("{:o}", mode).copy_characters_to_buffer(m_mode, sizeof(m_mode))); }
|
||||
void set_uid(uid_t uid) { VERIFY(String::formatted("{:o}", uid).copy_characters_to_buffer(m_uid, sizeof(m_uid))); }
|
||||
void set_gid(gid_t gid) { VERIFY(String::formatted("{:o}", gid).copy_characters_to_buffer(m_gid, sizeof(m_gid))); }
|
||||
|
@ -77,7 +77,7 @@ public:
|
|||
void calculate_checksum();
|
||||
|
||||
private:
|
||||
char m_file_name[100];
|
||||
char m_filename[100];
|
||||
char m_mode[8];
|
||||
char m_uid[8];
|
||||
char m_gid[8];
|
||||
|
|
|
@ -132,7 +132,7 @@ void TarOutputStream::add_directory(const String& path, mode_t mode)
|
|||
TarFileHeader header;
|
||||
memset(&header, 0, sizeof(header));
|
||||
header.set_size(0);
|
||||
header.set_file_name(String::formatted("{}/", path)); // Old tar implementations assume directory names end with a /
|
||||
header.set_filename(String::formatted("{}/", path)); // Old tar implementations assume directory names end with a /
|
||||
header.set_type_flag(TarFileType::Directory);
|
||||
header.set_mode(mode);
|
||||
header.set_magic(gnu_magic);
|
||||
|
@ -149,7 +149,7 @@ void TarOutputStream::add_file(const String& path, mode_t mode, const ReadonlyBy
|
|||
TarFileHeader header;
|
||||
memset(&header, 0, sizeof(header));
|
||||
header.set_size(bytes.size());
|
||||
header.set_file_name(path);
|
||||
header.set_filename(path);
|
||||
header.set_type_flag(TarFileType::NormalFile);
|
||||
header.set_mode(mode);
|
||||
header.set_magic(gnu_magic);
|
||||
|
|
|
@ -41,8 +41,8 @@ NonnullRefPtr<ConfigFile> ConfigFile::open(const String& path)
|
|||
return adopt_ref(*new ConfigFile(path));
|
||||
}
|
||||
|
||||
ConfigFile::ConfigFile(const String& file_name)
|
||||
: m_file_name(file_name)
|
||||
ConfigFile::ConfigFile(const String& filename)
|
||||
: m_filename(filename)
|
||||
{
|
||||
reparse();
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ void ConfigFile::reparse()
|
|||
{
|
||||
m_groups.clear();
|
||||
|
||||
auto file = File::construct(m_file_name);
|
||||
auto file = File::construct(m_filename);
|
||||
if (!file->open(IODevice::OpenMode::ReadOnly))
|
||||
return;
|
||||
|
||||
|
@ -151,7 +151,7 @@ bool ConfigFile::sync()
|
|||
if (!m_dirty)
|
||||
return true;
|
||||
|
||||
FILE* fp = fopen(m_file_name.characters(), "wb");
|
||||
FILE* fp = fopen(m_filename.characters(), "wb");
|
||||
if (!fp)
|
||||
return false;
|
||||
|
||||
|
|
|
@ -47,14 +47,14 @@ public:
|
|||
void remove_group(const String& group);
|
||||
void remove_entry(const String& group, const String& key);
|
||||
|
||||
String file_name() const { return m_file_name; }
|
||||
String filename() const { return m_filename; }
|
||||
|
||||
private:
|
||||
explicit ConfigFile(const String& file_name);
|
||||
explicit ConfigFile(const String& filename);
|
||||
|
||||
void reparse();
|
||||
|
||||
String m_file_name;
|
||||
String m_filename;
|
||||
HashMap<String, HashMap<String, String>> m_groups;
|
||||
bool m_dirty { false };
|
||||
};
|
||||
|
|
|
@ -372,9 +372,9 @@ Optional<DebugSession::InsertBreakpointAtSymbolResult> DebugSession::insert_brea
|
|||
return result;
|
||||
}
|
||||
|
||||
Optional<DebugSession::InsertBreakpointAtSourcePositionResult> DebugSession::insert_breakpoint(const String& file_name, size_t line_number)
|
||||
Optional<DebugSession::InsertBreakpointAtSourcePositionResult> DebugSession::insert_breakpoint(const String& filename, size_t line_number)
|
||||
{
|
||||
auto address_and_source_position = get_address_from_source_position(file_name, line_number);
|
||||
auto address_and_source_position = get_address_from_source_position(filename, line_number);
|
||||
if (!address_and_source_position.has_value())
|
||||
return {};
|
||||
|
||||
|
|
|
@ -57,12 +57,12 @@ public:
|
|||
|
||||
struct InsertBreakpointAtSourcePositionResult {
|
||||
String library_name;
|
||||
String file_name;
|
||||
String filename;
|
||||
size_t line_number { 0 };
|
||||
FlatPtr address { 0 };
|
||||
};
|
||||
|
||||
Optional<InsertBreakpointAtSourcePositionResult> insert_breakpoint(const String& file_name, size_t line_number);
|
||||
Optional<InsertBreakpointAtSourcePositionResult> insert_breakpoint(const String& filename, size_t line_number);
|
||||
|
||||
bool insert_breakpoint(void* address);
|
||||
bool disable_breakpoint(void* address);
|
||||
|
|
|
@ -21,7 +21,7 @@ public:
|
|||
~AppFile();
|
||||
|
||||
bool is_valid() const { return m_valid; }
|
||||
String file_name() const { return m_config->file_name(); }
|
||||
String filename() const { return m_config->filename(); }
|
||||
|
||||
String name() const;
|
||||
String executable() const;
|
||||
|
|
|
@ -41,9 +41,9 @@ char* dlerror()
|
|||
return const_cast<char*>(s_dlerror_text);
|
||||
}
|
||||
|
||||
void* dlopen(const char* file_name, int flags)
|
||||
void* dlopen(const char* filename, int flags)
|
||||
{
|
||||
auto result = __dlopen(file_name, flags);
|
||||
auto result = __dlopen(filename, flags);
|
||||
if (result.is_error()) {
|
||||
store_error(result.error().text);
|
||||
return nullptr;
|
||||
|
|
|
@ -42,7 +42,7 @@ typedef struct
|
|||
#define AT_BASE_PLATFORM 24 /* a_ptr points to a string identifying base platform name, which might be different from platform (e.g x86_64 when in i386 compat) */
|
||||
#define AT_RANDOM 25 /* a_ptr points to 16 securely generated random bytes */
|
||||
#define AT_HWCAP2 26 /* a_val holds extended hw feature mask. Currently 0 */
|
||||
#define AT_EXECFN 31 /* a_ptr points to file name of executed program */
|
||||
#define AT_EXECFN 31 /* a_ptr points to filename of executed program */
|
||||
#define AT_EXE_BASE 32 /* a_ptr holds base address where main program was loaded into memory */
|
||||
#define AT_EXE_SIZE 33 /* a_val holds the size of the main program in memory */
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ bool Desktop::set_wallpaper(const StringView& path, bool save_config)
|
|||
|
||||
if (ret_val && save_config) {
|
||||
RefPtr<Core::ConfigFile> config = Core::ConfigFile::get_for_app("WindowManager");
|
||||
dbgln("Saving wallpaper path '{}' to config file at {}", path, config->file_name());
|
||||
dbgln("Saving wallpaper path '{}' to config file at {}", path, config->filename());
|
||||
config->write_entry("Background", "Wallpaper", path);
|
||||
config->sync();
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ Optional<String> FilePicker::get_save_filepath(Window* parent_window, const Stri
|
|||
return {};
|
||||
}
|
||||
|
||||
FilePicker::FilePicker(Window* parent_window, Mode mode, const StringView& file_name, const StringView& path)
|
||||
FilePicker::FilePicker(Window* parent_window, Mode mode, const StringView& filename, const StringView& path)
|
||||
: Dialog(parent_window)
|
||||
, m_model(FileSystemModel::create())
|
||||
, m_mode(mode)
|
||||
|
@ -148,7 +148,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, const StringView& file_
|
|||
m_filename_textbox = *widget.find_descendant_of_type_named<GUI::TextBox>("filename_textbox");
|
||||
m_filename_textbox->set_focus(true);
|
||||
if (m_mode == Mode::Save) {
|
||||
m_filename_textbox->set_text(file_name);
|
||||
m_filename_textbox->set_text(filename);
|
||||
m_filename_textbox->select_all();
|
||||
}
|
||||
m_filename_textbox->on_return_pressed = [&] {
|
||||
|
|
|
@ -43,7 +43,7 @@ private:
|
|||
// ^GUI::ModelClient
|
||||
virtual void model_did_update(unsigned) override;
|
||||
|
||||
FilePicker(Window* parent_window, Mode type = Mode::Open, const StringView& file_name = "Untitled", const StringView& path = Core::StandardPaths::home_directory());
|
||||
FilePicker(Window* parent_window, Mode type = Mode::Open, const StringView& filename = "Untitled", const StringView& path = Core::StandardPaths::home_directory());
|
||||
|
||||
static String ok_button_name(Mode mode)
|
||||
{
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
}
|
||||
|
||||
@GUI::Label {
|
||||
text: "File name:"
|
||||
text: "Filename:"
|
||||
text_alignment: "CenterRight"
|
||||
fixed_height: 24
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ class CharacterMap {
|
|||
|
||||
public:
|
||||
CharacterMap(const String& map_name, const CharacterMapData& map_data);
|
||||
static Optional<CharacterMap> load_from_file(const String& file_name);
|
||||
static Optional<CharacterMap> load_from_file(const String& filename);
|
||||
|
||||
#ifndef KERNEL
|
||||
int set_system_map();
|
||||
|
|
|
@ -11,13 +11,13 @@
|
|||
|
||||
namespace Keyboard {
|
||||
|
||||
Optional<CharacterMapData> CharacterMapFile::load_from_file(const String& file_name)
|
||||
Optional<CharacterMapData> CharacterMapFile::load_from_file(const String& filename)
|
||||
{
|
||||
auto path = file_name;
|
||||
auto path = filename;
|
||||
if (!path.ends_with(".json")) {
|
||||
StringBuilder full_path;
|
||||
full_path.append("/res/keymaps/");
|
||||
full_path.append(file_name);
|
||||
full_path.append(filename);
|
||||
full_path.append(".json");
|
||||
path = full_path.to_string();
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ Optional<CharacterMapData> CharacterMapFile::load_from_file(const String& file_n
|
|||
auto file = Core::File::construct(path);
|
||||
file->open(Core::IODevice::ReadOnly);
|
||||
if (!file->is_open()) {
|
||||
dbgln("Failed to open {}: {}", file_name, file->error_string());
|
||||
dbgln("Failed to open {}: {}", filename, file->error_string());
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Keyboard {
|
|||
class CharacterMapFile {
|
||||
|
||||
public:
|
||||
static Optional<CharacterMapData> load_from_file(const String& file_name);
|
||||
static Optional<CharacterMapData> load_from_file(const String& filename);
|
||||
|
||||
private:
|
||||
static Vector<u32> read_map(const JsonObject& json, const String& name);
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
|
||||
namespace PCIDB {
|
||||
|
||||
RefPtr<Database> Database::open(const String& file_name)
|
||||
RefPtr<Database> Database::open(const String& filename)
|
||||
{
|
||||
auto file_or_error = MappedFile::map(file_name);
|
||||
auto file_or_error = MappedFile::map(filename);
|
||||
if (file_or_error.is_error())
|
||||
return nullptr;
|
||||
auto res = adopt_ref(*new Database(file_or_error.release_value()));
|
||||
|
|
|
@ -53,7 +53,7 @@ struct Class {
|
|||
|
||||
class Database : public RefCounted<Database> {
|
||||
public:
|
||||
static RefPtr<Database> open(const String& file_name);
|
||||
static RefPtr<Database> open(const String& filename);
|
||||
static RefPtr<Database> open() { return open("/res/pci.ids"); };
|
||||
|
||||
const StringView get_vendor(u16 vendor_id) const;
|
||||
|
|
|
@ -93,7 +93,7 @@ TerminalWidget::TerminalWidget(int ptm_fd, bool automatic_size_policy, RefPtr<Co
|
|||
update();
|
||||
};
|
||||
|
||||
dbgln("Load config file from {}", m_config->file_name());
|
||||
dbgln("Load config file from {}", m_config->filename());
|
||||
m_cursor_blink_timer->set_interval(m_config->read_num_entry("Text",
|
||||
"CursorBlinkInterval",
|
||||
500));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue