[escher] Change name: File --> Record, FileSystem --> Kallax

This commit is contained in:
Émilie Feral
2018-02-28 15:11:09 +01:00
committed by EmilieNumworks
parent 338ee4e0b0
commit b9a852a9d1
16 changed files with 268 additions and 267 deletions

View File

@@ -11,7 +11,7 @@ EditorController::EditorController(MenuController * menuController) :
ViewController(nullptr),
m_textArea(this),
m_areaBuffer(nullptr),
m_script(File()),
m_script(Record()),
m_menuController(menuController)
{
m_textArea.setDelegate(this);
@@ -26,7 +26,7 @@ void EditorController::setScript(Script script) {
m_script = script;
const char * scriptBody = m_script.readContent();
size_t scriptBodySize = strlen(scriptBody)+1;
size_t availableScriptSize = scriptBodySize + FileSystem::sharedFileSystem()->availableSize();
size_t availableScriptSize = scriptBodySize + Kallax::sharedKallax()->availableSize();
assert(m_areaBuffer == nullptr);
m_areaBuffer = new char[availableScriptSize];
strlcpy(m_areaBuffer, scriptBody, scriptBodySize);
@@ -36,9 +36,9 @@ void EditorController::setScript(Script script) {
// TODO: this should be done in textAreaDidFinishEditing maybe??
bool EditorController::handleEvent(Ion::Events::Event event) {
if (event == Ion::Events::OK || event == Ion::Events::Back) {
File::ErrorStatus err = m_script.writeContent(m_areaBuffer, strlen(m_areaBuffer)+1);
if (err == File::ErrorStatus::NoEnoughSpaceAvailable) {
assert(false); // This should not happen as we set the text area according to the available space in the File System
Record::ErrorStatus err = m_script.writeContent(m_areaBuffer, strlen(m_areaBuffer)+1);
if (err == Record::ErrorStatus::NoEnoughSpaceAvailable) {
assert(false); // This should not happen as we set the text area according to the available space in the Kallax
} else {
stackController()->pop();
}