Various small improvements [release]

This commit is contained in:
crschnick 2023-03-15 23:51:25 +00:00
parent ba56fc25ab
commit 6e39480537
3 changed files with 12 additions and 4 deletions

View file

@ -86,7 +86,7 @@ public class FileSystemHelper {
private static void dropFileAcrossSameFileSystem(
FileSystem.FileEntry target, FileSystem.FileEntry source, boolean explicitCopy) throws Exception {
// Prevent dropping directory into itself
if (FileNames.startsWith(source.getPath(), target.getPath())) {
if (source.getPath().equals(target.getPath())) {
return;
}

View file

@ -1,7 +1,6 @@
package io.xpipe.app.comp.storage.store;
import io.xpipe.app.comp.storage.StorageFilter;
import io.xpipe.app.fxcomps.util.BindingsHelper;
import io.xpipe.app.issue.ErrorEvent;
import io.xpipe.app.storage.DataSourceCollection;
import io.xpipe.app.storage.DataStorage;
@ -30,7 +29,9 @@ public class StoreViewState {
private final ObservableList<StoreEntryWrapper> shownEntries =
FXCollections.observableList(new CopyOnWriteArrayList<>());
private final ObservableBooleanValue empty = BindingsHelper.persist(Bindings.equal(Bindings.size(allEntries), 1));
private final ObservableBooleanValue empty = Bindings.createBooleanBinding(() -> {
return allEntries.stream().allMatch(storeEntryWrapper -> !storeEntryWrapper.getEntry().getConfiguration().isRenameable());
}, allEntries);
private StoreViewState() {
try {

View file

@ -144,7 +144,14 @@ public interface OsType {
@Override
public String getTempDirectory(ShellControl pc) throws Exception {
return pc.executeStringSimpleCommand(pc.getShellDialect().getPrintVariableCommand("TMPDIR"));
var found = pc.executeStringSimpleCommand(pc.getShellDialect().getPrintVariableCommand("TMPDIR"));
// This variable is not defined for root users, so manually fix it. Why? ...
if (found.isBlank()) {
return "/tmp";
}
return found;
}
@Override