Mercurial > trustbridge
diff ui/certificatelistwidget.cpp @ 720:3d669400104a
(Issue23) Fix certificate selection
On show always the first certificate was selected and setSelected
also only set the first certificate.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Wed, 02 Jul 2014 17:03:44 +0200 |
parents | 0f4c480c41f4 |
children | a467204a35f5 |
line wrap: on
line diff
--- a/ui/certificatelistwidget.cpp Wed Jul 02 16:35:16 2014 +0200 +++ b/ui/certificatelistwidget.cpp Wed Jul 02 17:03:44 2014 +0200 @@ -233,8 +233,10 @@ void CertificateListWidget::setSelected(int index) { + if (index <= 0) { + index = 0; + } mCertificateList->setFocus(); - if (mCertificateList->count() > 0) { - mCertificateList->item(0)->setSelected(true); - } + mCertificateList->item(index)->setSelected(true); + mCertificateList->setCurrentRow(index); }