Skip to content

Commit

Permalink
filling the address item with item that doesn't exist yet
Browse files Browse the repository at this point in the history
  • Loading branch information
theod committed Oct 31, 2013
1 parent 82c698e commit 0c79ee4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
12 changes: 8 additions & 4 deletions Foundation/library/source/TTNodeDirectory.cpp
Expand Up @@ -218,11 +218,15 @@ TTErr TTNodeDirectory::fillAddressItem(TTAddressItemPtr anAddressItem, TTAddress
// get name.instance
aNode->getAddress(anAddress, startAddress);

// append to the namespace
anAddressItem->append(anAddress, &anItem);
// if the item doesn't exist yet
if (anAddressItem->find(anAddress, &anItem) == kTTErrValueNotFound) {

// append it to the namespace
anAddressItem->append(anAddress, &anItem);

// select the item
anItem->setSelection(YES);
// select the item
anItem->setSelection(YES);
}

// fill this item
fillAddressItem(anItem, startAddress.appendAddress(anAddress));
Expand Down
20 changes: 8 additions & 12 deletions Modular/library/PeerObject/TTCueManager.cpp
Expand Up @@ -223,9 +223,8 @@ TTErr TTCueManager::NamespaceSelect(const TTValue& inputValue, TTValue& outputVa
aNamespace = lookupNamespace(mNamespace);
if (!aNamespace) {

// if empty fill the namespace
if (mDefaultNamespace->isEmpty())
getLocalDirectory->fillAddressItem(mDefaultNamespace);
// fill the namespace
getLocalDirectory->fillAddressItem(mDefaultNamespace);

aNamespace = mDefaultNamespace;
}
Expand Down Expand Up @@ -261,9 +260,8 @@ TTErr TTCueManager::NamespaceUnselect(const TTValue& inputValue, TTValue& output
aNamespace = lookupNamespace(mNamespace);
if (!aNamespace) {

// if empty fill the namespace
if (mDefaultNamespace->isEmpty())
getLocalDirectory->fillAddressItem(mDefaultNamespace);
// fill the namespace
getLocalDirectory->fillAddressItem(mDefaultNamespace);

aNamespace = mDefaultNamespace;
}
Expand Down Expand Up @@ -322,9 +320,8 @@ TTErr TTCueManager::NamespaceUpdate(const TTValue& inputValue, TTValue& outputVa
aNamespace = lookupNamespace(mNamespace);
if (!aNamespace) {

// if empty fill the namespace
if (mDefaultNamespace->isEmpty())
getLocalDirectory->fillAddressItem(mDefaultNamespace);
// fill the namespace
getLocalDirectory->fillAddressItem(mDefaultNamespace);

aNamespace = mDefaultNamespace;
}
Expand Down Expand Up @@ -423,9 +420,8 @@ TTErr TTCueManager::Store(const TTValue& inputValue, TTValue& outputValue)
aNamespace = lookupNamespace(mNamespace);
if (!aNamespace) {

// if empty fill the namespace
if (mDefaultNamespace->isEmpty())
getLocalDirectory->fillAddressItem(mDefaultNamespace);
// fill the namespace
getLocalDirectory->fillAddressItem(mDefaultNamespace);

aNamespace = mDefaultNamespace;
}
Expand Down

0 comments on commit 0c79ee4

Please sign in to comment.