updated to the new pikotools api: changed the way how child_spaces are created in Space class

This commit is contained in:
2021-05-21 17:17:17 +02:00
parent fe67b5d72a
commit f1b9d1b870
9 changed files with 277 additions and 262 deletions

View File

@@ -144,14 +144,14 @@ void SessionData::BuildFileList(std::vector<long> & file_tab, pt::Space & space)
{
file_tab.clear();
if( space.child_spaces )
{
for(size_t i=0 ; i<space.child_spaces->size() ; ++i)
{
pt::Space & sp = *(*space.child_spaces)[i];
pt::Space::TableType * child_table = space.find_child_space_table();
if( sp.name && (*sp.name) == L"param" )
CheckFile(file_tab, sp);
if( child_table )
{
for(pt::Space * sp : *child_table)
{
if( sp->is_child_space_name(L"param") )
CheckFile(file_tab, *sp);
}
}
}
@@ -159,21 +159,15 @@ void SessionData::BuildFileList(std::vector<long> & file_tab, pt::Space & space)
void SessionData::CheckFile(std::vector<long> & file_tab, pt::Space & space)
{
if( space.child_spaces )
pt::Space::TableType * child_table = space.find_child_space_table();
if( child_table )
{
for(size_t i=0 ; i<space.child_spaces->size() ; ++i)
for(pt::Space * sp : *child_table)
{
pt::Space & subsp = *(*space.child_spaces)[i];
if( subsp.name && *subsp.name == L"file" )
if( sp->is_child_space_name(L"file") )
{
std::wstring * file_id_str = subsp.get_wstr(L"itemid");
if( file_id_str )
{
long file_id = Tol(*file_id_str);
file_tab.push_back(file_id);
}
file_tab.push_back(sp->to_long(L"itemid"));
}
}
}