summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
Diffstat (limited to 'api')
-rw-r--r--api/logic/meta/VersionList.cpp4
-rw-r--r--api/logic/minecraft/ComponentList.cpp8
-rw-r--r--api/logic/minecraft/ComponentList.h4
3 files changed, 10 insertions, 6 deletions
diff --git a/api/logic/meta/VersionList.cpp b/api/logic/meta/VersionList.cpp
index 8910c4d7..1387f282 100644
--- a/api/logic/meta/VersionList.cpp
+++ b/api/logic/meta/VersionList.cpp
@@ -205,6 +205,10 @@ void VersionList::merge(const BaseEntity::Ptr &other)
// TODO: do not reset the whole model. maybe?
beginResetModel();
m_versions.clear();
+ if(list->m_versions.isEmpty())
+ {
+ qWarning() << "Empty list loaded ...";
+ }
for (const VersionPtr &version : list->m_versions)
{
// we already have the version. merge the contents
diff --git a/api/logic/minecraft/ComponentList.cpp b/api/logic/minecraft/ComponentList.cpp
index 6547a851..dbf6ee08 100644
--- a/api/logic/minecraft/ComponentList.cpp
+++ b/api/logic/minecraft/ComponentList.cpp
@@ -744,23 +744,23 @@ bool ComponentList::revertToBase(int index)
return true;
}
-ComponentPtr ComponentList::getComponent(const QString &id)
+Component * ComponentList::getComponent(const QString &id)
{
auto iter = d->componentIndex.find(id);
if (iter == d->componentIndex.end())
{
return nullptr;
}
- return *iter;
+ return (*iter).get();
}
-ComponentPtr ComponentList::getComponent(int index)
+Component * ComponentList::getComponent(int index)
{
if(index < 0 || index >= d->components.size())
{
return nullptr;
}
- return d->components[index];
+ return d->components[index].get();
}
bool ComponentList::isVanilla()
diff --git a/api/logic/minecraft/ComponentList.h b/api/logic/minecraft/ComponentList.h
index 8e89d640..b66b3417 100644
--- a/api/logic/minecraft/ComponentList.h
+++ b/api/logic/minecraft/ComponentList.h
@@ -110,10 +110,10 @@ public:
public:
/// get the profile component by id
- ComponentPtr getComponent(const QString &id);
+ Component * getComponent(const QString &id);
/// get the profile component by index
- ComponentPtr getComponent(int index);
+ Component * getComponent(int index);
private:
void scheduleSave();