From de54e46a1281791a153e5f797cb92a03e8a013e1 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 29 Oct 2010 06:04:03 +0200 Subject: [PATCH] remove the encoded capabilities from Struct asset ID (#565) --- src/proc/asset/struct-factory-impl.hpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/proc/asset/struct-factory-impl.hpp b/src/proc/asset/struct-factory-impl.hpp index ce7b75dad..562916567 100644 --- a/src/proc/asset/struct-factory-impl.hpp +++ b/src/proc/asset/struct-factory-impl.hpp @@ -101,8 +101,6 @@ namespace asset { const Asset::Ident createIdent (const Query& query) { - string name (query); - // does the query somehow specify the desired name-ID? string nameID = extractID (genericIdSymbol, query); if (isnil (nameID)) @@ -113,17 +111,12 @@ namespace asset { // so we'll create a new one static int i=0; static format namePattern ("%s.%d"); - static format predPattern ("%s(%s), "); nameID = str(namePattern % StructTraits::namePrefix() % (++i) ); - name.insert(0, - str(predPattern % StructTraits::idSymbol() % nameID )); } - ENSURE (!isnil (name)); ENSURE (!isnil (nameID)); - ENSURE (contains (name, nameID)); Category cat (STRUCT, StructTraits::catFolder()); - return Asset::Ident (name, cat ); ///////////////////////TICKET #565 the ID field should be just the ID, the query should go into a dedicated "capabilities" field. + return Asset::Ident (nameID, cat ); } @@ -214,7 +207,7 @@ namespace asset { RBinding newBinding = Session::current->getRoot().attach (MObject::create (sequence)); ASSERT (newBinding); PTimeline newTimeline = Timeline::create (idi, newBinding); - ENSURE (newTimeline); + ENSURE (newTimeline); ///////////////////////TICKET #565 maybe store the capabilities query within the Struct asset somehow? return newTimeline.get(); } @@ -232,7 +225,7 @@ namespace asset { // - track exists and is root attached, but belongs already to a sequence --> throw // - track exists, but isn't root attached ---> what do do here? steal it?? PSequence newSequence = Sequence::create (createIdent (caps)); ///////////TODO fed track in here - ENSURE (newSequence); + ENSURE (newSequence); ///////////////////////TICKET #565 maybe store the capabilities query within the Struct asset somehow? return newSequence.get(); }