/***************************************************************************
 *   Copyright (C) 2005 by Doo-Hyun Jang                                   *
 *   ring0320@nate.com                                                     *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#include "group.h"

Group::Group(QString sID, QString sName)
{
	// m_sID = sID;
	//m_sName = sName;
	setGID( sID );
	setGName( sName );
	setType( MyListItem::Group );
}


Group::~Group()
{
}


#if 0
/*!
  \fn Group::getID() const
*/
const QString& Group::getGID() const
{
    return m_sID;
}
#endif

#if 0
const QString& Group::getGName( ) const
{
    return m_sName;
}
#endif

#include "group.moc"


void Group::removeBuddyHandle(const QString & sHandle)
{
	QStringList slTemp;
	slTemp.clear();

	for ( QStringList::Iterator it = m_slBuddyList.begin(); it != m_slBuddyList.end(); ++it )
	{
		if ( sHandle != *it )
			slTemp.append(*it);
	}

	m_slBuddyList = slTemp;

	return;
}

void Group::addBuddyHandle(const QString & sHandle)
{
	if ( m_slBuddyList.find( sHandle ) == m_slBuddyList.end() )
		m_slBuddyList.append( sHandle );
#ifdef NETDEBUG
	else
	{
		kdDebug() << " SKIP Group Add : [" << sHandle << "]" << endl; 
	}
#endif
}
