From fc5dd3f0066a0132fa270bbe0f624046cda3d391 Mon Sep 17 00:00:00 2001 From: sebastian-raubach Date: Sat, 1 Dec 2018 17:58:27 +0000 Subject: [PATCH] - FIX: Fixed issue with main .jar file not being found on Linux due to case-sensitivity of the OS. --- build.xml | 2 +- src/uk/ac/raubach/lit/ui/TableComponent.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build.xml b/build.xml index 201d4d2..b050363 100644 --- a/build.xml +++ b/build.xml @@ -14,7 +14,7 @@ ~ limitations under the License. --> - + diff --git a/src/uk/ac/raubach/lit/ui/TableComponent.java b/src/uk/ac/raubach/lit/ui/TableComponent.java index bdc974f..dbdc16e 100644 --- a/src/uk/ac/raubach/lit/ui/TableComponent.java +++ b/src/uk/ac/raubach/lit/ui/TableComponent.java @@ -126,9 +126,13 @@ public String getText(Object element) @Override public Image getImage(Object element) { + File file = new File(((Config.Program) element).getPath()); + + // First, try to get the icon from the file system Icon icon = FileSystemView.getFileSystemView() - .getSystemIcon(new File(((Config.Program) element).getPath())); + .getSystemIcon(file); + // If there is an icon, use it if (icon != null) { ImageData data = IconToImage.convertToSWT(icon);