Skip to content

Commit 51a6293

Browse files
author
mplieske
committed
modified browser helper
1 parent 4a92c96 commit 51a6293

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

src/main/java/de/doubleslash/keeptime/common/BrowserHelper.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,7 @@ public static void openURL(final String url) {
2020
}
2121
} else if (System.getProperty("os.name").contains("Linux")) {
2222
try {
23-
final String[] browsers = {
24-
"epiphany", "firefox", "mozilla", "konqueror", "netscape", "opera", "links", "lynx"
25-
};
26-
27-
final StringBuilder cmd = new StringBuilder();
28-
for (int i = 0; i < browsers.length; i++) {
29-
if (i == 0) {
30-
cmd.append(String.format("%s \"%s\"", browsers[i], url));
31-
} else {
32-
cmd.append(String.format(" || %s \"%s\"", browsers[i], url));
33-
}
34-
}
35-
36-
rt.exec(new String[] {
37-
"sh", "-c", cmd.toString()
38-
});
23+
rt.exec("xgd-open " + url);
3924
} catch (final Exception e) {
4025
LOG.error(e.getMessage());
4126
}

src/main/java/de/doubleslash/keeptime/view/AboutController.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,9 @@ public void initialize() {
8383
if (!row.isEmpty() && event.getButton() == MouseButton.PRIMARY && event.getClickCount() == 2) {
8484
final LicenceTableRow clickedRow = row.getItem();
8585
final String license = clickedRow.getLicense();
86-
LOG.debug("License file name: " + license + ".txt");
87-
LOG.debug("full path: " + LICENSE_PATH + license + ".txt");
88-
LOG.debug(AboutController.class.getResource(LICENSE_PATH + license + ".txt").toString());
89-
LOG.debug(
90-
AboutController.class.getResource(LICENSE_PATH + license + ".txt").toExternalForm().toString());
91-
BrowserHelper.openURL(AboutController.class.getResource(LICENSE_PATH + license + ".txt").toString());
86+
LOG.debug("License file name: {}.txt", license);
87+
88+
BrowserHelper.openURL("");
9289
}
9390
});
9491
return row;

0 commit comments

Comments
 (0)