Fix issues with new updater; fix #2465 (#2468)

* fix #2465
This commit is contained in:
ctrlaltca 2017-03-13 23:21:15 +01:00 committed by GitHub
parent f9a025081a
commit 2817f54c96
3 changed files with 12 additions and 5 deletions

View file

@ -16,6 +16,7 @@
#define DEVFILES_URL "https://api.bintray.com/packages/cockatrice/Cockatrice/Cockatrice-git/files"
#define DEVDOWNLOAD_URL "https://dl.bintray.com/cockatrice/Cockatrice/"
#define DEVMANUALDOWNLOAD_URL "https://bintray.com/cockatrice/Cockatrice/Cockatrice-git/_latestVersion#files"
#define DEVRELEASE_DESCURL "https://github.com/Cockatrice/Cockatrice/compare/%1...%2"
#define GIT_SHORT_HASH_LEN 7
int ReleaseChannel::sharedIndex = 0;
@ -253,11 +254,15 @@ void DevReleaseChannel::releaseListFinished()
if(!lastRelease)
lastRelease = new Release;
lastRelease->setName("Commit " + resultMap["sha"].toString());
lastRelease->setDescriptionUrl(resultMap["html_url"].toString());
lastRelease->setCommitHash(resultMap["sha"].toString());
lastRelease->setPublishDate(resultMap["commit"].toMap()["author"].toMap()["date"].toDate());
QString shortHash = lastRelease->getCommitHash().left(GIT_SHORT_HASH_LEN);
lastRelease->setName("Commit " + shortHash);
lastRelease->setDescriptionUrl(QString(DEVRELEASE_DESCURL).arg(VERSION_COMMIT, shortHash));
qDebug() << "Got reply from release server, size=" << tmp.size()
<< "name=" << lastRelease->getName()
<< "desc=" << lastRelease->getDescriptionUrl()