fix: show only directories in profiles list

This commit is contained in:
trafficlunar 2025-03-01 09:54:51 +00:00
parent 4eb068a2a1
commit aa09edda1b

View file

@ -36,8 +36,10 @@ public class ProfilesList extends ContainerObjectSelectionList<ProfilesList.Prof
try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(Profiles.PROFILES_DIRECTORY)) { try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(Profiles.PROFILES_DIRECTORY)) {
List<Path> profileList = new ArrayList<>(); List<Path> profileList = new ArrayList<>();
for (Path profile : directoryStream) { for (Path profile : directoryStream) {
if (Files.isDirectory(profile)) {
profileList.add(profile); profileList.add(profile);
} }
}
// Sort the list alphabetically based on the profile names // Sort the list alphabetically based on the profile names
profileList.sort(Comparator.comparing(p -> p.getFileName().toString())); profileList.sort(Comparator.comparing(p -> p.getFileName().toString()));