Detecting Windows and disabling case insensitive file filters as they

aren't supported (or needed!). #35
This commit is contained in:
Rob Greene 2019-10-05 15:26:11 -05:00
parent 3187d016af
commit 3b31a9385d
2 changed files with 15 additions and 0 deletions

View File

@ -47,6 +47,7 @@ import com.webcodepro.applecommander.ui.swt.util.ImageCanvas;
import com.webcodepro.applecommander.ui.swt.util.ImageManager;
import com.webcodepro.applecommander.ui.swt.wizard.comparedisks.CompareDisksWizard;
import com.webcodepro.applecommander.ui.swt.wizard.diskimage.DiskImageWizard;
import com.webcodepro.applecommander.util.Host;
import com.webcodepro.applecommander.util.TextBundle;
/**
@ -189,6 +190,10 @@ public class SwtAppleCommander implements Listener {
* {@code *.[dD][sS][kK]}.
*/
protected String makeExtensionCaseInsensitive(String extension) {
if (Host.isWindows()) {
// Windows SWT does not support the regex and is case insensitive. Leave it as-is!
return extension;
}
StringBuilder sb = new StringBuilder();
for (char ch : extension.toCharArray()) {
if (Character.isLetter(ch)) {

View File

@ -81,4 +81,14 @@ public class Host {
}
return pathName;
}
public static boolean isLinux() {
return linux;
}
public static boolean isMacosx() {
return macOSX;
}
public static boolean isWindows() {
return windows;
}
}