File 0586-observer-Cleanup.patch of Package erlang
From 94d5d0d2e4210d8a5e3a9b79caf9eb68f366a2c3 Mon Sep 17 00:00:00 2001
From: Micael Karlberg <bmk@erlang.org>
Date: Tue, 29 Nov 2022 10:28:57 +0100
Subject: [PATCH 3/3] [observer] Cleanup
OTP-18339
---
lib/observer/src/observer_port_wx.erl | 11 +----------
lib/observer/src/observer_sock_wx.erl | 11 +----------
2 files changed, 2 insertions(+), 20 deletions(-)
diff --git a/lib/observer/src/observer_port_wx.erl b/lib/observer/src/observer_port_wx.erl
index 847633da6b..fa0b73a5ef 100644
--- a/lib/observer/src/observer_port_wx.erl
+++ b/lib/observer/src/observer_port_wx.erl
@@ -147,20 +147,11 @@ handle_event(#wx{event=#wxSize{size={W,_}}}, State=#state{grid=Grid}) ->
observer_lib:set_listctrl_col_size(Grid, W),
{noreply, State};
-%% handle_event(#wx{event = #wxList{type = command_list_item_activated,
-%% itemIndex = Index}},
-%% State = #state{grid = Grid,
-%% ports = Ports,
-%% open_wins = Opened})
-%% when is_list(Ports) andalso (length(Ports) >= (Index+1)) ->
-%% Port = lists:nth(Index+1, Ports),
-%% NewOpened = display_port_info(Grid, Port, Opened),
-%% {noreply, State#state{open_wins=NewOpened}};
handle_event(#wx{event = #wxList{type = command_list_item_activated,
itemIndex = Index}},
State = #state{grid = Grid,
ports = Ports,
- open_wins = Opened}) when is_list(Ports) ->
+ open_wins = Opened}) ->
if
length(Ports) >= (Index+1) ->
Port = lists:nth(Index+1, Ports),
diff --git a/lib/observer/src/observer_sock_wx.erl b/lib/observer/src/observer_sock_wx.erl
index 00af44fe47..5282f847e0 100644
--- a/lib/observer/src/observer_sock_wx.erl
+++ b/lib/observer/src/observer_sock_wx.erl
@@ -236,20 +236,11 @@ handle_event(#wx{event=#wxSize{size={W,_}}}, State=#state{grid=Grid}) ->
observer_lib:set_listctrl_col_size(Grid, W),
{noreply, State};
-%% handle_event(#wx{event = #wxList{type = command_list_item_activated,
-%% itemIndex = Index}},
-%% State = #state{grid = Grid,
-%% sockets = Sockets,
-%% open_wins = Opened})
-%% when is_list(Sockets) andalso (length(Sockets) >= (Index+1)) ->
-%% Socket = lists:nth(Index+1, Sockets),
-%% NewOpened = display_socket_info(Grid, Socket, Opened),
-%% {noreply, State#state{open_wins = NewOpened}};
handle_event(#wx{event = #wxList{type = command_list_item_activated,
itemIndex = Index}},
State = #state{grid = Grid,
sockets = Sockets,
- open_wins = Opened}) when is_list(Sockets) ->
+ open_wins = Opened}) ->
if
length(Sockets) >= (Index+1) ->
Socket = lists:nth(Index+1, Sockets),
--
2.35.3