Skip to content

Commit

Permalink
Add shortcut.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed Nov 25, 2024
1 parent bd0827f commit 4cf8bba
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

import ch.cyberduck.core.Factory;
import ch.cyberduck.core.Local;

public class IconServiceFactory extends Factory<IconService> {

Expand All @@ -29,4 +30,8 @@ private IconServiceFactory() {
public static IconService get() {
return new IconServiceFactory().create();
}

public static IconService.Icon iconFor(final Local file) {
return get().get(file);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public void transfer(final Session<?> source, final Session<?> destination, fina
}
// Transfer
final Download download = source.getFeature(Download.class);
final IconService.Icon icon = IconServiceFactory.get().get(local);
final IconService.Icon icon = IconServiceFactory.iconFor(local);
download.download(file, local, bandwidth, this.options.icon ?
new IconServiceStreamListener(icon, listener, segment) : listener, segment, prompt);
// Remove custom icon if complete
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ public NSArray namesOfPromisedFilesDroppedAtDestination(final NSURL url) {
try {
LocalTouchFactory.get().touch(file);
if(options.icon) {
IconServiceFactory.get().get(file).update(new TransferProgress(0L, 0L));
IconServiceFactory.iconFor(file).update(new TransferProgress(0L, 0L));
}
}
catch(AccessDeniedException e) {
Expand Down

0 comments on commit 4cf8bba

Please sign in to comment.