Skip to content

Commit

Permalink
Fixing DefaultDisksPopupFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
marigostra committed Jun 23, 2022
1 parent 725d8cb commit 52572ab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions properties/windows.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

luwrain.class.os = org.luwrain.windows.Windows
luwrain.class.diskspopupfactory = org.luwrain.windows.DefaultDisksPopupFactory
12 changes: 10 additions & 2 deletions src/main/java/org/luwrain/windows/DefaultDisksPopupFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ public final class DefaultDisksPopupFactory implements DisksPopup.Factory

private final class DisksImpl implements DisksPopup.Disks
{
@Override public DisksPopup.Disk[] getDisks()
@Override public DisksPopup.Disk[] getDisks(Set<DisksPopup.Flags> flags)
{
final List<DiskImpl> res = new ArrayList<>();
final File[] roots = File.listRoots();
if (roots != null)
for(File f: roots)
res.add(new DiskImpl(f.getAbsolutePath()));
return res.toArray(new DisksPopup.Disk[res.size()]);
}
}
Expand All @@ -51,9 +55,13 @@ private final class DiskImpl implements DisksPopup.Disk
{
return true;
}
@Override public File activate()
@Override public File activate(Set<DisksPopup.Flags> flags)
{
return new File(path);
}
@Override public boolean deactivate(Set<DisksPopup.Flags> flags)
{
return true;
}
@Override public String toString()
{
Expand Down

0 comments on commit 52572ab

Please sign in to comment.