summaryrefslogtreecommitdiff
path: root/src/profile.cpp
diff options
context:
space:
mode:
authorTannin <sherb@gmx.net>2016-01-10 20:19:56 +0100
committerTannin <sherb@gmx.net>2016-01-10 20:19:56 +0100
commit2aae65d6f6c1ab3309e54437a339d1644088c5c8 (patch)
treeb693c455a4433370724cfbaa23a66998a16027a9 /src/profile.cpp
parentddf841400ef4da235f11e9b67177a78bb3d519d4 (diff)
made instance-switching usable
this includes tons and tons of changes to how paths are determined. the profiles-dir can now also be configured
Diffstat (limited to 'src/profile.cpp')
-rw-r--r--src/profile.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/profile.cpp b/src/profile.cpp
index 4b916a2f..99a6bd90 100644
--- a/src/profile.cpp
+++ b/src/profile.cpp
@@ -22,6 +22,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "windows_error.h"
#include "modinfo.h"
#include "safewritefile.h"
+#include "settings.h"
#include <utility.h>
#include <util.h>
#include <error_report.h>
@@ -58,7 +59,7 @@ Profile::Profile(const QString &name, IPluginGame const *gamePlugin, bool useDef
: m_ModListWriter(std::bind(&Profile::writeModlistNow, this))
, m_GamePlugin(gamePlugin)
{
- QString profilesDir = qApp->property("dataPath").toString() + "/" + ToQString(AppConfig::profilesPath());
+ QString profilesDir = Settings::instance().getProfileDirectory();
QDir profileBase(profilesDir);
QString fixedName = name;
@@ -487,7 +488,7 @@ void Profile::setModPriority(unsigned int index, int &newPriority)
Profile *Profile::createPtrFrom(const QString &name, const Profile &reference, MOBase::IPluginGame const *gamePlugin)
{
- QString profileDirectory = qApp->property("dataPath").toString() + "/" + QString::fromStdWString(AppConfig::profilesPath()) + "/" + name;
+ QString profileDirectory = Settings::instance().getProfileDirectory() + "/" + name;
reference.copyFilesTo(profileDirectory);
return new Profile(QDir(profileDirectory), gamePlugin);
}
@@ -691,7 +692,7 @@ QString Profile::absolutePath() const
void Profile::rename(const QString &newName)
{
- QDir profileDir(qApp->property("dataPath").toString() + "/" + QString::fromStdWString(AppConfig::profilesPath()));
+ QDir profileDir(Settings::instance().getProfileDirectory());
profileDir.rename(name(), newName);
m_Directory = profileDir.absoluteFilePath(newName);
}