summaryrefslogtreecommitdiff
path: root/src/categories.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/categories.cpp')
-rw-r--r--src/categories.cpp11
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"));