Commit 8465dcbc authored by Adriaan de Groot's avatar Adriaan de Groot

[calamares] Don't crash in test-loader

- When loading *view* modules, we always need a QApplication for GUI
  bits, because the widget for a module is created is very early.
- If it's a view module, replace the application object with one
  that supports GUIs; without the --ui flag, though, it will just
  run the jobs.
parent 72857b75
......@@ -252,6 +252,12 @@ main( int argc, char* argv[] )
cDebug() << " .. got" << m->name() << m->typeString() << m->interfaceString();
if ( m->type() == Calamares::Module::Type::View )
{
if ( !qobject_cast< QApplication* >(aw) )
{
auto* replace_app = new QApplication( argc, argv );
replace_app->setQuitOnLastWindowClosed( true );
aw = replace_app;
}
mw = module.m_ui ? new QMainWindow() : nullptr;
(void)new Calamares::Branding( module.m_branding );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment