diff options
| author | Tannin <devnull@localhost> | 2013-03-27 12:32:23 +0100 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2013-03-27 12:32:23 +0100 |
| commit | 10485e15e4de3e1a6c30733ad2d4850591d31509 (patch) | |
| tree | d4ca59328823e5d6ff8be6f403f0eb8c5c7cf05a /src/categories.cpp | |
| parent | ec0ea9df8dabe686d3256665c7ed638660309915 (diff) | |
- some cleanup to hookdll
- exchanged grouping proxies with existing solution from the kde project
Diffstat (limited to 'src/categories.cpp')
| -rw-r--r-- | src/categories.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
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 <http://www.gnu.org/licenses/>. #include <QFile> #include <QDir> #include <QList> +#include <QCoreApplication> 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")); |
