[contextualprocess] Helper methods for counting checks
This commit is contained in:
parent
8664400ee9
commit
87e2f13dc2
@ -175,4 +175,19 @@ ContextualProcessJob::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ContextualProcessJob::count()
|
||||||
|
{
|
||||||
|
return m_commands.count();
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ContextualProcessJob::count(const QString& variableName)
|
||||||
|
{
|
||||||
|
for ( const ContextualProcessBinding* binding : m_commands )
|
||||||
|
if ( binding->variable == variableName )
|
||||||
|
return binding->checks.count();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
CALAMARES_PLUGIN_FACTORY_DEFINITION( ContextualProcessJobFactory, registerPlugin<ContextualProcessJob>(); )
|
CALAMARES_PLUGIN_FACTORY_DEFINITION( ContextualProcessJobFactory, registerPlugin<ContextualProcessJob>(); )
|
||||||
|
@ -43,6 +43,11 @@ public:
|
|||||||
|
|
||||||
void setConfigurationMap( const QVariantMap& configurationMap ) override;
|
void setConfigurationMap( const QVariantMap& configurationMap ) override;
|
||||||
|
|
||||||
|
/// The number of bindings
|
||||||
|
int count();
|
||||||
|
/// The number of value-checks for the named binding (-1 if binding doesn't exist)
|
||||||
|
int count( const QString& variableName );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<ContextualProcessBinding*> m_commands;
|
QList<ContextualProcessBinding*> m_commands;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user