Merge pull request #1809 from dalto8/ismoduleenabled
[libcalamares] Add isModuleEnabled function
This commit is contained in:
commit
ebf8d63669
@ -269,6 +269,21 @@ Settings::Settings( const QString& settingsFilePath, bool debugMode )
|
|||||||
s_instance = this;
|
s_instance = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bool
|
||||||
|
Settings::isModuleEnabled( const QString& module )
|
||||||
|
{
|
||||||
|
// Iterate over the list of modules searching for a match
|
||||||
|
for ( const auto& moduleInstance : qAsConst( m_moduleInstances ) )
|
||||||
|
{
|
||||||
|
if ( moduleInstance.key().module() == module )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Settings::reconcileInstancesAndSequence()
|
Settings::reconcileInstancesAndSequence()
|
||||||
{
|
{
|
||||||
|
@ -152,8 +152,21 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool isSetupMode() const { return m_isSetupMode; }
|
bool isSetupMode() const { return m_isSetupMode; }
|
||||||
|
|
||||||
|
/** @brief Returns whether the named module is enabled
|
||||||
|
*
|
||||||
|
* Returns true if @p module is enabled in settings.conf. Be aware that it
|
||||||
|
* only tests for a specific module name so if a QML and non-QML version
|
||||||
|
* of the same module exists, it must be specified explicitly
|
||||||
|
*
|
||||||
|
* @p module is a module name or module key e.g. packagechooser) and not a
|
||||||
|
* full module key+id (e.g. packagechooser@packagechooser)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
const bool isModuleEnabled( const QString& module );
|
||||||
|
|
||||||
/** @brief Global setting of disable-cancel: can't cancel ever. */
|
/** @brief Global setting of disable-cancel: can't cancel ever. */
|
||||||
bool disableCancel() const { return m_disableCancel; }
|
bool disableCancel() const { return m_disableCancel; }
|
||||||
|
|
||||||
/** @brief Temporary setting of disable-cancel: can't cancel during exec. */
|
/** @brief Temporary setting of disable-cancel: can't cancel during exec. */
|
||||||
bool disableCancelDuringExec() const { return m_disableCancelDuringExec; }
|
bool disableCancelDuringExec() const { return m_disableCancelDuringExec; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user