[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.
This commit is contained in:
parent
72857b75d0
commit
8465dcbc19
@ -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 );
|
||||
|
Loading…
Reference in New Issue
Block a user