summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-05-06 12:32:50 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-06 12:33:46 +0200
commit297a2762cd49a0183c841c5bb9dc6636be12c693 (patch)
treed847eb47b730d5d8644278b113dcf4f2c31ad29a
parentf3091d89aa05792a5fa3949122278bbb046bc4d4 (diff)
downloadserenity-297a2762cd49a0183c841c5bb9dc6636be12c693.zip
TextEditor: Rename "file_name" => "filename"
-rw-r--r--Userland/Applications/TextEditor/FileArgument.cpp14
-rw-r--r--Userland/Applications/TextEditor/FileArgument.h4
-rw-r--r--Userland/Applications/TextEditor/main.cpp2
3 files changed, 9 insertions, 11 deletions
diff --git a/Userland/Applications/TextEditor/FileArgument.cpp b/Userland/Applications/TextEditor/FileArgument.cpp
index 182268f908..f612123578 100644
--- a/Userland/Applications/TextEditor/FileArgument.cpp
+++ b/Userland/Applications/TextEditor/FileArgument.cpp
@@ -17,7 +17,7 @@ FileArgument::FileArgument(String file_argument)
if (Core::File::exists(file_argument)) {
// A file exists with the full specified name, don't attempt to parse it.
- m_file_name = file_argument;
+ m_filename = file_argument;
return;
}
@@ -32,28 +32,26 @@ FileArgument::FileArgument(String file_argument)
if (groups.size() > 3) {
// Both a line and column number were specified.
- auto file_name = groups.at(0).view.to_string();
+ auto filename = groups.at(0).view.to_string();
auto initial_line_number = groups.at(1).view.to_string().to_int();
auto initial_column_number = groups.at(2).view.to_string().to_int();
- m_file_name = file_name;
+ m_filename = filename;
if (initial_line_number.has_value() && initial_line_number.value() > 0)
m_line = initial_line_number.value();
if (initial_column_number.has_value())
m_column = initial_column_number.value();
} else if (groups.size() == 3) {
// Only a line number was specified.
- auto file_name = groups.at(0).view.to_string();
+ auto filename = groups.at(0).view.to_string();
auto initial_line_number = groups.at(1).view.to_string().to_int();
- m_file_name = file_name;
+ m_filename = filename;
if (initial_line_number.has_value() && initial_line_number.value() > 0)
m_line = initial_line_number.value();
} else {
// A colon was found at the end of the file name but no values were found after it.
- auto file_name = groups.at(0).view.to_string();
-
- m_file_name = file_name;
+ m_filename = groups.at(0).view.to_string();
}
}
diff --git a/Userland/Applications/TextEditor/FileArgument.h b/Userland/Applications/TextEditor/FileArgument.h
index 630b3477c3..2581e94600 100644
--- a/Userland/Applications/TextEditor/FileArgument.h
+++ b/Userland/Applications/TextEditor/FileArgument.h
@@ -14,12 +14,12 @@ public:
FileArgument(String);
~FileArgument();
- String file_name() { return m_file_name; }
+ String filename() { return m_filename; }
Optional<size_t> line() { return m_line; }
Optional<size_t> column() { return m_column; }
private:
- String m_file_name;
+ String m_filename;
Optional<size_t> m_line;
Optional<size_t> m_column;
};
diff --git a/Userland/Applications/TextEditor/main.cpp b/Userland/Applications/TextEditor/main.cpp
index a2246f2eb8..247f9ac4fd 100644
--- a/Userland/Applications/TextEditor/main.cpp
+++ b/Userland/Applications/TextEditor/main.cpp
@@ -72,7 +72,7 @@ int main(int argc, char** argv)
if (file_to_edit) {
// A file name was passed, parse any possible line and column numbers included.
FileArgument parsed_argument(file_to_edit);
- if (!text_widget.open_file(parsed_argument.file_name()))
+ if (!text_widget.open_file(parsed_argument.filename()))
return 1;
text_widget.editor().set_cursor_and_focus_line(parsed_argument.line().value_or(1) - 1, parsed_argument.column().value_or(0));
}