Fix crash when deleting parent group of recycle bin.

In these cases delete the group instead of trying to move it to the recycle bin.

Closes #520
This commit is contained in:
Felix Geyer 2016-08-03 23:24:08 +02:00
parent 9532bedd7d
commit bf2fd63131

View File

@ -493,7 +493,9 @@ void DatabaseWidget::deleteGroup()
}
bool inRecylceBin = Tools::hasChild(m_db->metadata()->recycleBin(), currentGroup);
if (inRecylceBin || !m_db->metadata()->recycleBinEnabled()) {
bool isRecycleBin = (currentGroup == m_db->metadata()->recycleBin());
bool isRecycleBinSubgroup = Tools::hasChild(currentGroup, m_db->metadata()->recycleBin());
if (inRecylceBin || isRecycleBin || isRecycleBinSubgroup || !m_db->metadata()->recycleBinEnabled()) {
QMessageBox::StandardButton result = MessageBox::question(
this, tr("Delete group?"),
tr("Do you really want to delete the group \"%1\" for good?")