From 8b406cac9b57a8e5f535087ea743f2e8fde46c79 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 13 Jun 2018 04:37:52 -0400 Subject: [PATCH] [libcalamaresui] Improve module loading - Add a TODO for allowing modules to come from somewhere other than the module loader (this would allow "internal" modules that are always present) - Warnings are warnings --- src/libcalamaresui/modulesystem/ViewModule.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/libcalamaresui/modulesystem/ViewModule.cpp b/src/libcalamaresui/modulesystem/ViewModule.cpp index 1f940b30b..317d32712 100644 --- a/src/libcalamaresui/modulesystem/ViewModule.cpp +++ b/src/libcalamaresui/modulesystem/ViewModule.cpp @@ -52,27 +52,32 @@ ViewModule::loadSelf() PluginFactory* pf = qobject_cast< PluginFactory* >( m_loader->instance() ); if ( !pf ) { - cDebug() << Q_FUNC_INFO << "No factory:" << m_loader->errorString(); + cWarning() << Q_FUNC_INFO << "No factory:" << m_loader->errorString(); return; } m_viewStep = pf->create< Calamares::ViewStep >(); if ( !m_viewStep ) { - cDebug() << Q_FUNC_INFO << "create() failed" << m_loader->errorString(); + cWarning() << Q_FUNC_INFO << "create() failed" << m_loader->errorString(); return; } -// cDebug() << "ViewModule loading self for instance" << instanceKey() -// << "\nViewModule at address" << this -// << "\nCalamares::PluginFactory at address" << pf -// << "\nViewStep at address" << m_viewStep; + } + // TODO: allow internal view steps to be created here; they would + // have to be linked into the main application somehow. + + // If any method created the view step, use it now. + if ( m_viewStep ) + { m_viewStep->setModuleInstanceKey( instanceKey() ); m_viewStep->setConfigurationMap( m_configurationMap ); ViewManager::instance()->addViewStep( m_viewStep ); m_loaded = true; cDebug() << "ViewModule" << instanceKey() << "loading complete."; } + else + cWarning() << Q_FUNC_INFO << "No view step was created"; }