Verified Commit f19ed175 authored by Ingo Klöcker's avatar Ingo Klöcker Committed by Ingo Klöcker
Browse files

Set key instead of index for DetailsCommand

This was the only place where Command::setIndex() was used. Setting key
directly allows us to remove Command::setIndex() and is a first step in
making the commands independent of model indexes.

GnuPG-bug-id: 6157
parent 24e550bb
......@@ -657,13 +657,11 @@ void KeyListController::Private::slotDoubleClicked(const QModelIndex &idx)
return;
}
DetailsCommand *const c = new DetailsCommand(view, q);
if (parentWidget) {
c->setParentWidget(parentWidget);
if (const auto *const keyListModel = dynamic_cast<KeyListModelInterface *>(view->model())) {
DetailsCommand *const c = new DetailsCommand{keyListModel->key(idx), nullptr};
c->setParentWidget(parentWidget ? parentWidget : view);
c->start();
}
c->setIndex(idx);
c->start();
}
void KeyListController::Private::slotActivated(const QModelIndex &idx)
......
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