From 57b3e0e1f0b835ff2982e9f66c7af402caecd3c1 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Mon, 16 May 2005 15:50:42 +0000 Subject: Formatting updates to buddy window and menu item and made testing menu item visible. --- src/resources/buddylist.cpp | 66 ++++++++++++++++++++++----------------------- src/resources/buddylist.h | 64 +++++++++++++++++++++---------------------- 2 files changed, 65 insertions(+), 65 deletions(-) (limited to 'src/resources') diff --git a/src/resources/buddylist.cpp b/src/resources/buddylist.cpp index 91bcf986..226551c7 100644 --- a/src/resources/buddylist.cpp +++ b/src/resources/buddylist.cpp @@ -18,6 +18,7 @@ * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + * $Id$ */ #include "buddylist.h" @@ -33,49 +34,48 @@ BuddyList::~BuddyList() bool BuddyList::addBuddy(const std::string buddy) { - for(buddyit = buddylist.begin(); buddyit != buddylist.end(); buddyit++) - { - // Buddy already exist - if(*buddyit == buddy) return false; - } - - // Buddy doesnt exist, add it - buddylist.push_back(buddy); - - return true; + for (buddyit = buddylist.begin(); buddyit != buddylist.end(); buddyit++) + { + // Buddy already exist + if (*buddyit == buddy) return false; + } + + // Buddy doesnt exist, add it + buddylist.push_back(buddy); + + return true; } bool BuddyList::removeBuddy(const std::string buddy) { - if(buddylist.size() > 0) { - for(buddyit = buddylist.begin(); buddyit != buddylist.end(); buddyit++) - { - // Buddy exist, remove it - if(*buddyit == buddy) { - buddylist.remove(buddy); - return true; - } - } - } - - // Buddy doesnt exist - return false; + if (buddylist.size() > 0) { + for (buddyit = buddylist.begin(); buddyit != buddylist.end(); buddyit++) + { + // Buddy exist, remove it + if (*buddyit == buddy) { + buddylist.remove(buddy); + return true; + } + } + } + + // Buddy doesnt exist + return false; } int BuddyList::getNumberOfElements(void) { - return buddylist.size(); + return buddylist.size(); } std::string BuddyList::getElementAt(int number) { - if(number <= buddylist.size() - 1) - { - buddyit = buddylist.begin(); - std::advance(buddyit, number); - return *buddyit; - } - - return ""; -} + if (number <= buddylist.size() - 1) + { + buddyit = buddylist.begin(); + std::advance(buddyit, number); + return *buddyit; + } + return ""; +} diff --git a/src/resources/buddylist.h b/src/resources/buddylist.h index 704ce450..d0598747 100644 --- a/src/resources/buddylist.h +++ b/src/resources/buddylist.h @@ -18,6 +18,7 @@ * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + * $Id$ */ #ifndef _TMW_BUDDYLIST_H @@ -28,41 +29,40 @@ #include class BuddyList : public gcn::ListModel { - public: - /** - * Constructor - */ - BuddyList(); + public: + /** + * Constructor + */ + BuddyList(); - /** - * Destructor - */ - virtual ~BuddyList(); - - /** - * Adds buddy to the list - */ - bool addBuddy(const std::string buddy); + /** + * Destructor + */ + virtual ~BuddyList(); - /** - * Removes buddy from the list - */ - bool removeBuddy(const std::string buddy); - - /** - * Returns the number of buddy on the list - */ - int getNumberOfElements(void); - - /** - * Returns the buddy of the number or null - */ - std::string getElementAt(int number); + /** + * Adds buddy to the list + */ + bool addBuddy(const std::string buddy); - private: - std::list buddylist; /**< Buddy list */ - std::list::iterator buddyit; /**< Iterator */ + /** + * Removes buddy from the list + */ + bool removeBuddy(const std::string buddy); + + /** + * Returns the number of buddy on the list + */ + int getNumberOfElements(void); + + /** + * Returns the buddy of the number or null + */ + std::string getElementAt(int number); + + private: + std::list buddylist; /**< Buddy list */ + std::list::iterator buddyit; /**< Iterator */ }; #endif /* _TMW_BUDDYLIST_H */ - -- cgit v1.2.3-70-g09d2