From 666462651b74c26f3ebf0efe470b5d77c4745573 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sat, 14 Sep 2019 08:18:56 -0400 Subject: [PATCH] [libcalamares] Namespace consistently - Things in libcalamares/ subdirectories are namespaced according to that subdirectory (sometimes in namespace Calamares, sometimes CalamaresUtils). Do that in modulesystem/ too. --- src/libcalamares/Settings.cpp | 6 +++--- src/libcalamares/Settings.h | 2 +- src/libcalamares/modulesystem/Actions.h | 5 ++++- src/libcalamaresui/modulesystem/ModuleManager.cpp | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/libcalamares/Settings.cpp b/src/libcalamares/Settings.cpp index b55292bd4..456956430 100644 --- a/src/libcalamares/Settings.cpp +++ b/src/libcalamares/Settings.cpp @@ -169,14 +169,14 @@ interpretSequence( const YAML::Node& node, Settings::ModuleSequence& moduleSeque continue; } QString thisActionS = sequenceVListItem.toMap().firstKey(); - ModuleAction thisAction; + ModuleSystem::Action thisAction; if ( thisActionS == "show" ) { - thisAction = ModuleAction::Show; + thisAction = ModuleSystem::Action::Show; } else if ( thisActionS == "exec" ) { - thisAction = ModuleAction::Exec; + thisAction = ModuleSystem::Action::Exec; } else { diff --git a/src/libcalamares/Settings.h b/src/libcalamares/Settings.h index a52eac82e..4c2f2ed9d 100644 --- a/src/libcalamares/Settings.h +++ b/src/libcalamares/Settings.h @@ -46,7 +46,7 @@ public: using InstanceDescriptionList = QList< InstanceDescription >; InstanceDescriptionList customModuleInstances() const; - using ModuleSequence = QList< QPair< ModuleAction, QStringList > >; + using ModuleSequence = QList< QPair< ModuleSystem::Action, QStringList > >; ModuleSequence modulesSequence() const; QString brandingComponentName() const; diff --git a/src/libcalamares/modulesystem/Actions.h b/src/libcalamares/modulesystem/Actions.h index 06b5589c4..e1be0b867 100644 --- a/src/libcalamares/modulesystem/Actions.h +++ b/src/libcalamares/modulesystem/Actions.h @@ -22,13 +22,16 @@ namespace Calamares { +namespace ModuleSystem +{ -enum class ModuleAction : char +enum class Action : char { Show, Exec }; +} // namespace ModuleSystem } // namespace Calamares #endif diff --git a/src/libcalamaresui/modulesystem/ModuleManager.cpp b/src/libcalamaresui/modulesystem/ModuleManager.cpp index 487cb47c4..5bbfbe50a 100644 --- a/src/libcalamaresui/modulesystem/ModuleManager.cpp +++ b/src/libcalamaresui/modulesystem/ModuleManager.cpp @@ -190,7 +190,7 @@ ModuleManager::loadModules() = failedModules.isEmpty() ? Settings::instance()->modulesSequence() : Settings::ModuleSequence(); for ( const auto& modulePhase : modulesSequence ) { - ModuleAction currentAction = modulePhase.first; + ModuleSystem::Action currentAction = modulePhase.first; foreach ( const QString& moduleEntry, modulePhase.second ) { @@ -285,7 +285,7 @@ ModuleManager::loadModules() // At this point we most certainly have a pointer to a loaded module in // thisModule. We now need to enqueue jobs info into an EVS. - if ( currentAction == ModuleAction::Exec ) + if ( currentAction == ModuleSystem::Action::Exec ) { ExecutionViewStep* evs = qobject_cast< ExecutionViewStep* >( Calamares::ViewManager::instance()->viewSteps().last() );