Allow user variables to be set from glabels-batch command line (#75)
This commit is contained in:
@@ -85,6 +85,27 @@ namespace glabels
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Set initial value of multiple variables
|
||||
///
|
||||
void Variables::setVariables( const QMap<QString,QString>& definitions )
|
||||
{
|
||||
for ( auto& name : definitions.keys() )
|
||||
{
|
||||
if ( hasVariable( name ) )
|
||||
{
|
||||
(*this)[name].setInitialValue( definitions[name] );
|
||||
}
|
||||
else
|
||||
{
|
||||
addVariable( Variable( Variable::Type::STRING,
|
||||
name,
|
||||
definitions[name] ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Reset variables to their initial values
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user