From e53a2426c153337fe25ef6dd13059cf2c4d0ab0b Mon Sep 17 00:00:00 2001 From: Jake Drahos Date: Thu, 11 Jun 2015 11:40:03 -0500 Subject: Marked flows not deleted on clear all Marked flows survive a clear all unless all current flows are marked. Bug: They don't show up until another flow is added --- libmproxy/console/flowlist.py | 4 ---- libmproxy/flow.py | 11 +++++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'libmproxy') diff --git a/libmproxy/console/flowlist.py b/libmproxy/console/flowlist.py index 8bb6f87a..f7835419 100644 --- a/libmproxy/console/flowlist.py +++ b/libmproxy/console/flowlist.py @@ -181,10 +181,6 @@ class ConnectionItem(urwid.WidgetWrap): elif key == "m": self.flow.toggle_mark() signals.flowlist_change.send(self) - if self.flow.marked: - signals.status_message.send(message="Flow is now marked") - else: - signals.status_message.send(message="Flow is now not marked") elif key == "r": r = self.master.replay_request(self.flow) if r: diff --git a/libmproxy/flow.py b/libmproxy/flow.py index 1a052f51..65aa2909 100644 --- a/libmproxy/flow.py +++ b/libmproxy/flow.py @@ -494,8 +494,19 @@ class FlowStore(FlowList): self._recalculate_views() def _clear(self): + marked_flows = [] + for f in self._list: + if f.marked: + marked_flows.append(f) + if len(marked_flows) == len(self._list): + marked_flows = [] + self._list = [] self._set = set() + + for f in marked_flows: + self._add(f) + self._recalculate_views() def _recalculate_views(self): -- cgit v1.2.3