summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorThomas Tanner <trtanner@btinternet.com>2015-11-20 18:07:06 +0000
committerThomas Tanner <trtanner@btinternet.com>2015-11-20 18:07:06 +0000
commit49de6e8d2555234c5da132c5fc35287083fe7ef7 (patch)
tree8214d4f1447c76e08a390e02944d5f6744725015 /src/main.cpp
parent9ac845779abeafa7031f49dbc6bf0143765b3cd9 (diff)
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
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp9
1 files changed, 5 insertions, 4 deletions
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;
}