diff --git a/app/src/main/java/io/xpipe/app/browser/FileSystemHelper.java b/app/src/main/java/io/xpipe/app/browser/FileSystemHelper.java index ef76d6e31..73bf2b216 100644 --- a/app/src/main/java/io/xpipe/app/browser/FileSystemHelper.java +++ b/app/src/main/java/io/xpipe/app/browser/FileSystemHelper.java @@ -182,11 +182,10 @@ public class FileSystemHelper { flatFiles.put(source, directoryName); var baseRelative = FileNames.toDirectory(FileNames.getParent(source.getPath())); - try (var stream = source.getFileSystem().listFilesRecursively(source.getPath())) { - stream.forEach(fileEntry -> { - flatFiles.put(fileEntry, FileNames.toUnix(FileNames.relativize(baseRelative, fileEntry.getPath()))); - }); - } + List list = source.getFileSystem().listFilesRecursively(source.getPath()); + list.forEach(fileEntry -> { + flatFiles.put(fileEntry, FileNames.toUnix(FileNames.relativize(baseRelative, fileEntry.getPath()))); + }); } else { flatFiles.put(source, FileNames.getFileName(source.getPath())); } diff --git a/app/src/main/java/io/xpipe/app/browser/OpenFileSystemSavedState.java b/app/src/main/java/io/xpipe/app/browser/OpenFileSystemSavedState.java index 88c8e8f8f..799774a07 100644 --- a/app/src/main/java/io/xpipe/app/browser/OpenFileSystemSavedState.java +++ b/app/src/main/java/io/xpipe/app/browser/OpenFileSystemSavedState.java @@ -132,6 +132,7 @@ public class OpenFileSystemSavedState { public void cd(String dir) { if (dir == null) { + lastDirectory = null; return; } diff --git a/app/src/main/java/io/xpipe/app/core/AppTheme.java b/app/src/main/java/io/xpipe/app/core/AppTheme.java index 83e341aec..33cd9095b 100644 --- a/app/src/main/java/io/xpipe/app/core/AppTheme.java +++ b/app/src/main/java/io/xpipe/app/core/AppTheme.java @@ -83,6 +83,9 @@ public class AppTheme { PlatformThread.runLaterIfNeeded(() -> { for (Window window : Window.getWindows()) { + // Fix scene content not taking the correct size after style seed change + window.setWidth(window.getWidth() - 1); + var scene = window.getScene(); Image snapshot = scene.snapshot(null); Pane root = (Pane) scene.getRoot(); @@ -95,7 +98,9 @@ public class AppTheme { new KeyFrame(Duration.ZERO, new KeyValue(imageView.opacityProperty(), 1, Interpolator.EASE_OUT)), new KeyFrame( Duration.millis(1250), new KeyValue(imageView.opacityProperty(), 0, Interpolator.EASE_OUT))); - transition.setOnFinished(e -> root.getChildren().remove(imageView)); + transition.setOnFinished(e -> { + root.getChildren().remove(imageView); + }); transition.play(); } diff --git a/app/src/main/resources/io/xpipe/app/resources/lang/preferences_en.properties b/app/src/main/resources/io/xpipe/app/resources/lang/preferences_en.properties index c2f56466e..911e2d01c 100644 --- a/app/src/main/resources/io/xpipe/app/resources/lang/preferences_en.properties +++ b/app/src/main/resources/io/xpipe/app/resources/lang/preferences_en.properties @@ -48,7 +48,7 @@ notAnAbsolutePath=Not an absolute path notADirectory=Not a directory notAnEmptyDirectory=Not an empty directory automaticallyUpdate=Check for updates -automaticallyUpdateDescription=When enabled, new release information is automatically fetched in the background while XPipe is running. +automaticallyUpdateDescription=When enabled, new release information is automatically fetched in the background while XPipe is running. You still have to explicitly confirm any update installation. sendAnonymousErrorReports=Send anonymous error reports sendUsageStatistics=Send anonymous usage statistics storageDirectory=Storage directory diff --git a/core/src/main/java/io/xpipe/core/store/FileSystem.java b/core/src/main/java/io/xpipe/core/store/FileSystem.java index be0c00801..d204440b1 100644 --- a/core/src/main/java/io/xpipe/core/store/FileSystem.java +++ b/core/src/main/java/io/xpipe/core/store/FileSystem.java @@ -9,6 +9,7 @@ import java.io.Closeable; import java.io.InputStream; import java.io.OutputStream; import java.time.Instant; +import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.stream.Stream; @@ -79,18 +80,22 @@ public interface FileSystem extends Closeable, AutoCloseable { Stream listFiles(String file) throws Exception; - default Stream listFilesRecursively(String file) throws Exception { - return listFiles(file).flatMap(fileEntry -> { + default List listFilesRecursively(String file) throws Exception { + var base = listFiles(file).toList(); + return base.stream().flatMap(fileEntry -> { if (fileEntry.getKind() != FileKind.DIRECTORY) { return Stream.of(fileEntry); } try { - return Stream.concat(Stream.of(fileEntry), listFilesRecursively(fileEntry.getPath())); + var list = new ArrayList(); + list.add(fileEntry); + list.addAll(listFilesRecursively(fileEntry.getPath())); + return list.stream(); } catch (Exception e) { throw new RuntimeException(e); } - }); + }).toList(); } List listRoots() throws Exception;