Fixed remane and delete of selected skin
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
a5938a7de9
commit
263dc5af67
@ -359,7 +359,7 @@ bool SkinList::setData(const QModelIndex& idx, const QVariant& value, int role)
|
||||
int row = idx.row();
|
||||
if (row < 0 || row >= m_skin_list.size())
|
||||
return false;
|
||||
auto skin = m_skin_list[row];
|
||||
auto& skin = m_skin_list[row];
|
||||
auto newName = value.toString();
|
||||
if (skin.name() != newName) {
|
||||
skin.rename(newName);
|
||||
|
@ -229,8 +229,10 @@ void SkinManageDialog::on_steveBtn_toggled(bool checked)
|
||||
void SkinManageDialog::accept()
|
||||
{
|
||||
auto skin = m_list.skin(m_selected_skin);
|
||||
if (!skin)
|
||||
if (!skin) {
|
||||
reject();
|
||||
return;
|
||||
}
|
||||
auto path = skin->getPath();
|
||||
|
||||
ProgressDialog prog(this);
|
||||
@ -315,7 +317,7 @@ void SkinManageDialog::on_action_Delete_Skin_triggered(bool checked)
|
||||
return;
|
||||
|
||||
if (m_list.getSkinIndex(m_selected_skin) == m_list.getSelectedAccountSkin()) {
|
||||
CustomMessageBox::selectable(this, tr("Delete error"), tr("Can not delete skin that is in use."), QMessageBox::Warning);
|
||||
CustomMessageBox::selectable(this, tr("Delete error"), tr("Can not delete skin that is in use."), QMessageBox::Warning)->exec();
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user