@@ -31,7 +31,6 @@ public class AppindicatorTrayMenuController implements TrayMenuController {
31
31
private static final Arena ARENA = Arena .global ();
32
32
private MemorySegment indicator ;
33
33
private MemorySegment menu = gtk_menu_new ();
34
- private Optional <String > svgSourcePath ;
35
34
36
35
@ CheckAvailability
37
36
public static boolean isAvailable () {
@@ -48,9 +47,9 @@ public void showTrayIcon(Consumer<TrayIconLoader> iconLoader, Runnable runnable,
48
47
49
48
private void showTrayIconWithSVG (String s ) {
50
49
try (var arena = Arena .ofConfined ()) {
51
- svgSourcePath = Optional . ofNullable ( System .getProperty (SVG_SOURCE_PROPERTY ) );
50
+ var svgSourcePath = System .getProperty (SVG_SOURCE_PROPERTY );
52
51
// flatpak
53
- if (svgSourcePath . isEmpty () ) {
52
+ if (svgSourcePath != null ) {
54
53
indicator = app_indicator_new (arena .allocateUtf8String (APP_INDICATOR_ID ),
55
54
arena .allocateUtf8String (s ),
56
55
APP_INDICATOR_CATEGORY_APPLICATION_STATUS ());
@@ -60,7 +59,7 @@ private void showTrayIconWithSVG(String s) {
60
59
arena .allocateUtf8String (s ),
61
60
APP_INDICATOR_CATEGORY_APPLICATION_STATUS (),
62
61
// find tray icons theme in mounted AppImage / installed on system by ppa
63
- arena .allocateUtf8String (svgSourcePath . get () ));
62
+ arena .allocateUtf8String (svgSourcePath ));
64
63
}
65
64
}
66
65
}
@@ -105,7 +104,7 @@ private void addChildren(MemorySegment menu, List<TrayMenuItem> items) {
105
104
}
106
105
gtk_menu_shell_append (menu , gtkMenuItem );
107
106
}
108
- case SeparatorItem separatorItem -> {
107
+ case SeparatorItem _ -> {
109
108
var gtkSeparator = gtk_menu_item_new ();
110
109
gtk_menu_shell_append (menu , gtkSeparator );
111
110
}
0 commit comments