diff options
Diffstat (limited to 'api/logic/updater')
-rw-r--r-- | api/logic/updater/DownloadTask.cpp | 11 | ||||
-rw-r--r-- | api/logic/updater/DownloadTask.h | 2 | ||||
-rw-r--r-- | api/logic/updater/DownloadTask_test.cpp | 19 | ||||
-rw-r--r-- | api/logic/updater/GoUpdate.cpp | 23 | ||||
-rw-r--r-- | api/logic/updater/GoUpdate.h | 9 | ||||
-rw-r--r-- | api/logic/updater/UpdateChecker.cpp | 2 | ||||
-rw-r--r-- | api/logic/updater/UpdateChecker.h | 2 | ||||
-rw-r--r-- | api/logic/updater/UpdateChecker_test.cpp | 9 |
8 files changed, 18 insertions, 59 deletions
diff --git a/api/logic/updater/DownloadTask.cpp b/api/logic/updater/DownloadTask.cpp index cb92018d..20b26ebb 100644 --- a/api/logic/updater/DownloadTask.cpp +++ b/api/logic/updater/DownloadTask.cpp @@ -1,4 +1,4 @@ -/* Copyright 2013-2018 MultiMC Contributors +/* Copyright 2013-2021 MultiMC Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -131,7 +131,14 @@ void DownloadTask::processDownloadedVersionInfo() QObject::connect(netJob.get(), &NetJob::progress, this, &DownloadTask::fileDownloadProgressChanged); QObject::connect(netJob.get(), &NetJob::failed, this, &DownloadTask::fileDownloadFailed); - setStatus(tr("Downloading %1 update files.").arg(QString::number(netJob->size()))); + if(netJob->size() == 1) // Translation issues... see https://github.com/MultiMC/MultiMC5/issues/1701 + { + setStatus(tr("Downloading one update file.")); + } + else + { + setStatus(tr("Downloading %1 update files.").arg(QString::number(netJob->size()))); + } qDebug() << "Begin downloading update files to" << m_updateFilesDir.path(); m_filesNetJob = netJob; m_filesNetJob->start(); diff --git a/api/logic/updater/DownloadTask.h b/api/logic/updater/DownloadTask.h index 30b4b9ec..88e60865 100644 --- a/api/logic/updater/DownloadTask.h +++ b/api/logic/updater/DownloadTask.h @@ -1,4 +1,4 @@ -/* Copyright 2013-2018 MultiMC Contributors +/* Copyright 2013-2021 MultiMC Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/api/logic/updater/DownloadTask_test.cpp b/api/logic/updater/DownloadTask_test.cpp index 531b2527..8d5375e8 100644 --- a/api/logic/updater/DownloadTask_test.cpp +++ b/api/logic/updater/DownloadTask_test.cpp @@ -185,25 +185,6 @@ slots: qDebug() << expectedOperations; QCOMPARE(operations, expectedOperations); } - - void test_OSXPathFixup() - { - QString path, pathOrig; - bool result; - // Proper OSX path - pathOrig = path = "MultiMC.app/Foo/Bar/Baz"; - qDebug() << "Proper OSX path: " << path; - result = fixPathForOSX(path); - QCOMPARE(path, QString("Foo/Bar/Baz")); - QCOMPARE(result, true); - - // Bad OSX path - pathOrig = path = "translations/klingon.lol"; - qDebug() << "Bad OSX path: " << path; - result = fixPathForOSX(path); - QCOMPARE(path, pathOrig); - QCOMPARE(result, false); - } }; extern "C" diff --git a/api/logic/updater/GoUpdate.cpp b/api/logic/updater/GoUpdate.cpp index ef040db6..6167418e 100644 --- a/api/logic/updater/GoUpdate.cpp +++ b/api/logic/updater/GoUpdate.cpp @@ -33,13 +33,7 @@ bool parseVersionInfo(const QByteArray &data, VersionFileList &list, QString &er QJsonObject fileObj = fileValue.toObject(); QString file_path = fileObj.value("Path").toString(); -#ifdef Q_OS_MAC - // On OSX, the paths for the updater need to be fixed. - // basically, anything that isn't in the .app folder is ignored. - // everything else is changed so the code that processes the files actually finds - // them and puts the replacements in the right spots. - fixPathForOSX(file_path); -#endif + VersionFileEntry file{file_path, fileObj.value("Perms").toVariant().toInt(), FileSourceList(), fileObj.value("MD5").toString(), }; qDebug() << "File" << file.path << "with perms" << file.mode; @@ -201,19 +195,4 @@ bool processFileLists } return true; } - -bool fixPathForOSX(QString &path) -{ - if (path.startsWith("MultiMC.app/")) - { - // remove the prefix and add a new, more appropriate one. - path.remove(0, 12); - return true; - } - else - { - qCritical() << "Update path not within .app: " << path; - return false; - } } -}
\ No newline at end of file diff --git a/api/logic/updater/GoUpdate.h b/api/logic/updater/GoUpdate.h index 54559a3c..8f92bb99 100644 --- a/api/logic/updater/GoUpdate.h +++ b/api/logic/updater/GoUpdate.h @@ -123,14 +123,5 @@ bool MULTIMC_LOGIC_EXPORT processFileLists OperationList &ops ); -/*! - * This fixes destination paths for OSX - removes 'MultiMC.app' prefix - * The updater runs in MultiMC.app/Contents/MacOs by default - * The destination paths are such as this: MultiMC.app/blah/blah - * - * @return false if the path couldn't be fixed (is invalid) - */ -bool MULTIMC_LOGIC_EXPORT fixPathForOSX(QString &path); - } Q_DECLARE_METATYPE(GoUpdate::Status) diff --git a/api/logic/updater/UpdateChecker.cpp b/api/logic/updater/UpdateChecker.cpp index 9e610d52..be33c73c 100644 --- a/api/logic/updater/UpdateChecker.cpp +++ b/api/logic/updater/UpdateChecker.cpp @@ -1,4 +1,4 @@ -/* Copyright 2013-2018 MultiMC Contributors +/* Copyright 2013-2021 MultiMC Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/api/logic/updater/UpdateChecker.h b/api/logic/updater/UpdateChecker.h index bb5013de..20906207 100644 --- a/api/logic/updater/UpdateChecker.h +++ b/api/logic/updater/UpdateChecker.h @@ -1,4 +1,4 @@ -/* Copyright 2013-2018 MultiMC Contributors +/* Copyright 2013-2021 MultiMC Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/api/logic/updater/UpdateChecker_test.cpp b/api/logic/updater/UpdateChecker_test.cpp index 59f2a5a1..5702d9c6 100644 --- a/api/logic/updater/UpdateChecker_test.cpp +++ b/api/logic/updater/UpdateChecker_test.cpp @@ -21,6 +21,11 @@ QDebug operator<<(QDebug dbg, const UpdateChecker::ChannelListEntry &c) return dbg.maybeSpace(); } +QString findTestDataUrl(const char *file) +{ + return QUrl::fromLocalFile(QFINDTESTDATA(file)).toString(); +} + class UpdateCheckerTest : public QObject { Q_OBJECT @@ -35,10 +40,6 @@ slots: } - static QString findTestDataUrl(const char *file) - { - return QUrl::fromLocalFile(QFINDTESTDATA(file)).toString(); - } void tst_ChannelListParsing_data() { QTest::addColumn<QString>("channel"); |