mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-19 22:25:36 +00:00
HackStudio: Port to Core::Stream::File :^)
This commit is contained in:
committed by
Andreas Kling
parent
697d6ffb1d
commit
4784ad66b2
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "ProjectFile.h"
|
||||
#include <LibCore/File.h>
|
||||
#include <LibCore/Stream.h>
|
||||
|
||||
namespace HackStudio {
|
||||
|
||||
@@ -54,7 +54,7 @@ void ProjectFile::create_document_if_needed() const
|
||||
return;
|
||||
|
||||
m_document = CodeDocument::create(m_name);
|
||||
auto file_or_error = Core::File::open(m_name, Core::OpenMode::ReadOnly);
|
||||
auto file_or_error = Core::Stream::File::open(m_name, Core::Stream::OpenMode::Read);
|
||||
if (file_or_error.is_error()) {
|
||||
warnln("Couldn't open '{}': {}", m_name, file_or_error.error());
|
||||
// This is okay though, we'll just go with an empty document and create the file when saving.
|
||||
@@ -62,7 +62,7 @@ void ProjectFile::create_document_if_needed() const
|
||||
}
|
||||
|
||||
auto& file = *file_or_error.value();
|
||||
m_could_render_text = m_document->set_text(file.read_all());
|
||||
m_could_render_text = m_document->set_text(file.read_until_eof().release_value_but_fixme_should_propagate_errors());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user