mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 17:55:08 +00:00
LibCore: Convert CFile to ObjectPtr
This commit is contained in:
parent
31b38ed88f
commit
8d550c174e
30 changed files with 135 additions and 134 deletions
|
@ -270,14 +270,14 @@ void TextEditorWidget::update_title()
|
|||
|
||||
void TextEditorWidget::open_sesame(const String& path)
|
||||
{
|
||||
CFile file(path);
|
||||
if (!file.open(CIODevice::ReadOnly)) {
|
||||
auto file = CFile::construct(path);
|
||||
if (!file->open(CIODevice::ReadOnly)) {
|
||||
GMessageBox::show(String::format("Opening \"%s\" failed: %s", path.characters(), strerror(errno)), "Error", GMessageBox::Type::Error, GMessageBox::InputType::OK, window());
|
||||
return;
|
||||
}
|
||||
|
||||
m_document_dirty = false;
|
||||
m_editor->set_text(file.read_all());
|
||||
m_editor->set_text(file->read_all());
|
||||
set_path(FileSystemPath(path));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue