Fixes an issue reported by @rphohl that XSwiftBus is not found

* only download non-restricted versions
* utility functions to find non-restricted versions
This commit is contained in:
Klaus Basan
2018-01-29 07:52:20 +01:00
parent 39533a7508
commit c6b942dc15
7 changed files with 29 additions and 3 deletions

View File

@@ -56,6 +56,11 @@ namespace BlackMisc
return m_platform.matchesAny(platform);
}
bool CArtifact::hasUnrestrictedDistribution() const
{
return m_distributions.containsUnrestricted();
}
bool CArtifact::isWithDistribution(const CDistribution &distribution, bool acceptMoreStableDistributions) const
{
if (distribution.isEmpty() || !this->hasDistributions()) { return false; }
@@ -73,6 +78,7 @@ namespace BlackMisc
CRemoteFile rf(this->getName(), this->getFileSize());
const CDistribution d = this->getMostStableDistribution();
const CUrl url = d.getDownloadUrls().getRandomUrl();
if (url.isEmpty()) { return CRemoteFile(); }
rf.setUtcTimestamp(this->getUtcTimestamp());
rf.setUrl(url);
rf.setDescription(this->getPlatform().toQString() + " " + d.getChannel());