From e555f7899689e959af69abd93311c97d39094c62 Mon Sep 17 00:00:00 2001 From: David Capello Date: Fri, 23 Apr 2010 19:02:17 -0300 Subject: [PATCH] Fixed OpenFilecommand::execute() to open files with errors (these errors in loading process are shown anyway). --- src/commands/cmd_open_file.cpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/commands/cmd_open_file.cpp b/src/commands/cmd_open_file.cpp index 49586624f..c76a964da 100644 --- a/src/commands/cmd_open_file.cpp +++ b/src/commands/cmd_open_file.cpp @@ -185,23 +185,20 @@ void OpenFileCommand::execute(Context* context) jthread_join(data->thread); // Show any error - if (fop->error) { + if (fop->error) console.printf(fop->error); + + Sprite *sprite = fop->sprite; + if (sprite) { + UIContext* context = UIContext::instance(); + + RecentFiles::addRecentFile(fop->filename); + context->add_sprite(sprite); + + set_sprite_in_more_reliable_editor(sprite); + } + else if (!fop_is_stop(fop)) unrecent = true; - } - else { - Sprite *sprite = fop->sprite; - if (sprite) { - UIContext* context = UIContext::instance(); - - RecentFiles::addRecentFile(fop->filename); - context->add_sprite(sprite); - - set_sprite_in_more_reliable_editor(sprite); - } - else if (!fop_is_stop(fop)) - unrecent = true; - } delete data->progress; jwidget_free(data->alert_window);