[libcalamares] Improve naming in implementation

- The code in loadYaml was refactored out of the module-descriptor
   loading code, but the variable names in the implementation were
   not changed and still strangely specific to the prior task.
This commit is contained in:
Adriaan de Groot 2019-01-25 11:59:17 -05:00
parent b3a7545217
commit 5efbf51ed3

View File

@ -173,15 +173,15 @@ loadYaml(const QString& filename, bool* ok)
if ( ok ) if ( ok )
*ok = false; *ok = false;
QFile descriptorFile( filename ); QFile yamlFile( filename );
QVariant moduleDescriptor; QVariant yamlContents;
if ( descriptorFile.exists() && descriptorFile.open( QFile::ReadOnly | QFile::Text ) ) if ( yamlFile.exists() && yamlFile.open( QFile::ReadOnly | QFile::Text ) )
{ {
QByteArray ba = descriptorFile.readAll(); QByteArray ba = yamlFile.readAll();
try try
{ {
YAML::Node doc = YAML::Load( ba.constData() ); YAML::Node doc = YAML::Load( ba.constData() );
moduleDescriptor = CalamaresUtils::yamlToVariant( doc ); yamlContents = CalamaresUtils::yamlToVariant( doc );
} }
catch ( YAML::Exception& e ) catch ( YAML::Exception& e )
{ {
@ -191,13 +191,13 @@ loadYaml(const QString& filename, bool* ok)
} }
if ( moduleDescriptor.isValid() && if ( yamlContents.isValid() &&
!moduleDescriptor.isNull() && !yamlContents.isNull() &&
moduleDescriptor.type() == QVariant::Map ) yamlContents.type() == QVariant::Map )
{ {
if ( ok ) if ( ok )
*ok = true; *ok = true;
return moduleDescriptor.toMap(); return yamlContents.toMap();
} }
return QVariantMap(); return QVariantMap();