Get rid of long rebuilds because of minor cmake config changes
This commit is contained in:
@ -15,6 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "MultiMC.h"
|
||||
#include "Config.h"
|
||||
|
||||
#include "MinecraftProcess.h"
|
||||
|
||||
@ -432,7 +433,7 @@ QStringList MinecraftProcess::javaArguments() const
|
||||
|
||||
void MinecraftProcess::arm()
|
||||
{
|
||||
emit log("MultiMC version: " + MMC->version().toString() + "\n\n");
|
||||
emit log("MultiMC version: " + BuildConfig.printableVersionString() + "\n\n");
|
||||
emit log("Minecraft folder is:\n" + workingDirectory() + "\n\n");
|
||||
|
||||
if (!preLaunch())
|
||||
|
@ -16,6 +16,8 @@
|
||||
#include "DownloadUpdateTask.h"
|
||||
|
||||
#include "MultiMC.h"
|
||||
#include "Config.h"
|
||||
|
||||
#include "logic/updater/UpdateChecker.h"
|
||||
#include "logic/net/NetJob.h"
|
||||
#include "pathutils.h"
|
||||
@ -29,7 +31,7 @@
|
||||
DownloadUpdateTask::DownloadUpdateTask(QString repoUrl, int versionId, QObject *parent)
|
||||
: Task(parent)
|
||||
{
|
||||
m_cVersionId = MMC->version().build;
|
||||
m_cVersionId = BuildConfig.VERSION_BUILD;
|
||||
|
||||
m_nRepoUrl = repoUrl;
|
||||
m_nVersionId = versionId;
|
||||
@ -58,7 +60,7 @@ void DownloadUpdateTask::processChannels()
|
||||
}
|
||||
|
||||
QList<UpdateChecker::ChannelListEntry> channels = checker->getChannelList();
|
||||
QString channelId = MMC->version().channel;
|
||||
QString channelId = BuildConfig.VERSION_CHANNEL;
|
||||
|
||||
m_cRepoUrl.clear();
|
||||
// Search through the channel list for a channel with the correct ID.
|
||||
@ -405,17 +407,18 @@ DownloadUpdateTask::processFileLists(NetJob *job,
|
||||
|
||||
if (isUpdater)
|
||||
{
|
||||
#ifdef MultiMC_UPDATER_FORCE_LOCAL
|
||||
QLOG_DEBUG() << "Skipping updater download and using local version.";
|
||||
#else
|
||||
auto cache_entry = MMC->metacache()->resolveEntry("root", entry.path);
|
||||
QLOG_DEBUG() << "Updater will be in " << cache_entry->getFullPath();
|
||||
// force check.
|
||||
cache_entry->stale = true;
|
||||
if(BuildConfig.UPDATER_FORCE_LOCAL)
|
||||
QLOG_DEBUG() << "Skipping updater download and using local version.";
|
||||
else
|
||||
{
|
||||
auto cache_entry = MMC->metacache()->resolveEntry("root", entry.path);
|
||||
QLOG_DEBUG() << "Updater will be in " << cache_entry->getFullPath();
|
||||
// force check.
|
||||
cache_entry->stale = true;
|
||||
|
||||
auto download = CacheDownload::make(QUrl(source.url), cache_entry);
|
||||
job->addNetAction(download);
|
||||
#endif
|
||||
auto download = CacheDownload::make(QUrl(source.url), cache_entry);
|
||||
job->addNetAction(download);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -5,11 +5,11 @@
|
||||
#include <QJsonArray>
|
||||
|
||||
#include "MultiMC.h"
|
||||
#include "MultiMCVersion.h"
|
||||
#include "Config.h"
|
||||
#include "logic/net/CacheDownload.h"
|
||||
|
||||
NotificationChecker::NotificationChecker(QObject *parent)
|
||||
: QObject(parent), m_notificationsUrl(QUrl(NOTIFICATION_URL))
|
||||
: QObject(parent), m_notificationsUrl(QUrl(BuildConfig.NOTIFICATION_URL))
|
||||
{
|
||||
// this will call checkForNotifications once the event loop is running
|
||||
QMetaObject::invokeMethod(this, "checkForNotifications", Qt::QueuedConnection);
|
||||
@ -93,13 +93,12 @@ void NotificationChecker::downloadSucceeded(int)
|
||||
|
||||
bool NotificationChecker::NotificationEntry::applies() const
|
||||
{
|
||||
MultiMCVersion version = MMC->version();
|
||||
bool channelApplies = channel.isEmpty() || channel == version.channel;
|
||||
bool platformApplies = platform.isEmpty() || platform == version.platform;
|
||||
bool channelApplies = channel.isEmpty() || channel == BuildConfig.VERSION_CHANNEL;
|
||||
bool platformApplies = platform.isEmpty() || platform == BuildConfig.BUILD_PLATFORM;
|
||||
bool fromApplies =
|
||||
from.isEmpty() || from == FULL_VERSION_STR || !versionLessThan(FULL_VERSION_STR, from);
|
||||
from.isEmpty() || from == BuildConfig.FULL_VERSION_STR || !versionLessThan(BuildConfig.FULL_VERSION_STR, from);
|
||||
bool toApplies =
|
||||
to.isEmpty() || to == FULL_VERSION_STR || !versionLessThan(to, FULL_VERSION_STR);
|
||||
to.isEmpty() || to == BuildConfig.FULL_VERSION_STR || !versionLessThan(to, BuildConfig.FULL_VERSION_STR);
|
||||
return channelApplies && platformApplies && fromApplies && toApplies;
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "UpdateChecker.h"
|
||||
|
||||
#include "MultiMC.h"
|
||||
#include "Config.h"
|
||||
|
||||
#include "logger/QsLog.h"
|
||||
|
||||
@ -30,7 +31,7 @@
|
||||
|
||||
UpdateChecker::UpdateChecker()
|
||||
{
|
||||
m_channelListUrl = CHANLIST_URL;
|
||||
m_channelListUrl = BuildConfig.CHANLIST_URL;
|
||||
m_updateChecking = false;
|
||||
m_chanListLoading = false;
|
||||
m_checkUpdateWaiting = false;
|
||||
@ -148,7 +149,7 @@ void UpdateChecker::updateCheckFinished(bool notifyNoUpdate)
|
||||
// We've got the version with the greatest ID number. Now compare it to our current build
|
||||
// number and update if they're different.
|
||||
int newBuildNumber = newestVersion.value("Id").toVariant().toInt();
|
||||
if (newBuildNumber != MMC->version().build)
|
||||
if (newBuildNumber != BuildConfig.VERSION_BUILD)
|
||||
{
|
||||
QLOG_DEBUG() << "Found newer version with ID" << newBuildNumber;
|
||||
// Update!
|
||||
|
Reference in New Issue
Block a user