From 5685dc91951477ee0e0a280d1f30ec737cc95550 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Wed, 21 Jan 2004 13:34:40 +0000 Subject: empty accessor --- src/Container.cc | 4 ++-- src/Container.hh | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Container.cc b/src/Container.cc index b60b460..a53901d 100644 --- a/src/Container.cc +++ b/src/Container.cc @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Container.cc,v 1.12 2004/01/14 23:05:14 fluxgen Exp $ +// $Id: Container.cc,v 1.13 2004/01/21 13:34:40 fluxgen Exp $ #include "Container.hh" @@ -184,7 +184,7 @@ void Container::exposeEvent(XExposeEvent &event) { } void Container::repositionItems() { - if (size() == 0 || m_update_lock) + if (empty() || m_update_lock) return; //!! TODO vertical position diff --git a/src/Container.hh b/src/Container.hh index 6880aa3..158e034 100644 --- a/src/Container.hh +++ b/src/Container.hh @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Container.hh,v 1.5 2003/12/23 01:55:07 rathnor Exp $ +// $Id: Container.hh,v 1.6 2004/01/21 13:34:40 fluxgen Exp $ #ifndef CONTAINER_HH #define CONTAINER_HH @@ -68,10 +68,11 @@ public: /// accessors inline Alignment alignment() const { return m_align; } inline int size() const { return m_item_list.size(); } + inline bool empty() const { return m_item_list.empty(); } inline const Item selected() const { return m_selected; } inline Item selected() { return m_selected; } unsigned int maxWidthPerClient() const; - inline unsigned int maxHeightPerClient() const { return (size() == 0 ? height() : height()/size()); } + inline unsigned int maxHeightPerClient() const { return (empty() ? height() : height()/size()); } inline bool updateLock() const { return m_update_lock; } private: -- cgit v0.11.2