@ -213,6 +213,16 @@ interpretSequence( const YAML::Node& node, Settings::ModuleSequence& moduleSeque
}
}
}
}
Settings : : Settings ( bool debugMode )
: QObject ( )
, m_debug ( debugMode )
, m_doChroot ( true )
, m_promptInstall ( false )
, m_disableCancel ( false )
, m_disableCancelDuringExec ( false )
{
}
Settings : : Settings ( const QString & settingsFilePath , bool debugMode )
Settings : : Settings ( const QString & settingsFilePath , bool debugMode )
: QObject ( )
: QObject ( )
, m_debug ( debugMode )
, m_debug ( debugMode )
@ -225,15 +235,26 @@ Settings::Settings( const QString& settingsFilePath, bool debugMode )
QFile file ( settingsFilePath ) ;
QFile file ( settingsFilePath ) ;
if ( file . exists ( ) & & file . open ( QFile : : ReadOnly | QFile : : Text ) )
if ( file . exists ( ) & & file . open ( QFile : : ReadOnly | QFile : : Text ) )
{
{
QByteArray ba = file . readAll ( ) ;
setConfiguration ( file . readAll ( ) , file . fileName ( ) ) ;
}
else
{
cWarning ( ) < < " Cannot read settings file " < < file . fileName ( ) ;
}
s_instance = this ;
}
void
Settings : : setConfiguration ( const QByteArray & ba , const QString & explainName )
{
try
try
{
{
YAML : : Node config = YAML : : Load ( ba . constData ( ) ) ;
YAML : : Node config = YAML : : Load ( ba . constData ( ) ) ;
Q_ASSERT ( config . IsMap ( ) ) ;
Q_ASSERT ( config . IsMap ( ) ) ;
interpretModulesSearch (
interpretModulesSearch (
debugMode , CalamaresUtils : : yamlToStringList ( config [ " modules-search " ] ) , m_modulesSearchPaths ) ;
debugMode ( ) , CalamaresUtils : : yamlToStringList ( config [ " modules-search " ] ) , m_modulesSearchPaths ) ;
interpretInstances ( config [ " instances " ] , m_customModuleInstances ) ;
interpretInstances ( config [ " instances " ] , m_customModuleInstances ) ;
interpretSequence ( config [ " sequence " ] , m_modulesSequence ) ;
interpretSequence ( config [ " sequence " ] , m_modulesSequence ) ;
@ -247,18 +268,10 @@ Settings::Settings( const QString& settingsFilePath, bool debugMode )
}
}
catch ( YAML : : Exception & e )
catch ( YAML : : Exception & e )
{
{
CalamaresUtils : : explainYamlException ( e , ba , file . fileName ( ) ) ;
CalamaresUtils : : explainYamlException ( e , ba , explainName ) ;
}
}
}
else
{
cWarning ( ) < < " Cannot read settings file " < < file . fileName ( ) ;
}
s_instance = this ;
}
}
QStringList
QStringList
Settings : : modulesSearchPaths ( ) const
Settings : : modulesSearchPaths ( ) const
{
{