1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:47:35 +00:00

HexEditor: Fixed startup error

When attempting to open a file that doesnt exist or has permission
problems, the application would end after hitting OK on the message
box instead of starting up to an empty editor.

I believe this has something to do with the dialog event loop
interfering with the application event loop, or possibly the fact
that the window creation code is in the show() method.

To work around this I now call the open_file() method after the
show() method.
This commit is contained in:
Brandon Scott 2019-10-23 17:51:29 -05:00 committed by Andreas Kling
parent e3fbd2fe60
commit bddabad3d9

View file

@ -18,11 +18,11 @@ int main(int argc, char** argv)
return GWindow::CloseRequestDecision::StayOpen;
};
if (argc >= 2)
hex_editor_widget->open_file(argv[1]);
window->show();
window->set_icon(load_png("/res/icons/16x16/app-hexeditor.png"));
if (argc >= 2)
hex_editor_widget->open_file(argv[1]);
return app.exec();
}