Skip to content

Commit 1f9daa2

Browse files
authored
Merge pull request #16974 from iterate-ch/feature/DEEP-29
Do not display trash by default.
2 parents ab25b00 + 10e9406 commit 1f9daa2

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

deepbox/src/main/java/ch/cyberduck/core/deepbox/DeepboxListService.java

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -250,17 +250,23 @@ public AttributedList<Path> list(final Path directory, final ListProgressListene
250250
final String deepBoxNodeId = fileid.getDeepBoxNodeId(directory);
251251
final String boxNodeId = fileid.getBoxNodeId(directory);
252252
final Box box = rest.getBox(deepBoxNodeId, boxNodeId);
253-
if(box.getBoxPolicy().isCanListQueue()) {
254-
final Path inbox = new Path(directory, containerService.getPinnedLocalization(INBOX), EnumSet.of(Path.Type.directory, Path.Type.volume));
255-
list.add(inbox.withAttributes(attributes.find(inbox)));
253+
if(HostPreferencesFactory.get(session.getHost()).getBoolean("deepbox.listing.box.inbox")) {
254+
if(box.getBoxPolicy().isCanListQueue()) {
255+
final Path inbox = new Path(directory, containerService.getPinnedLocalization(INBOX), EnumSet.of(Path.Type.directory, Path.Type.volume));
256+
list.add(inbox.withAttributes(attributes.find(inbox)));
257+
}
256258
}
257-
if(box.getBoxPolicy().isCanListFilesRoot()) {
258-
final Path documents = new Path(directory, containerService.getPinnedLocalization(DOCUMENTS), EnumSet.of(Path.Type.directory, Path.Type.volume));
259-
list.add(documents.withAttributes(attributes.find(documents)));
259+
if(HostPreferencesFactory.get(session.getHost()).getBoolean("deepbox.listing.box.documents")) {
260+
if(box.getBoxPolicy().isCanListFilesRoot()) {
261+
final Path documents = new Path(directory, containerService.getPinnedLocalization(DOCUMENTS), EnumSet.of(Path.Type.directory, Path.Type.volume));
262+
list.add(documents.withAttributes(attributes.find(documents)));
263+
}
260264
}
261-
if(box.getBoxPolicy().isCanAccessTrash()) {
262-
final Path trash = new Path(directory, containerService.getPinnedLocalization(TRASH), EnumSet.of(Path.Type.directory, Path.Type.volume));
263-
list.add(trash.withAttributes(attributes.find(trash)));
265+
if(HostPreferencesFactory.get(session.getHost()).getBoolean("deepbox.listing.box.trash")) {
266+
if(box.getBoxPolicy().isCanAccessTrash()) {
267+
final Path trash = new Path(directory, containerService.getPinnedLocalization(TRASH), EnumSet.of(Path.Type.directory, Path.Type.volume));
268+
list.add(trash.withAttributes(attributes.find(trash)));
269+
}
264270
}
265271
listener.chunk(directory, list);
266272
return list;

defaults/src/main/resources/default.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,9 @@ versioning.delete.enable=true
766766
versioning.move.enable=false
767767

768768
deepbox.listing.chunksize=300
769+
deepbox.listing.box.inbox=true
770+
deepbox.listing.box.documents=true
771+
deepbox.listing.box.trash=false
769772
# 1 min
770773
deepbox.download.interrupt.ms=60000
771774
deepbox.download.interval.ms=50

0 commit comments

Comments
 (0)