bool FMRUList::VerifyMRUFile(int32 InItem) { check( InItem > -1 && InItem < GetMaxItems() ); const FString filename = Items[InItem]; // If the file doesn't exist, tell the user about it, remove the file from the list if( IFileManager::Get().FileSize( *filename ) == -1 ) { FMessageLog EditorErrors("EditorErrors"); FFormatNamedArguments Arguments; Arguments.Add(TEXT("FileName"), FText::FromString(filename)); EditorErrors.Warning(FText::Format( NSLOCTEXT("MRUList", "Error_FileDoesNotExist", "File does not exist : '{FileName}'. It will be removed from the recent items list."), Arguments ) ); EditorErrors.Notify(NSLOCTEXT("MRUList", "Notification_FileDoesNotExist", "File does not exist! Removed from recent items list!")); RemoveMRUItem( InItem ); WriteToINI(); return false; } // Otherwise, move the file to the top of the list MoveToTop( InItem ); WriteToINI(); return true; }
void FMRUList::Cull() { while( Items.Num() > GetMaxItems() ) { Items.RemoveAt( Items.Num()-1 ); } }
/** Populate MRU/Favorites list by reading saved values from the relevant INI file */ void FMainMRUFavoritesList::ReadFromINI() { // Read in the MRU items InternalReadINI( Items, INISection, TEXT("MRUItem"), GetMaxItems() ); // Read in the Favorite items InternalReadINI( FavoriteItems, FAVORITES_INI_SECTION, TEXT("FavoritesItem"), MaxItems ); }
void FMRUList::ReadFromINI() { InternalReadINI( Items, INISection, TEXT("MRUItem"), GetMaxItems() ); }
void FMRUList::RemoveMRUItem(int32 InItem) { // Find the item and remove it. check( InItem > -1 && InItem < GetMaxItems() ); Items.RemoveAt( InItem ); }