mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-10-01 17:47:30 +13:00
Various small improvements [release]
This commit is contained in:
parent
ba56fc25ab
commit
6e39480537
3 changed files with 12 additions and 4 deletions
|
@ -86,7 +86,7 @@ public class FileSystemHelper {
|
||||||
private static void dropFileAcrossSameFileSystem(
|
private static void dropFileAcrossSameFileSystem(
|
||||||
FileSystem.FileEntry target, FileSystem.FileEntry source, boolean explicitCopy) throws Exception {
|
FileSystem.FileEntry target, FileSystem.FileEntry source, boolean explicitCopy) throws Exception {
|
||||||
// Prevent dropping directory into itself
|
// Prevent dropping directory into itself
|
||||||
if (FileNames.startsWith(source.getPath(), target.getPath())) {
|
if (source.getPath().equals(target.getPath())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package io.xpipe.app.comp.storage.store;
|
package io.xpipe.app.comp.storage.store;
|
||||||
|
|
||||||
import io.xpipe.app.comp.storage.StorageFilter;
|
import io.xpipe.app.comp.storage.StorageFilter;
|
||||||
import io.xpipe.app.fxcomps.util.BindingsHelper;
|
|
||||||
import io.xpipe.app.issue.ErrorEvent;
|
import io.xpipe.app.issue.ErrorEvent;
|
||||||
import io.xpipe.app.storage.DataSourceCollection;
|
import io.xpipe.app.storage.DataSourceCollection;
|
||||||
import io.xpipe.app.storage.DataStorage;
|
import io.xpipe.app.storage.DataStorage;
|
||||||
|
@ -30,7 +29,9 @@ public class StoreViewState {
|
||||||
private final ObservableList<StoreEntryWrapper> shownEntries =
|
private final ObservableList<StoreEntryWrapper> shownEntries =
|
||||||
FXCollections.observableList(new CopyOnWriteArrayList<>());
|
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() {
|
private StoreViewState() {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -144,7 +144,14 @@ public interface OsType {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTempDirectory(ShellControl pc) throws Exception {
|
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
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue