diff --git a/src/api/sorting/plugin_sorting_data.cpp b/src/api/sorting/plugin_sorting_data.cpp index 1f1f1abc..56a1e501 100644 --- a/src/api/sorting/plugin_sorting_data.cpp +++ b/src/api/sorting/plugin_sorting_data.cpp @@ -60,6 +60,7 @@ PluginSortingData::PluginSortingData( #endif plugin_(plugin), name_(plugin == nullptr ? std::string() : plugin->GetName()), + isMaster_(plugin != nullptr && plugin->IsMaster()), group_(userMetadata.GetGroup().value_or( masterlistMetadata.GetGroup().value_or(Group::DEFAULT_NAME))), masterlistLoadAfter_(masterlistMetadata.GetLoadAfterFiles()), @@ -92,12 +93,10 @@ PluginSortingData::PluginSortingData( const std::string& PluginSortingData::GetName() const { return name_; } -bool PluginSortingData::IsMaster() const { - return plugin_ != nullptr && plugin_->IsMaster(); -} +bool PluginSortingData::IsMaster() const { return isMaster_; } bool PluginSortingData::IsBlueprintMaster() const { - return plugin_ != nullptr && plugin_->IsMaster() && + return isMaster_ && plugin_->IsBlueprintPlugin(); } diff --git a/src/api/sorting/plugin_sorting_data.h b/src/api/sorting/plugin_sorting_data.h index 1383e67e..715cbcf9 100644 --- a/src/api/sorting/plugin_sorting_data.h +++ b/src/api/sorting/plugin_sorting_data.h @@ -73,6 +73,7 @@ class PluginSortingData { private: const PluginSortingInterface* plugin_{nullptr}; std::string name_; + bool isMaster_{false}; std::string group_; std::vector masterlistLoadAfter_;