summaryrefslogtreecommitdiffstats
path: root/api/logic
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-12-14 00:29:00 +0100
committerPetr Mrázek <peterix@gmail.com>2017-12-14 00:29:00 +0100
commitf18afd3d1e73cc0020bfa1189e0b8fefc0f14e61 (patch)
tree391235d09867cf718d69a8e8d4beed6cefda5057 /api/logic
parentef2cbe16e611da68f3cb529f87f4ecb3038af161 (diff)
downloadMultiMC-f18afd3d1e73cc0020bfa1189e0b8fefc0f14e61.tar
MultiMC-f18afd3d1e73cc0020bfa1189e0b8fefc0f14e61.tar.gz
MultiMC-f18afd3d1e73cc0020bfa1189e0b8fefc0f14e61.tar.lz
MultiMC-f18afd3d1e73cc0020bfa1189e0b8fefc0f14e61.tar.xz
MultiMC-f18afd3d1e73cc0020bfa1189e0b8fefc0f14e61.zip
NOISSUE fix a bunch of warnings thrown by Qt internals
Badly connected signals/slots and similar things.
Diffstat (limited to 'api/logic')
-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();