From 66bb61c7a236e5acf7d3dac545e001473688d5fb Mon Sep 17 00:00:00 2001 From: Jumar Macato <16554748+jmacato@users.noreply.github.com> Date: Tue, 26 Oct 2021 21:55:21 +0800 Subject: [PATCH] suppress warning --- src/Avalonia.FreeDesktop/DBusTrayIconImpl.cs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/Avalonia.FreeDesktop/DBusTrayIconImpl.cs b/src/Avalonia.FreeDesktop/DBusTrayIconImpl.cs index aa18e613cb..28f1b62f8a 100644 --- a/src/Avalonia.FreeDesktop/DBusTrayIconImpl.cs +++ b/src/Avalonia.FreeDesktop/DBusTrayIconImpl.cs @@ -26,7 +26,7 @@ namespace Avalonia.FreeDesktop private readonly ObjectPath _dbusMenuPath; private readonly Connection? _connection; - private readonly IDisposable _serviceWatchDisposable; + private readonly IDisposable? _serviceWatchDisposable; private StatusNotifierItemDbusObj? _statusNotifierItemDbusObj; private IStatusNotifierWatcher? _statusNotifierWatcher; @@ -41,7 +41,7 @@ namespace Avalonia.FreeDesktop public bool IsActive { get; private set; } public INativeMenuExporter? MenuExporter { get; } public Action? OnClicked { get; set; } - public Func IconConverterDelegate { get; set; } + public Func? IconConverterDelegate { get; set; } public DBusTrayIconImpl() { @@ -62,14 +62,6 @@ namespace Avalonia.FreeDesktop MenuExporter = DBusMenuExporter.TryCreateDetachedNativeMenu(_dbusMenuPath, _connection); _serviceWatchDisposable = Watch(); - - IconConverterDelegate = impl => - { - Logger.TryGet(LogEventLevel.Error, LogArea.X11Platform) - ?.Log(this, "The icon converter delegate for the DBus Tray Icons was not set properly."); - - return new uint[] { }; - }; } private void InitializeSNWService()