From cdb613bf020efe85fdf50091abab6f2b72b18313 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 7 May 2019 07:09:10 -0400 Subject: [PATCH] [libcalamares] Move module-related things into subdirectory - Currently just moves a single enum, but this is prep-work for moving the non-GUI parts of the module system into libcalamares, to better support GUI-less operation. --- src/libcalamares/Settings.h | 3 +- src/libcalamares/Typedefs.h | 6 ---- src/libcalamares/modulesystem/Actions.h | 34 +++++++++++++++++++ .../modulesystem/ModuleManager.cpp | 2 +- 4 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 src/libcalamares/modulesystem/Actions.h diff --git a/src/libcalamares/Settings.h b/src/libcalamares/Settings.h index 79ed37ef8..66a03e3a0 100644 --- a/src/libcalamares/Settings.h +++ b/src/libcalamares/Settings.h @@ -23,7 +23,7 @@ #define SETTINGS_H #include "DllMacro.h" -#include "Typedefs.h" +#include "modulesystem/Actions.h" #include #include @@ -41,7 +41,6 @@ public: QObject* parent = nullptr ); static Settings* instance(); - //TODO: load from YAML then emit ready QStringList modulesSearchPaths() const; diff --git a/src/libcalamares/Typedefs.h b/src/libcalamares/Typedefs.h index 324f2b155..6d61b6995 100644 --- a/src/libcalamares/Typedefs.h +++ b/src/libcalamares/Typedefs.h @@ -29,12 +29,6 @@ class Job; typedef QSharedPointer< Job > job_ptr; using JobList = QList< job_ptr >; -enum ModuleAction : char -{ - Show, - Exec -}; - class ViewStep; typedef QList< ViewStep* > ViewStepList; diff --git a/src/libcalamares/modulesystem/Actions.h b/src/libcalamares/modulesystem/Actions.h new file mode 100644 index 000000000..069937235 --- /dev/null +++ b/src/libcalamares/modulesystem/Actions.h @@ -0,0 +1,34 @@ +/* === This file is part of Calamares - === + * + * Copyright 2014, Teo Mrnjavac + * Copyright 2019, Adriaan de Groot + * + * Calamares is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Calamares is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Calamares. If not, see . + */ + +#ifndef MODULESYSTEM_ACTIONS_H +#define MODULESYSTEM_ACTIONS_H + +namespace Calamares +{ + +enum class ModuleAction : char +{ + Show, + Exec +}; + +} // namespace + +#endif diff --git a/src/libcalamaresui/modulesystem/ModuleManager.cpp b/src/libcalamaresui/modulesystem/ModuleManager.cpp index 32fe09033..852f41445 100644 --- a/src/libcalamaresui/modulesystem/ModuleManager.cpp +++ b/src/libcalamaresui/modulesystem/ModuleManager.cpp @@ -277,7 +277,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 == Calamares::Exec ) + if ( currentAction == ModuleAction::Exec ) { ExecutionViewStep* evs = qobject_cast< ExecutionViewStep* >(