diff options
| author | Thomas Tanner <trtanner@btinternet.com> | 2015-11-20 18:07:06 +0000 |
|---|---|---|
| committer | Thomas Tanner <trtanner@btinternet.com> | 2015-11-20 18:07:06 +0000 |
| commit | 49de6e8d2555234c5da132c5fc35287083fe7ef7 (patch) | |
| tree | 8214d4f1447c76e08a390e02944d5f6744725015 /src/selfupdater.cpp | |
| parent | 9ac845779abeafa7031f49dbc6bf0143765b3cd9 (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/selfupdater.cpp')
| -rw-r--r-- | src/selfupdater.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/selfupdater.cpp b/src/selfupdater.cpp index bcf81cfd..7e42f322 100644 --- a/src/selfupdater.cpp +++ b/src/selfupdater.cpp @@ -159,7 +159,7 @@ void SelfUpdater::download(const QString &downloadLink, const QString &fileName) QNetworkRequest request(dlUrl);
m_Canceled = false;
m_Reply = accessManager->get(request);
- m_UpdateFile.setFileName(QDir::fromNativeSeparators(ToQString(GameInfo::instance().getOrganizerDirectory()).append("\\").append(fileName)));
+ m_UpdateFile.setFileName(QDir::fromNativeSeparators(qApp->property("dataPath").toString()).append("/").append(fileName));
m_UpdateFile.open(QIODevice::WriteOnly);
showProgress();
@@ -243,7 +243,7 @@ void SelfUpdater::downloadCancel() void SelfUpdater::installUpdate()
{
- const QString mopath = QDir::fromNativeSeparators(ToQString(GameInfo::instance().getOrganizerDirectory()));
+ const QString mopath = QDir::fromNativeSeparators(qApp->property("dataPath").toString());
QString backupPath = mopath + "/update_backup";
QDir().mkdir(backupPath);
@@ -281,7 +281,7 @@ void SelfUpdater::installUpdate() }
// now unpack the archive into the mo directory
- if (!m_CurrentArchive->extract(GameInfo::instance().getOrganizerDirectory().c_str(),
+ if (!m_CurrentArchive->extract(QDir::toNativeSeparators(mopath).toStdWString().c_str(),
new MethodCallback<SelfUpdater, void, float>(this, &SelfUpdater::updateProgress),
new MethodCallback<SelfUpdater, void, LPCWSTR>(this, &SelfUpdater::updateProgressFile),
new MethodCallback<SelfUpdater, void, LPCWSTR>(this, &SelfUpdater::report7ZipError))) {
|
