Commit 8f5316d3 authored by Tomaz  Canabrava's avatar Tomaz Canabrava Committed by Tomaz Canabrava
Browse files

Don't crash when selecting a group

parent 4cbca9f4
......@@ -104,6 +104,14 @@ void QuickCommandsWidget::addMode()
void QuickCommandsWidget::indexSelected(const QModelIndex &idx)
{
const auto sourceIdx = priv->filterModel->mapToSource(ui->commandsTreeView->currentIndex());
if (priv->model->rowCount(sourceIdx) != 0) {
ui->name->setText({});
ui->tooltip->setText({});
ui->command->setPlainText({});
ui->group->setCurrentText({});
return;
}
const auto item = priv->model->itemFromIndex(sourceIdx);
const auto data = item->data(QuickCommandsModel::QuickCommandRole).value<QuickCommandData>();
ui->name->setText(data.name);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment