From 49de6e8d2555234c5da132c5fc35287083fe7ef7 Mon Sep 17 00:00:00 2001 From: Thomas Tanner Date: Fri, 20 Nov 2015 18:07:06 +0000 Subject: Get rid of `GameIfo::getOrganizerDirectory` and associated member variable qApp->getProperty("dataPath") can be used instead (and is pretty much everywhere else) so it's unnecessary --- src/main.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 773bfc16..ff34145d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -86,7 +86,8 @@ using namespace MOShared; bool createAndMakeWritable(const std::wstring &subPath) { - QString fullPath = qApp->property("dataPath").toString() + "/" + QString::fromStdWString(subPath); + QString const dataPath = qApp->property("dataPath").toString(); + QString fullPath = dataPath + "/" + QString::fromStdWString(subPath); if (!QDir(fullPath).exists()) { QDir().mkdir(fullPath); @@ -100,7 +101,7 @@ bool createAndMakeWritable(const std::wstring &subPath) "will be made writable for the current user account). You will be asked to run " "\"helper.exe\" with administrative rights."), QMessageBox::Yes | QMessageBox::Cancel) == QMessageBox::Yes) { - if (!Helper::init(GameInfo::instance().getOrganizerDirectory())) { + if (!Helper::init(dataPath.toStdWString())) { return false; } } else { @@ -341,7 +342,7 @@ int main(int argc, char *argv[]) instanceID = instanceFile.readAll().trimmed(); } - QString dataPath = + QString const dataPath = instanceID.isEmpty() ? application.applicationDirPath() : QDir::fromNativeSeparators( QStandardPaths::writableLocation(QStandardPaths::DataLocation) @@ -373,7 +374,7 @@ int main(int argc, char *argv[]) QSplashScreen splash(pixmap); try { - if (!bootstrap()) { // requires gameinfo to be initialised! + if (!bootstrap()) { return -1; } -- cgit v1.3.1