diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-03-27 00:26:43 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-03-27 00:30:25 +0100 |
| commit | 59f99b9b81c13941bb663a33539087019d65ff07 (patch) | |
| tree | 285cc47a47f79edec85045b91ea31c2883b2019b | |
| parent | ce01ccc1aa871d299ad96683055c4e06a355efb9 (diff) | |
Make RecipientsPanel::recipients() return selected recipients, not all.
| -rw-r--r-- | src/wx/recipients_panel.cc | 14 | ||||
| -rw-r--r-- | src/wx/recipients_panel.h | 2 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/wx/recipients_panel.cc b/src/wx/recipients_panel.cc index ff19c0227..ff4b12c36 100644 --- a/src/wx/recipients_panel.cc +++ b/src/wx/recipients_panel.cc @@ -177,14 +177,18 @@ RecipientsPanel::remove_recipient_clicked () list<DKDMRecipient> -RecipientsPanel::recipients () const +RecipientsPanel::recipients() const { - list<DKDMRecipient> all; DKDMRecipientList recipients; - for (auto const& recipient: recipients.dkdm_recipients()) { - all.push_back(recipient.second); + + list<DKDMRecipient> result; + for (auto sel: _selected) { + if (auto recipient = recipients.dkdm_recipient(sel.second)) { + result.push_back(*recipient); + } } - return all; + + return result; } diff --git a/src/wx/recipients_panel.h b/src/wx/recipients_panel.h index d252b8d06..cecfa3d33 100644 --- a/src/wx/recipients_panel.h +++ b/src/wx/recipients_panel.h @@ -44,7 +44,9 @@ public: void setup_sensitivity (); + /** @return List of selected recipients */ std::list<DKDMRecipient> recipients() const; + boost::signals2::signal<void ()> RecipientsChanged; private: |
