From 05aa96d20ca726908a7d8b1943f86f0c4e11bf18 Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Wed, 17 Jun 2026 01:46:09 -0500 Subject: Prepare Nexus-safe release cleanup --- .../installer/lib/ViewModels.h | 120 --------------------- 1 file changed, 120 deletions(-) delete mode 100644 libs/installer_fomod_plus/installer/lib/ViewModels.h (limited to 'libs/installer_fomod_plus/installer/lib/ViewModels.h') diff --git a/libs/installer_fomod_plus/installer/lib/ViewModels.h b/libs/installer_fomod_plus/installer/lib/ViewModels.h deleted file mode 100644 index 062445a..0000000 --- a/libs/installer_fomod_plus/installer/lib/ViewModels.h +++ /dev/null @@ -1,120 +0,0 @@ -#pragma once - -#include -#include - -#include "xml/ModuleConfiguration.h" - - -template -using shared_ptr_list = std::vector >; - - -/* --------------------------------------------------------------------------------- - Plugins --------------------------------------------------------------------------------- -*/ -class PluginViewModel { -public: - PluginViewModel(const std::shared_ptr& plugin_, const bool selected, bool, const int index) - : ownIndex(index), selected(selected), enabled(true), manuallySet(false), plugin(plugin_) {} - - void setSelected(const bool selected) { this->selected = selected; } - void setEnabled(const bool enabled) { this->enabled = enabled; } - [[nodiscard]] std::string getName() const { return plugin ? plugin->name : std::string(); } - [[nodiscard]] std::string getDescription() const { return plugin ? plugin->description : std::string(); } - [[nodiscard]] std::string getImagePath() const { return plugin ? plugin->image.path : std::string(); } - [[nodiscard]] bool isSelected() const { return selected; } - [[nodiscard]] bool isEnabled() const { return enabled; } - [[nodiscard]] int getOwnIndex() const { return ownIndex; } - [[nodiscard]] std::vector getConditionFlags() const { return plugin->conditionFlags.flags; } - [[nodiscard]] PluginTypeEnum getCurrentPluginType() const { return currentPluginType; } - [[nodiscard]] bool wasManuallySet() const { return manuallySet; } - - void setCurrentPluginType(const PluginTypeEnum type) { currentPluginType = type; } - void setStepIndex(const int stepIndex) { this->stepIndex = stepIndex; } - void setGroupIndex(const int groupIndex) { this->groupIndex = groupIndex; } - - [[nodiscard]] int getStepIndex() const { return stepIndex; } - [[nodiscard]] int getGroupIndex() const { return groupIndex; } - - friend class FomodViewModel; - friend class FileInstaller; - friend class ConditionTester; - -protected: - [[nodiscard]] std::shared_ptr getPlugin() const { return plugin; } - -private: - int ownIndex; - bool selected; - bool enabled; - bool manuallySet; - PluginTypeEnum currentPluginType = PluginTypeEnum::UNKNOWN; - std::shared_ptr plugin; - - int stepIndex{ -1 }; - int groupIndex{ -1 }; -}; - -/* --------------------------------------------------------------------------------- - Groups --------------------------------------------------------------------------------- -*/ -class GroupViewModel { -public: - GroupViewModel(const std::shared_ptr& group_, const shared_ptr_list& plugins, - const int index, const int stepIndex) - : plugins(plugins), group(group_), ownIndex(index), stepIndex(stepIndex) {} - - void addPlugin(const std::shared_ptr& plugin) { plugins.emplace_back(plugin); } - - [[nodiscard]] std::string getName() const { return group->name; } - [[nodiscard]] GroupTypeEnum getType() const { return group->type; } - [[nodiscard]] const shared_ptr_list& getPlugins() const { return plugins; } - [[nodiscard]] int getOwnIndex() const { return ownIndex; } - [[nodiscard]] int getStepIndex() const { return stepIndex; } - -private: - shared_ptr_list plugins; - std::shared_ptr group; - int ownIndex; - int stepIndex; -}; - -/* --------------------------------------------------------------------------------- - Steps --------------------------------------------------------------------------------- -*/ -class StepViewModel { -public: - StepViewModel(const std::shared_ptr& installStep_, const shared_ptr_list& groups, - const int index) - : installStep(installStep_), groups(groups), ownIndex(index) {} - - [[nodiscard]] CompositeDependency& getVisibilityConditions() const { return installStep->visible; } - [[nodiscard]] std::string getName() const { return installStep->name; } - [[nodiscard]] const shared_ptr_list& getGroups() const { return groups; } - [[nodiscard]] int getOwnIndex() const { return ownIndex; } - [[nodiscard]] bool getHasVisited() const { return visited; } - void setVisited(const bool visited) { this->visited = visited; } - -private: - bool visited{ false }; - std::shared_ptr installStep; - shared_ptr_list groups; - int ownIndex; -}; - - -/* --------------------------------------------------------------------------------- - Outbound Types --------------------------------------------------------------------------------- -*/ -using StepRef = const std::shared_ptr&; -using GroupRef = const std::shared_ptr&; -using PluginRef = const std::shared_ptr&; -- cgit v1.3.1