fix codeql
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
8bad255a91
commit
8c8e4329d7
@ -368,21 +368,21 @@ bool SkinList::setData(const QModelIndex& idx, const QVariant& value, int role)
|
||||
return true;
|
||||
}
|
||||
|
||||
void SkinList::updateSkin(SkinModel s)
|
||||
void SkinList::updateSkin(SkinModel* s)
|
||||
{
|
||||
auto done = false;
|
||||
for (auto i = 0; i < m_skin_list.size(); i++) {
|
||||
if (m_skin_list[i].getPath() == s.getPath()) {
|
||||
m_skin_list[i].setCapeId(s.getCapeId());
|
||||
m_skin_list[i].setModel(s.getModel());
|
||||
m_skin_list[i].setURL(s.getURL());
|
||||
if (m_skin_list[i].getPath() == s->getPath()) {
|
||||
m_skin_list[i].setCapeId(s->getCapeId());
|
||||
m_skin_list[i].setModel(s->getModel());
|
||||
m_skin_list[i].setURL(s->getURL());
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!done) {
|
||||
beginInsertRows(QModelIndex(), m_skin_list.count(), m_skin_list.count() + 1);
|
||||
m_skin_list.append(s);
|
||||
m_skin_list.append(*s);
|
||||
endInsertRows();
|
||||
}
|
||||
save();
|
||||
|
@ -58,7 +58,7 @@ class SkinList : public QAbstractListModel {
|
||||
void save();
|
||||
int getSelectedAccountSkin();
|
||||
|
||||
void updateSkin(SkinModel s);
|
||||
void updateSkin(SkinModel* s);
|
||||
|
||||
private:
|
||||
// hide copy constructor
|
||||
|
@ -463,5 +463,5 @@ void SkinManageDialog::on_userBtn_clicked()
|
||||
if (m_capes.contains(mcProfile.currentCape)) {
|
||||
s.setCapeId(mcProfile.currentCape);
|
||||
}
|
||||
m_list.updateSkin(s);
|
||||
m_list.updateSkin(&s);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user