mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 18:57:35 +00:00
TextEditor: Rename open_sesame() => open_file()
This commit is contained in:
parent
69d8ad52c4
commit
28720e9035
3 changed files with 5 additions and 5 deletions
|
@ -305,7 +305,7 @@ TextEditorWidget::TextEditorWidget()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
open_sesame(open_path.value());
|
open_file(open_path.value());
|
||||||
});
|
});
|
||||||
|
|
||||||
m_save_as_action = GUI::CommonActions::make_save_as_action([&](auto&) {
|
m_save_as_action = GUI::CommonActions::make_save_as_action([&](auto&) {
|
||||||
|
@ -582,7 +582,7 @@ void TextEditorWidget::update_title()
|
||||||
window()->set_title(builder.to_string());
|
window()->set_title(builder.to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEditorWidget::open_sesame(const String& path)
|
void TextEditorWidget::open_file(const String& path)
|
||||||
{
|
{
|
||||||
auto file = Core::File::construct(path);
|
auto file = Core::File::construct(path);
|
||||||
if (!file->open(Core::IODevice::ReadOnly) && file->error() != ENOENT) {
|
if (!file->open(Core::IODevice::ReadOnly) && file->error() != ENOENT) {
|
||||||
|
@ -629,7 +629,7 @@ void TextEditorWidget::drop_event(GUI::DropEvent& event)
|
||||||
GUI::MessageBox::show(window(), "TextEditor can only open one file at a time!", "One at a time please!", GUI::MessageBox::Type::Error);
|
GUI::MessageBox::show(window(), "TextEditor can only open one file at a time!", "One at a time please!", GUI::MessageBox::Type::Error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
open_sesame(urls.first().path());
|
open_file(urls.first().path());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ class TextEditorWidget final : public GUI::Widget {
|
||||||
C_OBJECT(TextEditorWidget)
|
C_OBJECT(TextEditorWidget)
|
||||||
public:
|
public:
|
||||||
virtual ~TextEditorWidget() override;
|
virtual ~TextEditorWidget() override;
|
||||||
void open_sesame(const String& path);
|
void open_file(const String& path);
|
||||||
bool request_close();
|
bool request_close();
|
||||||
|
|
||||||
GUI::TextEditor& editor() { return *m_editor; }
|
GUI::TextEditor& editor() { return *m_editor; }
|
||||||
|
|
|
@ -83,7 +83,7 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_to_edit)
|
if (file_to_edit)
|
||||||
text_widget.open_sesame(file_to_edit);
|
text_widget.open_file(file_to_edit);
|
||||||
else
|
else
|
||||||
text_widget.update_title();
|
text_widget.update_title();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue