[DEBUG] remove multiple instance in search sub folder in apk

This commit is contained in:
Edouard DUPIN 2014-01-04 17:13:33 +01:00
parent a463e9c4de
commit b5883ad936

View File

@ -1214,6 +1214,7 @@ std::vector<etk::FSNode *> etk::FSNode::folderGetSubList(bool _showHidenFile, bo
#ifdef __TARGET_OS__Android #ifdef __TARGET_OS__Android
if( m_type == etk::FSN_TYPE_DATA if( m_type == etk::FSN_TYPE_DATA
|| m_type == etk::FSN_TYPE_THEME_DATA) { || m_type == etk::FSN_TYPE_THEME_DATA) {
std::vector<std::string> listAdded;
std::string assetsName = "assets/"; std::string assetsName = "assets/";
std::string FolderName = getNameFolder(); std::string FolderName = getNameFolder();
if (s_APKArchive==NULL) { if (s_APKArchive==NULL) {
@ -1230,14 +1231,24 @@ std::vector<etk::FSNode *> etk::FSNode::folderGetSubList(bool _showHidenFile, bo
tmpString = std::string(tmpString, 0, pos+1); tmpString = std::string(tmpString, 0, pos+1);
} }
tmpString = getName() + tmpString; tmpString = getName() + tmpString;
tmpEmement = new etk::FSNode(tmpString); bool findIt = false;
if (NULL == tmpEmement) { for (size_t jjj = 0; jjj < listAdded.size(); ++jjj) {
TK_ERROR("allocation error ... of ewol::FSNode"); if (listAdded[jjj] == tmpString) {
continue; findIt = true;
break;
}
}
if (findIt == false) {
listAdded.push_back(tmpString);
tmpEmement = new etk::FSNode(tmpString);
if (NULL == tmpEmement) {
TK_ERROR("allocation error ... of ewol::FSNode");
continue;
}
TK_VERBOSE("find element : '" << tmpString << "' --> " << *tmpEmement);
tmpp.push_back(tmpEmement);
tmpEmement = NULL;
} }
TK_VERBOSE("find element : '" << tmpString << "' --> " << *tmpEmement);
tmpp.push_back(tmpEmement);
tmpEmement = NULL;
} }
} }
return tmpp; return tmpp;