diff options
| author | Thomas Tanner <trtanner@btinternet.com> | 2015-11-25 08:22:40 +0000 |
|---|---|---|
| committer | Thomas Tanner <trtanner@btinternet.com> | 2015-11-25 08:22:40 +0000 |
| commit | 78b686b2bc507a5606bc7c673745b02346bc667a (patch) | |
| tree | d161d6096289aed99cfb1bf79cce4c2404c202dd /src/directoryrefresher.cpp | |
| parent | 42a68689fe60ba29367dc0c8f65083d9bde93e1f (diff) | |
Removes all references to GameInfo::getGameDirectory apart from one during startup
Did some const correctness improvements
Also may have fixed a potential crash as the Profile copy constructor didn't copy the m_GamePlugin membber
Diffstat (limited to 'src/directoryrefresher.cpp')
| -rw-r--r-- | src/directoryrefresher.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/directoryrefresher.cpp b/src/directoryrefresher.cpp index c253f384..f4ad2a7d 100644 --- a/src/directoryrefresher.cpp +++ b/src/directoryrefresher.cpp @@ -18,10 +18,14 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. */
#include "directoryrefresher.h"
+
+#include "iplugingame.h"
#include "utility.h"
#include "report.h"
#include "modinfo.h"
#include <gameinfo.h>
+
+#include <QApplication>
#include <QDir>
#include <QString>
@@ -141,7 +145,9 @@ void DirectoryRefresher::refresh() m_DirectoryStructure = new DirectoryEntry(L"data", nullptr, 0);
- std::wstring dataDirectory = GameInfo::instance().getGameDirectory() + L"\\data";
+ IPluginGame *game = qApp->property("managed_game").value<IPluginGame*>();
+
+ std::wstring dataDirectory = QDir::toNativeSeparators(game->dataDirectory().absolutePath()).toStdWString();
m_DirectoryStructure->addFromOrigin(L"data", dataDirectory, 0);
// TODO what was the point of having the priority in this tuple? the list is already sorted by priority
|
