summaryrefslogtreecommitdiff
path: root/src/modlist.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2013-07-17 20:58:58 +0200
committerTannin <devnull@localhost>2013-07-17 20:58:58 +0200
commitd0f2c4fcf79222d5c6f3c17188a811b0a47833c6 (patch)
tree12c9e4f529caa0f5830c8dd52d785b3e2df5462b /src/modlist.cpp
parent36ac91e0b765b1ae099e93054447beca8f461f74 (diff)
- now avoids a few unnecessary copy operations during generation of the directory structure
- bugfix: circular dependency caused a memory leak - bugfix: removing a single mod lead to the wrong mod being deleted
Diffstat (limited to 'src/modlist.cpp')
-rw-r--r--src/modlist.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/modlist.cpp b/src/modlist.cpp
index 7a8d9e0b..45bed00a 100644
--- a/src/modlist.cpp
+++ b/src/modlist.cpp
@@ -655,6 +655,7 @@ void ModList::removeRow(int row, const QModelIndex&)
if (m_Profile == NULL) return;
ModInfo::Ptr modInfo = ModInfo::getByIndex(row);
+ if (!modInfo->isRegular()) return;
QMessageBox confirmBox(QMessageBox::Question, tr("Confirm"), tr("Are you sure you want to remove \"%1\"?").arg(modInfo->name()),
QMessageBox::Yes | QMessageBox::No);
@@ -793,7 +794,7 @@ bool ModList::eventFilter(QObject *obj, QEvent *event)
if (rows.count() > 1) {
emit removeSelectedMods();
} else if (rows.count() == 1) {
- removeRow(rows[0].row(), QModelIndex());
+ removeRow(rows[0].data(Qt::UserRole + 1).toInt(), QModelIndex());
}
return true;
}