NOISSUE hack it together enough to get launching back

Meta index will now always return valid objects.
They just might never load if they don't exist on the server.
This commit is contained in:
Petr Mrázek
2017-03-19 02:13:49 +01:00
parent e46aba9da5
commit 2660418d58
12 changed files with 162 additions and 58 deletions

View File

@ -83,17 +83,19 @@ bool Index::hasUid(const QString &uid) const
VersionListPtr Index::get(const QString &uid)
{
return m_uids.value(uid, nullptr);
VersionListPtr out = m_uids.value(uid, nullptr);
if(!out)
{
out = std::make_shared<VersionList>(uid);
m_uids[uid] = out;
}
return out;
}
VersionPtr Index::get(const QString &uid, const QString &version)
{
auto list = get(uid);
if(list)
{
return list->getVersion(version);
}
return nullptr;
return list->getVersion(version);
}
void Index::parse(const QJsonObject& obj)