From 10485e15e4de3e1a6c30733ad2d4850591d31509 Mon Sep 17 00:00:00 2001 From: Tannin Date: Wed, 27 Mar 2013 12:32:23 +0100 Subject: - some cleanup to hookdll - exchanged grouping proxies with existing solution from the kde project --- src/categories.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/categories.cpp') diff --git a/src/categories.cpp b/src/categories.cpp index 7b765afe..62ba3ca5 100644 --- a/src/categories.cpp +++ b/src/categories.cpp @@ -25,6 +25,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include using namespace MOBase; @@ -34,11 +35,17 @@ using namespace MOShared; CategoryFactory* CategoryFactory::s_Instance = NULL; +QString CategoryFactory::categoriesFilePath() +{ + return QCoreApplication::applicationDirPath() + "/categories.dat"; +} + + CategoryFactory::CategoryFactory() { reset(); - QFile categoryFile(QDir::fromNativeSeparators(ToQString(GameInfo::instance().getOrganizerDirectory())).append("/categories.dat")); + QFile categoryFile(categoriesFilePath()); if (!categoryFile.open(QIODevice::ReadOnly)) { loadDefaultCategories(); @@ -120,7 +127,7 @@ void CategoryFactory::setParents() void CategoryFactory::saveCategories() { - QFile categoryFile(QDir::fromNativeSeparators(ToQString(GameInfo::instance().getOrganizerDirectory())).append("/categories.dat")); + QFile categoryFile(categoriesFilePath()); if (!categoryFile.open(QIODevice::WriteOnly)) { reportError(QObject::tr("Failed to save custom categories")); -- cgit v1.3.1