Skip to content

Commit

Permalink
Fix merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Silarn committed Sep 5, 2023
1 parent bbd7341 commit 348e256
Show file tree
Hide file tree
Showing 3 changed files with 1,962 additions and 1,239 deletions.
18 changes: 11 additions & 7 deletions src/categories.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.

using namespace MOBase;

CategoryFactory* CategoryFactory::s_Instance = nullptr;

QString CategoryFactory::categoriesFilePath()
{
return qApp->property("dataPath").toString() + "/categories.dat";
}

CategoryFactory::CategoryFactory()

QString CategoryFactory::nexusMappingFilePath()
CategoryFactory::CategoryFactory() : QObject()
{
return qApp->property("dataPath").toString() + "/nexuscatmap.dat";
atexit(&cleanup);
}

CategoryFactory::CategoryFactory() : QObject()
QString CategoryFactory::nexusMappingFilePath()
{
atexit(&cleanup);
return qApp->property("dataPath").toString() + "/nexuscatmap.dat";
}

void CategoryFactory::loadCategories()
Expand Down Expand Up @@ -143,7 +143,6 @@ void CategoryFactory::loadCategories()
if (needLoad) loadDefaultCategories();
}


CategoryFactory* CategoryFactory::instance()
{
static CategoryFactory s_Instance;
Expand Down Expand Up @@ -181,6 +180,11 @@ void CategoryFactory::setParents()
}
}

void CategoryFactory::cleanup()
{
delete s_Instance;
s_Instance = nullptr;
}

void CategoryFactory::saveCategories()
{
Expand Down
4 changes: 4 additions & 0 deletions src/categories.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,11 @@ class CategoryFactory : public QObject {

void setParents();

static void cleanup();

private:
static CategoryFactory* s_Instance;

std::vector<Category> m_Categories;
std::map<int, unsigned int> m_IDMap;
std::map<int, NexusCategory> m_NexusMap;
Expand Down
Loading

0 comments on commit 348e256

Please sign in to comment.