mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 23:20:23 +00:00
Compare commits
2 commits
0e10d2508a
...
66f6b69cbe
Author | SHA1 | Date | |
---|---|---|---|
|
66f6b69cbe | ||
|
9212871db9 |
2 changed files with 13 additions and 4 deletions
|
@ -111,13 +111,19 @@ public class BrowserFileTransferOperation {
|
|||
}
|
||||
|
||||
for (var file : files) {
|
||||
if (file.getFileSystem().equals(target.getFileSystem())) {
|
||||
if (same) {
|
||||
handleSingleOnSameFileSystem(file);
|
||||
updateProgress(BrowserTransferProgress.finished(file.getName(), file.getSize()));
|
||||
} else {
|
||||
handleSingleAcrossFileSystems(file);
|
||||
}
|
||||
}
|
||||
|
||||
if (!same && doesMove) {
|
||||
for (var file : files) {
|
||||
deleteSingle(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void handleSingleOnSameFileSystem(FileSystem.FileEntry source)
|
||||
|
@ -143,8 +149,7 @@ public class BrowserFileTransferOperation {
|
|||
return;
|
||||
}
|
||||
|
||||
var same = files.getFirst().getFileSystem().equals(target.getFileSystem());
|
||||
var doesMove = transferMode == BrowserFileTransferMode.MOVE || (same && transferMode == BrowserFileTransferMode.NORMAL);
|
||||
var doesMove = transferMode == BrowserFileTransferMode.MOVE || transferMode == BrowserFileTransferMode.NORMAL;
|
||||
if (doesMove) {
|
||||
target.getFileSystem().move(sourceFile, targetFile);
|
||||
} else {
|
||||
|
@ -266,6 +271,10 @@ public class BrowserFileTransferOperation {
|
|||
updateProgress(BrowserTransferProgress.finished(source.getName(), totalSize.get()));
|
||||
}
|
||||
|
||||
private void deleteSingle(FileSystem.FileEntry source) throws Exception {
|
||||
source.getFileSystem().delete(source.getPath());
|
||||
}
|
||||
|
||||
private static final int DEFAULT_BUFFER_SIZE = 1024;
|
||||
|
||||
private void transferFile(
|
||||
|
|
|
@ -389,7 +389,7 @@ public abstract class StoreEntryComp extends SimpleComp {
|
|||
.getSortedCategories(wrapper.getCategory().getValue().getRoot())
|
||||
.forEach(storeCategoryWrapper -> {
|
||||
MenuItem m = new MenuItem();
|
||||
m.textProperty().bind(storeCategoryWrapper.nameProperty());
|
||||
m.textProperty().setValue(" ".repeat(storeCategoryWrapper.getDepth()) + storeCategoryWrapper.getName().getValue());
|
||||
m.setOnAction(event -> {
|
||||
wrapper.moveTo(storeCategoryWrapper.getCategory());
|
||||
event.consume();
|
||||
|
|
Loading…
Reference in a new issue