Logo Search packages:      
Sourcecode: nateon version File versions  Download package

void KNateon::slotDeleteGroup (  )  [private, slot]

그룹 리스트에서 삭제

Definition at line 1890 of file knateon.cpp.

References Group::getBuddyList(), KNateonMainview::getCurrentItem(), MyListItem::getGID(), MyListItem::getGName(), GroupList::getGroupByID(), NateonDPConnection::getGroupCache(), CurrentAccount::getGroupList(), NateonDPConnection::putRMVG(), KNateonMainview::removeCurrentItem(), and GroupList::removeGroup().

Referenced by connected(), and slotDeleteBuddy().

{
      QListViewItem *pItem;
      pItem = m_pMainView->getCurrentItem();
      GroupList* pGroupList = m_pCurrentAccount->getGroupList();
  
      Group *pGroup = pGroupList->getGroupByID( pItem->text(1) );

      if ( pGroup->getBuddyList().count() > 0 )
      {
            KMessageBox::information( this, UTF8("그룹 내에 친구가 있어 그룹을 삭제할 수 없습니다. 그룹을 삭제하려면 친구를 다른 그룹으로 이동해야 합니다."), UTF8("그룹 삭제") );
            return;
      } else if ( pGroup->getGID() == "0" )
    {
            KMessageBox::information( this, UTF8("기타 그룹은 기본 그룹으로 그룹을 삭제할 수 없습니다."), UTF8("그룹 삭제") );
            return;
    }

      int result = KMessageBox::  questionYesNo(this, UTF8("그룹을 삭제 하시겠습니까?"), UTF8("그룹 삭제") );
      if ( result == KMessageBox::No ) return;
      
      QString sCommand;
      sCommand = QString::number( m_pDPcon->getGroupCache() );
      sCommand += " ";
      sCommand += pItem->text(1);
      sCommand += "\r\n";
  
      m_pDPcon->putRMVG(sCommand);
      m_pMainView->removeCurrentItem();

  

      QStringList mGList;
      QPtrListIterator<Group> iterator( *pGroupList );
      Group * pRemoveGroup = 0;
      while(iterator.current() != 0)
      {
            pGroup = iterator.current();
            if ( pItem->text(1) != pGroup->getGID() )
                  mGList.append( pGroup->getGName() );
            else
                  pRemoveGroup = pGroup;
            ++iterator;
      }

      /*! 그룹 리스트에서 삭제 */
      pGroupList->removeGroup( pRemoveGroup );
  
      emit ChangeGroupList( mGList );
  
}


Generated by  Doxygen 1.6.0   Back to index