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/selfupdater.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/selfupdater.cpp') 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(this, &SelfUpdater::updateProgress), new MethodCallback(this, &SelfUpdater::updateProgressFile), new MethodCallback(this, &SelfUpdater::report7ZipError))) { -- cgit v1.3.1