NOISSUE fix a bunch of warnings thrown by Qt internals

Badly connected signals/slots and similar things.
This commit is contained in:
Petr Mrázek
2017-12-14 00:29:00 +01:00
parent ef2cbe16e6
commit f18afd3d1e
8 changed files with 27 additions and 20 deletions

View File

@ -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

View File

@ -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()

View File

@ -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();