Skip to content

Commit

Permalink
-noexcept
Browse files Browse the repository at this point in the history
-const
-grooming
  • Loading branch information
geoffthemedio committed Apr 19, 2024
1 parent a26f08e commit f0f380f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
4 changes: 2 additions & 2 deletions UI/QueueListBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void QueueListBox::CompleteConstruction() {
boost::bind(&QueueListBox::ItemRightClicked, this, ph::_1, ph::_2, ph::_3));
}

GG::X QueueListBox::RowWidth() const
GG::X QueueListBox::RowWidth() const noexcept
{ return ClientWidth(); }

void QueueListBox::KeyPress(GG::Key key, uint32_t key_code_point, GG::Flags<GG::ModKey> mod_keys)
Expand Down Expand Up @@ -171,7 +171,7 @@ void QueueListBox::EnableOrderIssuing(bool enable) {
row->Disable(!enable);
}

bool QueueListBox::DisplayingValidQueueItems()
bool QueueListBox::DisplayingValidQueueItems() const noexcept
{ return !m_showing_prompt; }

void QueueListBox::Clear() {
Expand Down
15 changes: 6 additions & 9 deletions UI/QueueListBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,25 @@ class QueueListBox :
public CUIListBox
{
public:
QueueListBox(boost::optional<std::string_view> drop_type_str,
std::string prompt_str);
QueueListBox(boost::optional<std::string_view> drop_type_str, std::string prompt_str);

void CompleteConstruction() override;

void Render() override;
void SizeMove(GG::Pt ul, GG::Pt lr) override;
void AcceptDrops(GG::Pt pt, std::vector<std::shared_ptr<GG::Wnd>> wnds,
GG::Flags<GG::ModKey> mod_keys) override;
void DragDropHere(GG::Pt pt, std::map<const Wnd*, bool>& drop_wnds_acceptable,
GG::Flags<GG::ModKey> mod_keys) override;
void AcceptDrops(GG::Pt pt, std::vector<std::shared_ptr<GG::Wnd>> wnds, GG::Flags<GG::ModKey> mod_keys) override;
void DragDropHere(GG::Pt pt, std::map<const Wnd*, bool>& drop_wnds_acceptable, GG::Flags<GG::ModKey> mod_keys) override;
void DragDropLeave() override;

GG::X RowWidth() const;
GG::X RowWidth() const noexcept;

//! scans this ListBox for the input iterator \a and returns its distance
//! from begin(), or -1 if not present
int IteraterIndex(const const_iterator it);

virtual void EnableOrderIssuing(bool enable = true);
bool OrderIssuingEnabled() const { return m_order_issuing_enabled; }
bool DisplayingValidQueueItems(); ///< whether or not this QueueListBox is displaying valid queue items, as opposed to, for example, a prompt for the user to enter an item
bool OrderIssuingEnabled() const noexcept { return m_order_issuing_enabled; }
bool DisplayingValidQueueItems() const noexcept; ///< whether or not this QueueListBox is displaying valid queue items, as opposed to, for example, a prompt for the user to enter an item

void Clear();

Expand Down

0 comments on commit f0f380f

Please sign in to comment.