Remember the last selected instance and select it on startup
This commit is contained in:

committed by
Petr Mrázek

parent
eff38858ef
commit
8831856172
@ -362,7 +362,7 @@ int InstanceList::add(InstancePtr t)
|
||||
return count() - 1;
|
||||
}
|
||||
|
||||
InstancePtr InstanceList::getInstanceById(QString instId)
|
||||
InstancePtr InstanceList::getInstanceById(QString instId) const
|
||||
{
|
||||
QListIterator<InstancePtr> iter(m_instances);
|
||||
InstancePtr inst;
|
||||
@ -378,7 +378,12 @@ InstancePtr InstanceList::getInstanceById(QString instId)
|
||||
return iter.peekPrevious();
|
||||
}
|
||||
|
||||
int InstanceList::getInstIndex(BaseInstance *inst)
|
||||
QModelIndex InstanceList::getInstanceIndexById(const QString &id) const
|
||||
{
|
||||
return index(getInstIndex(getInstanceById(id).get()));
|
||||
}
|
||||
|
||||
int InstanceList::getInstIndex(BaseInstance *inst) const
|
||||
{
|
||||
for (int i = 0; i < m_instances.count(); i++)
|
||||
{
|
||||
|
Reference in New Issue
Block a user