mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 17:15:32 +00:00
Simplify detecting whether a universal id represents a referenceable type.
This commit is contained in:
parent
ede1b97b46
commit
911839bb91
1 changed files with 4 additions and 6 deletions
|
@ -464,8 +464,7 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
|
|||
{
|
||||
CSMSettings::UserSettings &userSettings = CSMSettings::UserSettings::instance();
|
||||
|
||||
const std::vector<CSMWorld::UniversalId::Type> referenceables(CSMWorld::UniversalId::listReferenceableTypes());
|
||||
bool isReferenceable = std::find(referenceables.begin(), referenceables.end(), id.getType()) != referenceables.end();
|
||||
bool isReferenceable = id.getClass() == CSMWorld::UniversalId::Class_RefRecord;
|
||||
|
||||
// User setting to reuse sub views (on a per top level view basis)
|
||||
bool reuse =
|
||||
|
@ -477,12 +476,11 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
|
|||
bool isSubViewReferenceable =
|
||||
sb->getUniversalId().getType() == CSMWorld::UniversalId::Type_Referenceable;
|
||||
|
||||
if((isReferenceable && isSubViewReferenceable &&
|
||||
id.getId() == sb->getUniversalId().getId())
|
||||
if((isReferenceable && isSubViewReferenceable && id.getId() == sb->getUniversalId().getId())
|
||||
||
|
||||
(!isReferenceable && id == sb->getUniversalId()))
|
||||
{
|
||||
sb->setFocus(Qt::OtherFocusReason); // FIXME: focus not quite working
|
||||
sb->setFocus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -502,7 +500,7 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
|
|||
}
|
||||
|
||||
SubView *view = NULL;
|
||||
if(std::find(referenceables.begin(), referenceables.end(), id.getType()) != referenceables.end())
|
||||
if(isReferenceable)
|
||||
{
|
||||
view = mSubViewFactory.makeSubView (CSMWorld::UniversalId(CSMWorld::UniversalId::Type_Referenceable, id.getId()), *mDocument);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue