forked from j62/ctbrec
1
0
Fork 0

Code cleanup

This commit is contained in:
0xboobface 2020-01-04 16:54:25 +01:00
parent 9037b525bd
commit 60826323f3
1 changed files with 14 additions and 12 deletions

View File

@ -24,7 +24,9 @@ import javafx.scene.layout.BorderPane;
public class DesktopIntegration {
private static final transient Logger LOG = LoggerFactory.getLogger(DesktopIntegration.class);
private DesktopIntegration() {}
private static final Logger LOG = LoggerFactory.getLogger(DesktopIntegration.class);
private static SystemTray tray;
private static TrayIcon trayIcon;
@ -128,11 +130,11 @@ public class DesktopIntegration {
"-t", "5000",
"-a", title,
header,
msg.replaceAll("-", "\\\\-").replaceAll("\\s", "\\\\ "),
msg.replace("-", "\\\\-").replace("\\s", "\\\\ "),
"--icon=dialog-information"
});
new Thread(new StreamRedirectThread(p.getInputStream(), System.out)).start();
new Thread(new StreamRedirectThread(p.getErrorStream(), System.err)).start();
new Thread(new StreamRedirectThread(p.getInputStream(), System.out)).start(); // NOSONAR
new Thread(new StreamRedirectThread(p.getErrorStream(), System.err)).start(); // NOSONAR
} catch (IOException e1) {
LOG.error("Notification failed", e1);
}
@ -146,7 +148,7 @@ public class DesktopIntegration {
notifySystemTray(title, header, msg);
}
private synchronized static void notifySystemTray(String title, String header, String msg) {
private static synchronized void notifySystemTray(String title, String header, String msg) {
if (SystemTray.isSupported()) {
if (tray == null) {
LOG.debug("Creating tray icon");