void setMostRecentFile(const text_t* filename) { int i; // move down all files for (i = 3; i >= 0; --i) textCopy(s_recentFiles[i+1], s_recentFiles[i]); textCopy(s_recentFiles[0], filename); s_loadedFilename = s_recentFiles[0]; // check if the string was already present and remove it if that is the case by compacting the array for (i = 1; i < 5; ++i) { if (!textCmp(s_recentFiles[i], filename)) { for (; i < 4; ++i) textCopy(s_recentFiles[i], s_recentFiles[i + 1]); break; } } Window_populateRecentList((const text_t**)s_recentFiles); }
int ListPop::SetItem(const gedString& text) { index = 0; gedString textCmp(text); if(pCurrentList->Count() && (*pCurrentList)[0].text[0] == '+') { //Has sub lists //Remove clone index int i = textCmp.find('.'); if(i != gedString::npos) { textCmp = textCmp.substr(0, i); } } for(int i = 0; i < pCurrentList->Count(); i++) { gedString itemText((*pCurrentList)[i].text); if(itemText[0] == '+') { //Remove expander itemText = itemText.substr(2); } if(textCmp == itemText) { SetListText(text); selectedText = text; return index; } index++; } index = -1; selectedText.clear(); SetListText(""); return -1; }