summaryrefslogtreecommitdiff
path: root/src/modinfo.cpp
diff options
context:
space:
mode:
authorJeremy Rimpo <jeremy.rimpo@servermonkey.com>2023-09-23 19:00:41 -0500
committerJeremy Rimpo <jeremy.rimpo@servermonkey.com>2023-09-23 19:00:41 -0500
commite22331fa0305d8a0a2b8b6d37203dac1ed3524e9 (patch)
tree3231affb718494c342fc6197bae2b784fde9fd21 /src/modinfo.cpp
parent31a85a3db5fcb34b36dc6ed6f56a351a5dcb319a (diff)
Restructure category refresh action
- Remove plugins class - Route signals to run Nexus API call from MainWindow - Pass Dialog instance to route response data - Revert CategoryFactory::instance to return reference
Diffstat (limited to 'src/modinfo.cpp')
-rw-r--r--src/modinfo.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/modinfo.cpp b/src/modinfo.cpp
index 0ae28e73..1028c66f 100644
--- a/src/modinfo.cpp
+++ b/src/modinfo.cpp
@@ -493,9 +493,9 @@ void ModInfo::setPluginSelected(const bool& isSelected)
void ModInfo::addCategory(const QString& categoryName)
{
- int id = CategoryFactory::instance()->getCategoryID(categoryName);
+ int id = CategoryFactory::instance().getCategoryID(categoryName);
if (id == -1) {
- id = CategoryFactory::instance()->addCategory(
+ id = CategoryFactory::instance().addCategory(
categoryName, std::vector<CategoryFactory::NexusCategory>(), 0);
}
setCategory(id, true);
@@ -503,7 +503,7 @@ void ModInfo::addCategory(const QString& categoryName)
bool ModInfo::removeCategory(const QString& categoryName)
{
- int id = CategoryFactory::instance()->getCategoryID(categoryName);
+ int id = CategoryFactory::instance().getCategoryID(categoryName);
if (id == -1) {
return false;
}
@@ -518,9 +518,9 @@ QStringList ModInfo::categories() const
{
QStringList result;
- CategoryFactory* catFac = CategoryFactory::instance();
+ CategoryFactory& catFac = CategoryFactory::instance();
for (int id : m_Categories) {
- result.append(catFac->getCategoryName(catFac->getCategoryIndex(id)));
+ result.append(catFac.getCategoryName(catFac.getCategoryIndex(id)));
}
return result;
@@ -550,7 +550,7 @@ bool ModInfo::categorySet(int categoryID) const
for (std::set<int>::const_iterator iter = m_Categories.begin();
iter != m_Categories.end(); ++iter) {
if ((*iter == categoryID) ||
- (CategoryFactory::instance()->isDescendantOf(*iter, categoryID))) {
+ (CategoryFactory::instance().isDescendantOf(*iter, categoryID))) {
return true;
}
}