summaryrefslogtreecommitdiff
path: root/src/categories.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/categories.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/categories.cpp')
-rw-r--r--src/categories.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/categories.cpp b/src/categories.cpp
index 18cee4f9..5d0d2bb7 100644
--- a/src/categories.cpp
+++ b/src/categories.cpp
@@ -146,10 +146,10 @@ void CategoryFactory::loadCategories()
loadDefaultCategories();
}
-CategoryFactory* CategoryFactory::instance()
+CategoryFactory& CategoryFactory::instance()
{
static CategoryFactory s_Instance;
- return &s_Instance;
+ return s_Instance;
}
void CategoryFactory::reset()
@@ -285,7 +285,7 @@ void CategoryFactory::addCategory(int id, const QString& name,
void CategoryFactory::setNexusCategories(
std::vector<CategoryFactory::NexusCategory>& nexusCats)
{
- m_NexusMap.empty();
+ m_NexusMap.clear();
for (auto nexusCat : nexusCats) {
m_NexusMap.emplace(nexusCat.m_ID, nexusCat);
}
@@ -293,6 +293,11 @@ void CategoryFactory::setNexusCategories(
saveCategories();
}
+void CategoryFactory::refreshNexusCategories(CategoriesDialog* dialog)
+{
+ emit nexusCategoryRefresh(dialog);
+}
+
void CategoryFactory::loadDefaultCategories()
{
// the order here is relevant as it defines the order in which the