summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mainwindow.cpp8
-rw-r--r--src/profile.cpp10
-rw-r--r--src/profile.h15
3 files changed, 9 insertions, 24 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index ceb118ea..c08993c1 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1258,9 +1258,11 @@ QDir MainWindow::currentSavesDir() const
savesDir.setPath(m_OrganizerCore.currentProfile()->absolutePath() + "/saves");
} else {
wchar_t path[MAX_PATH];
- ::GetPrivateProfileStringW(L"General", L"SLocalSavePath", L"Saves",
- path, MAX_PATH,
- (ToWString(m_OrganizerCore.currentProfile()->absolutePath()) + L"\\" + GameInfo::instance().getIniFileNames().at(0)).c_str());
+ ::GetPrivateProfileStringW(
+ L"General", L"SLocalSavePath", L"Saves",
+ path, MAX_PATH,
+ ToWString(m_OrganizerCore.currentProfile()->absolutePath() + "/" +
+ m_OrganizerCore.managedGame()->getIniFiles()[0]).c_str());
savesDir.setPath(m_OrganizerCore.managedGame()->documentsDirectory().absoluteFilePath(QString::fromWCharArray(path)));
}
diff --git a/src/profile.cpp b/src/profile.cpp
index c6a2b43d..42dc56d1 100644
--- a/src/profile.cpp
+++ b/src/profile.cpp
@@ -46,13 +46,6 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
using namespace MOBase;
using namespace MOShared;
-
-Profile::Profile()
- : m_ModListWriter(std::bind(&Profile::writeModlistNow, this))
- , m_GamePlugin(qApp->property("managed_game").value<IPluginGame*>())
-{
-}
-
void Profile::touchFile(QString fileName)
{
QFile modList(m_Directory.filePath(fileName));
@@ -679,8 +672,7 @@ QString Profile::getDeleterFileName() const
QString Profile::getIniFileName() const
{
- std::wstring primaryIniFile = *(GameInfo::instance().getIniFileNames().begin());
- return m_Directory.absoluteFilePath(ToQString(primaryIniFile));
+ return m_Directory.absoluteFilePath(m_GamePlugin->getIniFiles()[0]);
}
QString Profile::getProfileTweaks() const
diff --git a/src/profile.h b/src/profile.h
index 9c8139e9..e9edca56 100644
--- a/src/profile.h
+++ b/src/profile.h
@@ -24,17 +24,16 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "modinfo.h"
#include <iprofile.h>
#include <delayedfilewriter.h>
+
#include <QString>
#include <QDir>
-#include <QMetaType>
#include <QSettings>
+
#include <vector>
#include <tuple>
-namespace MOBase {
- class IPluginGame;
-}
+namespace MOBase { class IPluginGame; }
/**
* @brief represents a profile
@@ -51,12 +50,6 @@ public:
public:
/**
- * @brief default constructor
- * @todo This constructor initialised nothing, the resulting object is not usable
- **/
- Profile();
-
- /**
* @brief constructor
*
* This constructor is used to create a new profile so it is to be assumed a profile
@@ -320,7 +313,5 @@ private:
};
-Q_DECLARE_METATYPE(Profile)
-
#endif // PROFILE_H