# HG changeset patch # User Santeri Piippo # Date 1371333500 -10800 # Node ID a91fa09d686c3091335b649d62367b479665e759 # Parent 2892deee4c1b33ed50b5c4656d260f18a82ee1e4 When editing an existing subfile, select the primitive from the list automatically if found diff -r 2892deee4c1b -r a91fa09d686c src/addObjectDialog.cpp --- a/src/addObjectDialog.cpp Sun Jun 16 00:48:09 2013 +0300 +++ b/src/addObjectDialog.cpp Sun Jun 16 00:58:20 2013 +0300 @@ -107,6 +107,11 @@ SubfileListItem* item = new SubfileListItem (parentItem, &prim); item->setText (0, fmt ("%1 - %2", prim.name, prim.title)); subfileItems << item; + + // If this primitive is the one the current object points to, + // select it by default + if (obj && static_cast (obj)->fileInfo ()->name () == prim.name) + tw_subfileList->setCurrentItem (item); } tw_subfileList->addTopLevelItem (parentItem);