void AddFolderToHistory( clPtr<FS>* fs, FSPath* path ) { if ( fs && fs->Ptr() && path ) { // collect all needed path information PathList::Data data; if ( PathListFSToData( data, fs, path ) ) { // check if item already exists in the list const int index = g_dataList.FindByName( data.name.data() ); if ( index != -1 ) { // remove existing item g_dataList.Remove( index ); } // add item to the and of the list g_dataList.Add( data.name.data(), data.conf ); // limit number of elements in the list while ( g_dataList.GetCount() > MAX_FOLDERS_HISTORY_COUNT ) { g_dataList.Remove( 0 ); } } } }
void AddFileToHistory( const int CurrIndex, const PathList::Data& Data ) { if ( CurrIndex != -1 ) { // remove existing item g_ViewList.Remove( CurrIndex ); } // add item to the end of the list g_ViewList.Add( Data.name.data(), Data.conf ); // limit number of elements in the list while ( g_ViewList.GetCount() > MAX_VIEW_HISTORY_COUNT ) { g_ViewList.Remove( 0 ); } }