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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SkinList::updateSkin(SkinModel s)
|
void SkinList::updateSkin(SkinModel* s)
|
||||||
{
|
{
|
||||||
auto done = false;
|
auto done = false;
|
||||||
for (auto i = 0; i < m_skin_list.size(); i++) {
|
for (auto i = 0; i < m_skin_list.size(); i++) {
|
||||||
if (m_skin_list[i].getPath() == s.getPath()) {
|
if (m_skin_list[i].getPath() == s->getPath()) {
|
||||||
m_skin_list[i].setCapeId(s.getCapeId());
|
m_skin_list[i].setCapeId(s->getCapeId());
|
||||||
m_skin_list[i].setModel(s.getModel());
|
m_skin_list[i].setModel(s->getModel());
|
||||||
m_skin_list[i].setURL(s.getURL());
|
m_skin_list[i].setURL(s->getURL());
|
||||||
done = true;
|
done = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!done) {
|
if (!done) {
|
||||||
beginInsertRows(QModelIndex(), m_skin_list.count(), m_skin_list.count() + 1);
|
beginInsertRows(QModelIndex(), m_skin_list.count(), m_skin_list.count() + 1);
|
||||||
m_skin_list.append(s);
|
m_skin_list.append(*s);
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
}
|
}
|
||||||
save();
|
save();
|
||||||
|
@ -58,7 +58,7 @@ class SkinList : public QAbstractListModel {
|
|||||||
void save();
|
void save();
|
||||||
int getSelectedAccountSkin();
|
int getSelectedAccountSkin();
|
||||||
|
|
||||||
void updateSkin(SkinModel s);
|
void updateSkin(SkinModel* s);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// hide copy constructor
|
// hide copy constructor
|
||||||
|
@ -463,5 +463,5 @@ void SkinManageDialog::on_userBtn_clicked()
|
|||||||
if (m_capes.contains(mcProfile.currentCape)) {
|
if (m_capes.contains(mcProfile.currentCape)) {
|
||||||
s.setCapeId(mcProfile.currentCape);
|
s.setCapeId(mcProfile.currentCape);
|
||||||
}
|
}
|
||||||
m_list.updateSkin(s);
|
m_list.updateSkin(&s);
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user