Try to remember the currently selected device when updating the devices list.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=957497
This commit is contained in:
Volker Lanz 2009-04-22 09:21:35 +00:00
parent e32146bbb5
commit 4f6f488b6b
1 changed files with 5 additions and 0 deletions

View File

@ -43,6 +43,8 @@ ListDevices::ListDevices(QWidget* parent) :
void ListDevices::updateDevices()
{
int idx = listDevices().currentRow();
listDevices().clear();
foreach(const Device* d, pmWidget().previewDevices())
@ -53,6 +55,9 @@ void ListDevices::updateDevices()
item->setToolTip(longText);
listDevices().addItem(item);
}
if (idx > -1 && idx < listDevices().count())
listDevices().setCurrentRow(idx);
}
void ListDevices::on_m_ListDevices_itemSelectionChanged()